Sync with trunk.
[reactos.git] / dll / directx / wine / d3dcompiler_43 / asmshader.tab.c
1 /* A Bison parser, made by GNU Bison 2.5. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6
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.
11
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.
16
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/>. */
19
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.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
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. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 0
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
63
64 /* Substitute the variable and function names. */
65 #define yyparse asmshader_parse
66 #define yylex asmshader_lex
67 #define yyerror asmshader_error
68 #define yylval asmshader_lval
69 #define yychar asmshader_char
70 #define yydebug asmshader_debug
71 #define yynerrs asmshader_nerrs
72
73
74 /* Copy the first part of user declarations. */
75
76 /* Line 268 of yacc.c */
77 #line 22 "asmshader.y"
78
79 #include "d3dcompiler_private.h"
80
81 WINE_DEFAULT_DEBUG_CHANNEL(asmshader);
82
83 struct asm_parser asm_ctx;
84
85 void asmparser_message(struct asm_parser *ctx, const char *fmt, ...)
86 {
87 va_list args;
88
89 va_start(args, fmt);
90 compilation_message(&ctx->messages, fmt, args);
91 va_end(args);
92 }
93
94 static void asmshader_error(char const *s) {
95 asmparser_message(&asm_ctx, "Line %u: Error \"%s\" from bison\n", asm_ctx.line_no, s);
96 set_parse_status(&asm_ctx.status, PARSE_ERR);
97 }
98
99 static void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) {
100 /* We can have an additional offset without true relative addressing
101 * ex. c2[ 4 ] */
102 reg->regnum += rel->additional_offset;
103 if(!rel->has_rel_reg) {
104 reg->rel_reg = NULL;
105 } else {
106 reg->rel_reg = d3dcompiler_alloc(sizeof(*reg->rel_reg));
107 if(!reg->rel_reg) {
108 return;
109 }
110 reg->rel_reg->type = rel->type;
111 reg->rel_reg->u.swizzle = rel->swizzle;
112 reg->rel_reg->regnum = rel->rel_regnum;
113 }
114 }
115
116 /* Needed lexer functions declarations */
117 int asmshader_lex(void);
118
119
120
121
122 /* Line 268 of yacc.c */
123 #line 128 "asmshader.tab.c"
124
125 /* Enabling traces. */
126 #ifndef YYDEBUG
127 # define YYDEBUG 0
128 #endif
129
130 /* Enabling verbose error messages. */
131 #ifdef YYERROR_VERBOSE
132 # undef YYERROR_VERBOSE
133 # define YYERROR_VERBOSE 1
134 #else
135 # define YYERROR_VERBOSE 0
136 #endif
137
138 /* Enabling the token table. */
139 #ifndef YYTOKEN_TABLE
140 # define YYTOKEN_TABLE 0
141 #endif
142
143
144 /* Tokens. */
145 #ifndef YYTOKENTYPE
146 # define YYTOKENTYPE
147 /* Put the tokens into the symbol table, so that GDB and other debuggers
148 know about them. */
149 enum yytokentype {
150 INSTR_ADD = 258,
151 INSTR_NOP = 259,
152 INSTR_MOV = 260,
153 INSTR_SUB = 261,
154 INSTR_MAD = 262,
155 INSTR_MUL = 263,
156 INSTR_RCP = 264,
157 INSTR_RSQ = 265,
158 INSTR_DP3 = 266,
159 INSTR_DP4 = 267,
160 INSTR_MIN = 268,
161 INSTR_MAX = 269,
162 INSTR_SLT = 270,
163 INSTR_SGE = 271,
164 INSTR_ABS = 272,
165 INSTR_EXP = 273,
166 INSTR_LOG = 274,
167 INSTR_EXPP = 275,
168 INSTR_LOGP = 276,
169 INSTR_DST = 277,
170 INSTR_LRP = 278,
171 INSTR_FRC = 279,
172 INSTR_POW = 280,
173 INSTR_CRS = 281,
174 INSTR_SGN = 282,
175 INSTR_NRM = 283,
176 INSTR_SINCOS = 284,
177 INSTR_M4x4 = 285,
178 INSTR_M4x3 = 286,
179 INSTR_M3x4 = 287,
180 INSTR_M3x3 = 288,
181 INSTR_M3x2 = 289,
182 INSTR_DCL = 290,
183 INSTR_DEF = 291,
184 INSTR_DEFB = 292,
185 INSTR_DEFI = 293,
186 INSTR_REP = 294,
187 INSTR_ENDREP = 295,
188 INSTR_IF = 296,
189 INSTR_ELSE = 297,
190 INSTR_ENDIF = 298,
191 INSTR_BREAK = 299,
192 INSTR_BREAKP = 300,
193 INSTR_CALL = 301,
194 INSTR_CALLNZ = 302,
195 INSTR_LOOP = 303,
196 INSTR_RET = 304,
197 INSTR_ENDLOOP = 305,
198 INSTR_LABEL = 306,
199 INSTR_SETP = 307,
200 INSTR_TEXLDL = 308,
201 INSTR_LIT = 309,
202 INSTR_MOVA = 310,
203 INSTR_CND = 311,
204 INSTR_CMP = 312,
205 INSTR_DP2ADD = 313,
206 INSTR_TEXCOORD = 314,
207 INSTR_TEXCRD = 315,
208 INSTR_TEXKILL = 316,
209 INSTR_TEX = 317,
210 INSTR_TEXLD = 318,
211 INSTR_TEXBEM = 319,
212 INSTR_TEXBEML = 320,
213 INSTR_TEXREG2AR = 321,
214 INSTR_TEXREG2GB = 322,
215 INSTR_TEXREG2RGB = 323,
216 INSTR_TEXM3x2PAD = 324,
217 INSTR_TEXM3x2TEX = 325,
218 INSTR_TEXM3x3PAD = 326,
219 INSTR_TEXM3x3SPEC = 327,
220 INSTR_TEXM3x3VSPEC = 328,
221 INSTR_TEXM3x3TEX = 329,
222 INSTR_TEXDP3TEX = 330,
223 INSTR_TEXM3x2DEPTH = 331,
224 INSTR_TEXDP3 = 332,
225 INSTR_TEXM3x3 = 333,
226 INSTR_TEXDEPTH = 334,
227 INSTR_BEM = 335,
228 INSTR_DSX = 336,
229 INSTR_DSY = 337,
230 INSTR_TEXLDP = 338,
231 INSTR_TEXLDB = 339,
232 INSTR_TEXLDD = 340,
233 INSTR_PHASE = 341,
234 REG_TEMP = 342,
235 REG_OUTPUT = 343,
236 REG_INPUT = 344,
237 REG_CONSTFLOAT = 345,
238 REG_CONSTINT = 346,
239 REG_CONSTBOOL = 347,
240 REG_TEXTURE = 348,
241 REG_SAMPLER = 349,
242 REG_TEXCRDOUT = 350,
243 REG_OPOS = 351,
244 REG_OFOG = 352,
245 REG_OPTS = 353,
246 REG_VERTEXCOLOR = 354,
247 REG_FRAGCOLOR = 355,
248 REG_FRAGDEPTH = 356,
249 REG_VPOS = 357,
250 REG_VFACE = 358,
251 REG_ADDRESS = 359,
252 REG_LOOP = 360,
253 REG_PREDICATE = 361,
254 REG_LABEL = 362,
255 VER_VS10 = 363,
256 VER_VS11 = 364,
257 VER_VS20 = 365,
258 VER_VS2X = 366,
259 VER_VS30 = 367,
260 VER_PS10 = 368,
261 VER_PS11 = 369,
262 VER_PS12 = 370,
263 VER_PS13 = 371,
264 VER_PS14 = 372,
265 VER_PS20 = 373,
266 VER_PS2X = 374,
267 VER_PS30 = 375,
268 SHIFT_X2 = 376,
269 SHIFT_X4 = 377,
270 SHIFT_X8 = 378,
271 SHIFT_D2 = 379,
272 SHIFT_D4 = 380,
273 SHIFT_D8 = 381,
274 MOD_SAT = 382,
275 MOD_PP = 383,
276 MOD_CENTROID = 384,
277 COMP_GT = 385,
278 COMP_LT = 386,
279 COMP_GE = 387,
280 COMP_LE = 388,
281 COMP_EQ = 389,
282 COMP_NE = 390,
283 SMOD_BIAS = 391,
284 SMOD_SCALEBIAS = 392,
285 SMOD_DZ = 393,
286 SMOD_DW = 394,
287 SMOD_ABS = 395,
288 SMOD_NOT = 396,
289 SAMPTYPE_1D = 397,
290 SAMPTYPE_2D = 398,
291 SAMPTYPE_CUBE = 399,
292 SAMPTYPE_VOLUME = 400,
293 USAGE_POSITION = 401,
294 USAGE_BLENDWEIGHT = 402,
295 USAGE_BLENDINDICES = 403,
296 USAGE_NORMAL = 404,
297 USAGE_PSIZE = 405,
298 USAGE_TEXCOORD = 406,
299 USAGE_TANGENT = 407,
300 USAGE_BINORMAL = 408,
301 USAGE_TESSFACTOR = 409,
302 USAGE_POSITIONT = 410,
303 USAGE_COLOR = 411,
304 USAGE_FOG = 412,
305 USAGE_DEPTH = 413,
306 USAGE_SAMPLE = 414,
307 COMPONENT = 415,
308 IMMVAL = 416,
309 IMMBOOL = 417
310 };
311 #endif
312
313
314
315 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
316 typedef union YYSTYPE
317 {
318
319 /* Line 293 of yacc.c */
320 #line 70 "asmshader.y"
321
322 struct {
323 float val;
324 BOOL integer;
325 } immval;
326 BOOL immbool;
327 unsigned int regnum;
328 struct shader_reg reg;
329 DWORD srcmod;
330 DWORD writemask;
331 struct {
332 DWORD writemask;
333 DWORD idx;
334 DWORD last;
335 } wm_components;
336 DWORD swizzle;
337 struct {
338 DWORD swizzle;
339 DWORD idx;
340 } sw_components;
341 DWORD component;
342 struct {
343 DWORD mod;
344 DWORD shift;
345 } modshift;
346 enum bwriter_comparison_type comptype;
347 struct {
348 DWORD dclusage;
349 unsigned int regnum;
350 } declaration;
351 enum bwritersampler_texture_type samplertype;
352 struct rel_reg rel_reg;
353 struct src_regs sregs;
354
355
356
357 /* Line 293 of yacc.c */
358 #line 363 "asmshader.tab.c"
359 } YYSTYPE;
360 # define YYSTYPE_IS_TRIVIAL 1
361 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
362 # define YYSTYPE_IS_DECLARED 1
363 #endif
364
365
366 /* Copy the second part of user declarations. */
367
368
369 /* Line 343 of yacc.c */
370 #line 375 "asmshader.tab.c"
371
372 #ifdef short
373 # undef short
374 #endif
375
376 #ifdef YYTYPE_UINT8
377 typedef YYTYPE_UINT8 yytype_uint8;
378 #else
379 typedef unsigned char yytype_uint8;
380 #endif
381
382 #ifdef YYTYPE_INT8
383 typedef YYTYPE_INT8 yytype_int8;
384 #elif (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 typedef signed char yytype_int8;
387 #else
388 typedef short int yytype_int8;
389 #endif
390
391 #ifdef YYTYPE_UINT16
392 typedef YYTYPE_UINT16 yytype_uint16;
393 #else
394 typedef unsigned short int yytype_uint16;
395 #endif
396
397 #ifdef YYTYPE_INT16
398 typedef YYTYPE_INT16 yytype_int16;
399 #else
400 typedef short int yytype_int16;
401 #endif
402
403 #ifndef YYSIZE_T
404 # ifdef __SIZE_TYPE__
405 # define YYSIZE_T __SIZE_TYPE__
406 # elif defined size_t
407 # define YYSIZE_T size_t
408 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
409 || defined __cplusplus || defined _MSC_VER)
410 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
411 # define YYSIZE_T size_t
412 # else
413 # define YYSIZE_T unsigned int
414 # endif
415 #endif
416
417 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
418
419 #ifndef YY_
420 # if defined YYENABLE_NLS && YYENABLE_NLS
421 # if ENABLE_NLS
422 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
423 # define YY_(msgid) dgettext ("bison-runtime", msgid)
424 # endif
425 # endif
426 # ifndef YY_
427 # define YY_(msgid) msgid
428 # endif
429 #endif
430
431 /* Suppress unused-variable warnings by "using" E. */
432 #if ! defined lint || defined __GNUC__
433 # define YYUSE(e) ((void) (e))
434 #else
435 # define YYUSE(e) /* empty */
436 #endif
437
438 /* Identity function, used to suppress warnings about constant conditions. */
439 #ifndef lint
440 # define YYID(n) (n)
441 #else
442 #if (defined __STDC__ || defined __C99__FUNC__ \
443 || defined __cplusplus || defined _MSC_VER)
444 static int
445 YYID (int yyi)
446 #else
447 static int
448 YYID (yyi)
449 int yyi;
450 #endif
451 {
452 return yyi;
453 }
454 #endif
455
456 #if ! defined yyoverflow || YYERROR_VERBOSE
457
458 /* The parser invokes alloca or malloc; define the necessary symbols. */
459
460 # ifdef YYSTACK_USE_ALLOCA
461 # if YYSTACK_USE_ALLOCA
462 # ifdef __GNUC__
463 # define YYSTACK_ALLOC __builtin_alloca
464 # elif defined __BUILTIN_VA_ARG_INCR
465 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
466 # elif defined _AIX
467 # define YYSTACK_ALLOC __alloca
468 # elif defined _MSC_VER
469 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
470 # define alloca _alloca
471 # else
472 # define YYSTACK_ALLOC alloca
473 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
474 || defined __cplusplus || defined _MSC_VER)
475 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
476 # ifndef EXIT_SUCCESS
477 # define EXIT_SUCCESS 0
478 # endif
479 # endif
480 # endif
481 # endif
482 # endif
483
484 # ifdef YYSTACK_ALLOC
485 /* Pacify GCC's `empty if-body' warning. */
486 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
487 # ifndef YYSTACK_ALLOC_MAXIMUM
488 /* The OS might guarantee only one guard page at the bottom of the stack,
489 and a page size can be as small as 4096 bytes. So we cannot safely
490 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
491 to allow for a few compiler-allocated temporary stack slots. */
492 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
493 # endif
494 # else
495 # define YYSTACK_ALLOC YYMALLOC
496 # define YYSTACK_FREE YYFREE
497 # ifndef YYSTACK_ALLOC_MAXIMUM
498 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
499 # endif
500 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
501 && ! ((defined YYMALLOC || defined malloc) \
502 && (defined YYFREE || defined free)))
503 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
504 # ifndef EXIT_SUCCESS
505 # define EXIT_SUCCESS 0
506 # endif
507 # endif
508 # ifndef YYMALLOC
509 # define YYMALLOC malloc
510 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
511 || defined __cplusplus || defined _MSC_VER)
512 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
513 # endif
514 # endif
515 # ifndef YYFREE
516 # define YYFREE free
517 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
518 || defined __cplusplus || defined _MSC_VER)
519 void free (void *); /* INFRINGES ON USER NAME SPACE */
520 # endif
521 # endif
522 # endif
523 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
524
525
526 #if (! defined yyoverflow \
527 && (! defined __cplusplus \
528 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
529
530 /* A type that is properly aligned for any stack member. */
531 union yyalloc
532 {
533 yytype_int16 yyss_alloc;
534 YYSTYPE yyvs_alloc;
535 };
536
537 /* The size of the maximum gap between one aligned stack and the next. */
538 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
539
540 /* The size of an array large to enough to hold all stacks, each with
541 N elements. */
542 # define YYSTACK_BYTES(N) \
543 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
544 + YYSTACK_GAP_MAXIMUM)
545
546 # define YYCOPY_NEEDED 1
547
548 /* Relocate STACK from its old location to the new one. The
549 local variables YYSIZE and YYSTACKSIZE give the old and new number of
550 elements in the stack, and YYPTR gives the new location of the
551 stack. Advance YYPTR to a properly aligned location for the next
552 stack. */
553 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
554 do \
555 { \
556 YYSIZE_T yynewbytes; \
557 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
558 Stack = &yyptr->Stack_alloc; \
559 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
560 yyptr += yynewbytes / sizeof (*yyptr); \
561 } \
562 while (YYID (0))
563
564 #endif
565
566 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
567 /* Copy COUNT objects from FROM to TO. The source and destination do
568 not overlap. */
569 # ifndef YYCOPY
570 # if defined __GNUC__ && 1 < __GNUC__
571 # define YYCOPY(To, From, Count) \
572 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
573 # else
574 # define YYCOPY(To, From, Count) \
575 do \
576 { \
577 YYSIZE_T yyi; \
578 for (yyi = 0; yyi < (Count); yyi++) \
579 (To)[yyi] = (From)[yyi]; \
580 } \
581 while (YYID (0))
582 # endif
583 # endif
584 #endif /* !YYCOPY_NEEDED */
585
586 /* YYFINAL -- State number of the termination state. */
587 #define YYFINAL 16
588 /* YYLAST -- Last index in YYTABLE. */
589 #define YYLAST 733
590
591 /* YYNTOKENS -- Number of terminals. */
592 #define YYNTOKENS 171
593 /* YYNNTS -- Number of nonterminals. */
594 #define YYNNTS 26
595 /* YYNRULES -- Number of rules. */
596 #define YYNRULES 228
597 /* YYNRULES -- Number of states. */
598 #define YYNSTATES 552
599
600 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
601 #define YYUNDEFTOK 2
602 #define YYMAXUTOK 417
603
604 #define YYTRANSLATE(YYX) \
605 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
606
607 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
608 static const yytype_uint8 yytranslate[] =
609 {
610 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 169, 170, 2, 163, 164, 166, 165, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 167, 2, 168, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 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, 1, 2, 3, 4,
636 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
637 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
638 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
639 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
640 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
641 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
642 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
643 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
644 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
645 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
646 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
647 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
648 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
649 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
650 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
651 155, 156, 157, 158, 159, 160, 161, 162
652 };
653
654 #if YYDEBUG
655 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
656 YYRHS. */
657 static const yytype_uint16 yyprhs[] =
658 {
659 0, 0, 3, 6, 8, 10, 12, 14, 16, 18,
660 20, 22, 24, 26, 28, 30, 32, 33, 36, 38,
661 41, 44, 50, 52, 58, 64, 70, 76, 82, 88,
662 94, 100, 106, 112, 118, 124, 130, 136, 142, 148,
663 154, 160, 166, 172, 178, 184, 190, 196, 202, 208,
664 214, 220, 226, 232, 236, 241, 246, 252, 256, 261,
665 266, 270, 275, 280, 291, 302, 307, 310, 312, 315,
666 319, 321, 323, 325, 329, 332, 335, 338, 341, 343,
667 345, 348, 354, 360, 366, 372, 378, 384, 390, 394,
668 400, 403, 407, 411, 417, 423, 429, 435, 441, 447,
669 453, 459, 465, 471, 477, 483, 489, 495, 501, 507,
670 513, 519, 525, 531, 537, 543, 545, 548, 551, 553,
671 555, 557, 559, 561, 563, 565, 567, 569, 571, 573,
672 575, 577, 579, 581, 583, 585, 587, 589, 591, 594,
673 596, 599, 600, 603, 605, 608, 609, 612, 614, 616,
674 618, 620, 622, 624, 626, 628, 630, 632, 636, 640,
675 645, 650, 656, 662, 669, 673, 674, 678, 683, 690,
676 697, 706, 708, 712, 714, 716, 718, 720, 722, 724,
677 726, 728, 730, 732, 734, 736, 738, 740, 742, 744,
678 746, 748, 750, 752, 754, 756, 758, 760, 762, 764,
679 766, 768, 770, 772, 774, 776, 778, 780, 782, 784,
680 786, 788, 790, 792, 794, 796, 798, 800, 802, 804,
681 806, 808, 810, 812, 814, 816, 818, 820, 825
682 };
683
684 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
685 static const yytype_int16 yyrhs[] =
686 {
687 172, 0, -1, 173, 174, -1, 108, -1, 109, -1,
688 110, -1, 111, -1, 112, -1, 113, -1, 114, -1,
689 115, -1, 116, -1, 117, -1, 118, -1, 119, -1,
690 120, -1, -1, 174, 175, -1, 176, -1, 196, 176,
691 -1, 163, 176, -1, 3, 183, 177, 164, 185, -1,
692 4, -1, 5, 183, 177, 164, 185, -1, 6, 183,
693 177, 164, 185, -1, 7, 183, 177, 164, 185, -1,
694 8, 183, 177, 164, 185, -1, 9, 183, 177, 164,
695 185, -1, 10, 183, 177, 164, 185, -1, 11, 183,
696 177, 164, 185, -1, 12, 183, 177, 164, 185, -1,
697 13, 183, 177, 164, 185, -1, 14, 183, 177, 164,
698 185, -1, 15, 183, 177, 164, 185, -1, 16, 183,
699 177, 164, 185, -1, 17, 183, 177, 164, 185, -1,
700 18, 183, 177, 164, 185, -1, 19, 183, 177, 164,
701 185, -1, 21, 183, 177, 164, 185, -1, 20, 183,
702 177, 164, 185, -1, 22, 183, 177, 164, 185, -1,
703 23, 183, 177, 164, 185, -1, 24, 183, 177, 164,
704 185, -1, 25, 183, 177, 164, 185, -1, 26, 183,
705 177, 164, 185, -1, 27, 183, 177, 164, 185, -1,
706 28, 183, 177, 164, 185, -1, 29, 183, 177, 164,
707 185, -1, 30, 183, 177, 164, 185, -1, 31, 183,
708 177, 164, 185, -1, 32, 183, 177, 164, 185, -1,
709 33, 183, 177, 164, 185, -1, 34, 183, 177, 164,
710 185, -1, 35, 193, 88, -1, 35, 193, 88, 179,
711 -1, 35, 193, 183, 194, -1, 35, 193, 183, 194,
712 179, -1, 35, 183, 194, -1, 35, 183, 194, 179,
713 -1, 35, 195, 183, 94, -1, 35, 183, 94, -1,
714 35, 195, 183, 194, -1, 35, 195, 183, 88, -1,
715 36, 90, 164, 161, 164, 161, 164, 161, 164, 161,
716 -1, 38, 91, 164, 161, 164, 161, 164, 161, 164,
717 161, -1, 37, 92, 164, 162, -1, 39, 185, -1,
718 40, -1, 41, 185, -1, 41, 192, 185, -1, 42,
719 -1, 43, -1, 44, -1, 44, 192, 185, -1, 45,
720 185, -1, 46, 185, -1, 47, 185, -1, 48, 185,
721 -1, 49, -1, 50, -1, 51, 185, -1, 52, 192,
722 177, 164, 185, -1, 53, 183, 177, 164, 185, -1,
723 54, 183, 177, 164, 185, -1, 55, 183, 177, 164,
724 185, -1, 56, 183, 177, 164, 185, -1, 57, 183,
725 177, 164, 185, -1, 58, 183, 177, 164, 185, -1,
726 59, 183, 177, -1, 60, 183, 177, 164, 185, -1,
727 61, 177, -1, 62, 183, 177, -1, 79, 183, 177,
728 -1, 63, 183, 177, 164, 185, -1, 83, 183, 177,
729 164, 185, -1, 84, 183, 177, 164, 185, -1, 64,
730 183, 177, 164, 185, -1, 65, 183, 177, 164, 185,
731 -1, 66, 183, 177, 164, 185, -1, 67, 183, 177,
732 164, 185, -1, 68, 183, 177, 164, 185, -1, 69,
733 183, 177, 164, 185, -1, 71, 183, 177, 164, 185,
734 -1, 72, 183, 177, 164, 185, -1, 73, 183, 177,
735 164, 185, -1, 74, 183, 177, 164, 185, -1, 75,
736 183, 177, 164, 185, -1, 76, 183, 177, 164, 185,
737 -1, 70, 183, 177, 164, 185, -1, 77, 183, 177,
738 164, 185, -1, 78, 183, 177, 164, 185, -1, 80,
739 183, 177, 164, 185, -1, 81, 183, 177, 164, 185,
740 -1, 82, 183, 177, 164, 185, -1, 85, 183, 177,
741 164, 185, -1, 86, -1, 178, 187, -1, 178, 179,
742 -1, 87, -1, 88, -1, 89, -1, 90, -1, 91,
743 -1, 92, -1, 93, -1, 95, -1, 94, -1, 96,
744 -1, 98, -1, 97, -1, 99, -1, 100, -1, 101,
745 -1, 106, -1, 102, -1, 103, -1, 104, -1, 105,
746 -1, 165, 180, -1, 160, -1, 180, 160, -1, -1,
747 165, 182, -1, 160, -1, 182, 160, -1, -1, 183,
748 184, -1, 121, -1, 122, -1, 123, -1, 124, -1,
749 125, -1, 126, -1, 127, -1, 128, -1, 129, -1,
750 186, -1, 185, 164, 186, -1, 191, 187, 181, -1,
751 191, 187, 189, 181, -1, 166, 191, 187, 181, -1,
752 166, 191, 187, 189, 181, -1, 161, 166, 191, 187,
753 181, -1, 161, 166, 191, 187, 189, 181, -1, 141,
754 191, 181, -1, -1, 167, 188, 168, -1, 167, 190,
755 181, 168, -1, 167, 188, 163, 190, 181, 168, -1,
756 167, 190, 181, 163, 188, 168, -1, 167, 188, 163,
757 190, 181, 163, 188, 168, -1, 161, -1, 188, 163,
758 161, -1, 136, -1, 121, -1, 137, -1, 138, -1,
759 139, -1, 140, -1, 104, -1, 105, -1, 87, -1,
760 88, -1, 89, -1, 90, -1, 91, -1, 92, -1,
761 93, -1, 95, -1, 94, -1, 96, -1, 97, -1,
762 99, -1, 100, -1, 101, -1, 106, -1, 102, -1,
763 103, -1, 104, -1, 105, -1, 107, -1, 130, -1,
764 131, -1, 132, -1, 133, -1, 134, -1, 135, -1,
765 146, -1, 147, -1, 148, -1, 149, -1, 150, -1,
766 151, -1, 152, -1, 153, -1, 154, -1, 155, -1,
767 156, -1, 157, -1, 158, -1, 159, -1, 89, -1,
768 93, -1, 142, -1, 143, -1, 144, -1, 145, -1,
769 169, 106, 181, 170, -1, 169, 141, 106, 181, 170,
770 -1
771 };
772
773 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
774 static const yytype_uint16 yyrline[] =
775 {
776 0, 311, 311, 316, 321, 326, 331, 336, 341, 346,
777 351, 356, 361, 366, 371, 376, 382, 383, 388, 392,
778 397, 403, 408, 413, 418, 423, 428, 433, 438, 443,
779 448, 453, 458, 463, 468, 473, 478, 483, 488, 493,
780 498, 503, 508, 513, 518, 523, 528, 533, 538, 543,
781 548, 553, 558, 563, 575, 587, 610, 633, 655, 677,
782 687, 702, 709, 716, 720, 724, 728, 733, 738, 743,
783 748, 753, 758, 763, 768, 773, 778, 783, 788, 793,
784 798, 803, 808, 813, 818, 823, 828, 833, 838, 843,
785 849, 854, 859, 864, 875, 880, 885, 890, 895, 900,
786 905, 910, 915, 920, 925, 930, 935, 940, 945, 950,
787 955, 960, 965, 970, 975, 980, 987, 995, 1004, 1008,
788 1012, 1016, 1022, 1028, 1034, 1038, 1042, 1048, 1052, 1056,
789 1060, 1064, 1068, 1072, 1076, 1082, 1088, 1093, 1100, 1115,
790 1121, 1137, 1141, 1163, 1168, 1182, 1186, 1199, 1204, 1209,
791 1214, 1219, 1224, 1229, 1234, 1239, 1245, 1250, 1261, 1269,
792 1277, 1285, 1310, 1324, 1338, 1348, 1352, 1357, 1365, 1373,
793 1381, 1390, 1399, 1409, 1413, 1417, 1421, 1425, 1429, 1434,
794 1438, 1443, 1447, 1453, 1457, 1461, 1465, 1469, 1473, 1479,
795 1483, 1489, 1495, 1501, 1507, 1513, 1517, 1521, 1525, 1529,
796 1533, 1538, 1539, 1540, 1541, 1542, 1543, 1545, 1551, 1557,
797 1563, 1569, 1575, 1581, 1587, 1593, 1599, 1605, 1611, 1617,
798 1623, 1630, 1634, 1639, 1643, 1647, 1651, 1656, 1664
799 };
800 #endif
801
802 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
803 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
804 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
805 static const char *const yytname[] =
806 {
807 "$end", "error", "$undefined", "INSTR_ADD", "INSTR_NOP", "INSTR_MOV",
808 "INSTR_SUB", "INSTR_MAD", "INSTR_MUL", "INSTR_RCP", "INSTR_RSQ",
809 "INSTR_DP3", "INSTR_DP4", "INSTR_MIN", "INSTR_MAX", "INSTR_SLT",
810 "INSTR_SGE", "INSTR_ABS", "INSTR_EXP", "INSTR_LOG", "INSTR_EXPP",
811 "INSTR_LOGP", "INSTR_DST", "INSTR_LRP", "INSTR_FRC", "INSTR_POW",
812 "INSTR_CRS", "INSTR_SGN", "INSTR_NRM", "INSTR_SINCOS", "INSTR_M4x4",
813 "INSTR_M4x3", "INSTR_M3x4", "INSTR_M3x3", "INSTR_M3x2", "INSTR_DCL",
814 "INSTR_DEF", "INSTR_DEFB", "INSTR_DEFI", "INSTR_REP", "INSTR_ENDREP",
815 "INSTR_IF", "INSTR_ELSE", "INSTR_ENDIF", "INSTR_BREAK", "INSTR_BREAKP",
816 "INSTR_CALL", "INSTR_CALLNZ", "INSTR_LOOP", "INSTR_RET", "INSTR_ENDLOOP",
817 "INSTR_LABEL", "INSTR_SETP", "INSTR_TEXLDL", "INSTR_LIT", "INSTR_MOVA",
818 "INSTR_CND", "INSTR_CMP", "INSTR_DP2ADD", "INSTR_TEXCOORD",
819 "INSTR_TEXCRD", "INSTR_TEXKILL", "INSTR_TEX", "INSTR_TEXLD",
820 "INSTR_TEXBEM", "INSTR_TEXBEML", "INSTR_TEXREG2AR", "INSTR_TEXREG2GB",
821 "INSTR_TEXREG2RGB", "INSTR_TEXM3x2PAD", "INSTR_TEXM3x2TEX",
822 "INSTR_TEXM3x3PAD", "INSTR_TEXM3x3SPEC", "INSTR_TEXM3x3VSPEC",
823 "INSTR_TEXM3x3TEX", "INSTR_TEXDP3TEX", "INSTR_TEXM3x2DEPTH",
824 "INSTR_TEXDP3", "INSTR_TEXM3x3", "INSTR_TEXDEPTH", "INSTR_BEM",
825 "INSTR_DSX", "INSTR_DSY", "INSTR_TEXLDP", "INSTR_TEXLDB", "INSTR_TEXLDD",
826 "INSTR_PHASE", "REG_TEMP", "REG_OUTPUT", "REG_INPUT", "REG_CONSTFLOAT",
827 "REG_CONSTINT", "REG_CONSTBOOL", "REG_TEXTURE", "REG_SAMPLER",
828 "REG_TEXCRDOUT", "REG_OPOS", "REG_OFOG", "REG_OPTS", "REG_VERTEXCOLOR",
829 "REG_FRAGCOLOR", "REG_FRAGDEPTH", "REG_VPOS", "REG_VFACE", "REG_ADDRESS",
830 "REG_LOOP", "REG_PREDICATE", "REG_LABEL", "VER_VS10", "VER_VS11",
831 "VER_VS20", "VER_VS2X", "VER_VS30", "VER_PS10", "VER_PS11", "VER_PS12",
832 "VER_PS13", "VER_PS14", "VER_PS20", "VER_PS2X", "VER_PS30", "SHIFT_X2",
833 "SHIFT_X4", "SHIFT_X8", "SHIFT_D2", "SHIFT_D4", "SHIFT_D8", "MOD_SAT",
834 "MOD_PP", "MOD_CENTROID", "COMP_GT", "COMP_LT", "COMP_GE", "COMP_LE",
835 "COMP_EQ", "COMP_NE", "SMOD_BIAS", "SMOD_SCALEBIAS", "SMOD_DZ",
836 "SMOD_DW", "SMOD_ABS", "SMOD_NOT", "SAMPTYPE_1D", "SAMPTYPE_2D",
837 "SAMPTYPE_CUBE", "SAMPTYPE_VOLUME", "USAGE_POSITION",
838 "USAGE_BLENDWEIGHT", "USAGE_BLENDINDICES", "USAGE_NORMAL", "USAGE_PSIZE",
839 "USAGE_TEXCOORD", "USAGE_TANGENT", "USAGE_BINORMAL", "USAGE_TESSFACTOR",
840 "USAGE_POSITIONT", "USAGE_COLOR", "USAGE_FOG", "USAGE_DEPTH",
841 "USAGE_SAMPLE", "COMPONENT", "IMMVAL", "IMMBOOL", "'+'", "','", "'.'",
842 "'-'", "'['", "']'", "'('", "')'", "$accept", "shader", "version_marker",
843 "instructions", "complexinstr", "instruction", "dreg", "dreg_name",
844 "writemask", "wm_components", "swizzle", "sw_components", "omods",
845 "omodifier", "sregs", "sreg", "rel_reg", "immsum", "smod", "relreg_name",
846 "sreg_name", "comp", "dclusage", "dcl_inputreg", "sampdcl", "predicate", 0
847 };
848 #endif
849
850 # ifdef YYPRINT
851 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
852 token YYLEX-NUM. */
853 static const yytype_uint16 yytoknum[] =
854 {
855 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
856 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
857 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
858 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
859 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
860 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
861 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
862 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
863 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
864 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
865 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
866 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
867 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
868 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
869 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
870 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
871 415, 416, 417, 43, 44, 46, 45, 91, 93, 40,
872 41
873 };
874 # endif
875
876 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
877 static const yytype_uint8 yyr1[] =
878 {
879 0, 171, 172, 173, 173, 173, 173, 173, 173, 173,
880 173, 173, 173, 173, 173, 173, 174, 174, 175, 175,
881 175, 176, 176, 176, 176, 176, 176, 176, 176, 176,
882 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
883 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
884 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
885 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
886 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
887 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
888 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
889 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
890 176, 176, 176, 176, 176, 176, 177, 177, 178, 178,
891 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
892 178, 178, 178, 178, 178, 178, 178, 178, 179, 180,
893 180, 181, 181, 182, 182, 183, 183, 184, 184, 184,
894 184, 184, 184, 184, 184, 184, 185, 185, 186, 186,
895 186, 186, 186, 186, 186, 187, 187, 187, 187, 187,
896 187, 188, 188, 189, 189, 189, 189, 189, 189, 190,
897 190, 191, 191, 191, 191, 191, 191, 191, 191, 191,
898 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
899 191, 192, 192, 192, 192, 192, 192, 193, 193, 193,
900 193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
901 193, 194, 194, 195, 195, 195, 195, 196, 196
902 };
903
904 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
905 static const yytype_uint8 yyr2[] =
906 {
907 0, 2, 2, 1, 1, 1, 1, 1, 1, 1,
908 1, 1, 1, 1, 1, 1, 0, 2, 1, 2,
909 2, 5, 1, 5, 5, 5, 5, 5, 5, 5,
910 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
911 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
912 5, 5, 5, 3, 4, 4, 5, 3, 4, 4,
913 3, 4, 4, 10, 10, 4, 2, 1, 2, 3,
914 1, 1, 1, 3, 2, 2, 2, 2, 1, 1,
915 2, 5, 5, 5, 5, 5, 5, 5, 3, 5,
916 2, 3, 3, 5, 5, 5, 5, 5, 5, 5,
917 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
918 5, 5, 5, 5, 5, 1, 2, 2, 1, 1,
919 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
920 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
921 2, 0, 2, 1, 2, 0, 2, 1, 1, 1,
922 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
923 4, 5, 5, 6, 3, 0, 3, 4, 6, 6,
924 8, 1, 3, 1, 1, 1, 1, 1, 1, 1,
925 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
926 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
927 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
928 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
929 1, 1, 1, 1, 1, 1, 1, 4, 5
930 };
931
932 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
933 Performed when YYTABLE doesn't specify something else to do. Zero
934 means the default is an error. */
935 static const yytype_uint8 yydefact[] =
936 {
937 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
938 12, 13, 14, 15, 0, 16, 1, 2, 145, 22,
939 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
940 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
941 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
942 145, 0, 0, 0, 0, 67, 0, 70, 71, 72,
943 0, 0, 0, 0, 78, 79, 0, 0, 145, 145,
944 145, 145, 145, 145, 145, 145, 0, 145, 145, 145,
945 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
946 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
947 145, 115, 0, 0, 17, 18, 0, 0, 0, 0,
948 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
949 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
950 0, 0, 0, 0, 0, 0, 0, 0, 223, 224,
951 225, 226, 207, 208, 209, 210, 211, 212, 213, 214,
952 215, 216, 217, 218, 219, 220, 0, 145, 145, 0,
953 0, 0, 181, 182, 183, 184, 185, 186, 187, 189,
954 188, 190, 191, 192, 193, 194, 196, 197, 198, 199,
955 195, 200, 0, 0, 0, 66, 156, 165, 201, 202,
956 203, 204, 205, 206, 68, 0, 0, 74, 75, 76,
957 77, 80, 0, 0, 0, 0, 0, 0, 0, 0,
958 0, 118, 119, 120, 121, 122, 123, 124, 126, 125,
959 127, 129, 128, 130, 131, 132, 134, 135, 136, 137,
960 133, 90, 165, 0, 0, 0, 0, 0, 0, 0,
961 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
962 0, 0, 0, 0, 0, 0, 0, 20, 141, 0,
963 19, 147, 148, 149, 150, 151, 152, 153, 154, 155,
964 0, 146, 0, 0, 0, 0, 0, 0, 0, 0,
965 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
966 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
967 0, 0, 221, 222, 60, 57, 53, 0, 0, 0,
968 0, 0, 141, 0, 165, 0, 0, 141, 69, 73,
969 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
970 117, 116, 91, 0, 0, 0, 0, 0, 0, 0,
971 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,
972 0, 0, 0, 0, 0, 0, 0, 0, 141, 0,
973 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
974 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
975 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
976 58, 54, 55, 62, 59, 61, 0, 65, 0, 164,
977 165, 141, 157, 179, 180, 171, 0, 141, 174, 173,
978 175, 176, 177, 178, 158, 141, 0, 0, 0, 0,
979 0, 0, 0, 0, 139, 138, 0, 0, 0, 0,
980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
981 0, 0, 0, 0, 0, 0, 0, 0, 143, 142,
982 227, 0, 21, 23, 24, 25, 26, 27, 28, 29,
983 30, 31, 32, 33, 34, 35, 36, 37, 39, 38,
984 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
985 50, 51, 52, 56, 0, 0, 141, 160, 141, 0,
986 166, 0, 159, 81, 82, 83, 84, 85, 86, 87,
987 89, 140, 93, 96, 97, 98, 99, 100, 101, 108,
988 102, 103, 104, 105, 106, 107, 109, 110, 111, 112,
989 113, 94, 95, 114, 144, 228, 0, 0, 162, 141,
990 161, 172, 141, 0, 167, 0, 0, 163, 0, 0,
991 0, 0, 0, 168, 0, 169, 0, 0, 0, 63,
992 64, 170
993 };
994
995 /* YYDEFGOTO[NTERM-NUM]. */
996 static const yytype_int16 yydefgoto[] =
997 {
998 -1, 14, 15, 17, 104, 105, 231, 232, 330, 425,
999 357, 449, 107, 271, 185, 186, 317, 406, 415, 407,
1000 187, 195, 157, 305, 158, 106
1001 };
1002
1003 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1004 STATE-NUM. */
1005 #define YYPACT_NINF -458
1006 static const yytype_int16 yypact[] =
1007 {
1008 386, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1009 -458, -458, -458, -458, 11, -458, -458, 389, -458, -458,
1010 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1011 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1012 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1013 334, -42, -28, -10, -34, -458, 95, -458, -458, 3,
1014 -34, -34, -34, -34, -458, -458, -34, 3, -458, -458,
1015 -458, -458, -458, -458, -458, -458, 247, -458, -458, -458,
1016 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1017 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1018 -458, -458, 647, -55, -458, -458, 647, 505, 505, 505,
1019 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
1020 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
1021 505, 505, 505, 505, 505, 505, 505, 505, -458, -458,
1022 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1023 -458, -458, -458, -458, -458, -458, 123, 2, -458, -44,
1024 -40, -39, -458, -458, -458, -458, -458, -458, -458, -458,
1025 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1026 -458, -458, 185, -45, 185, -38, -458, -37, -458, -458,
1027 -458, -458, -458, -458, -38, -34, -34, -38, -38, -38,
1028 -38, -38, 247, 505, 505, 505, 505, 505, 505, 505,
1029 505, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1030 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1031 -458, -458, -76, 505, 505, 505, 505, 505, 505, 505,
1032 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
1033 505, 505, 505, 505, 505, 505, 505, -458, -57, 22,
1034 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
1035 -35, -458, 1, 4, 8, 9, 10, 14, 16, 29,
1036 49, 50, 51, 54, 55, 57, 58, 60, 68, 69,
1037 70, 73, 74, 75, 76, 77, 78, 79, 89, 90,
1038 91, 93, -458, -458, -458, 94, 94, 142, 82, 5,
1039 96, 6, -57, 185, -37, -34, -58, -43, -38, -38,
1040 98, 119, 129, 130, 131, 132, 133, -458, 134, 100,
1041 -458, -458, -458, 135, 136, 137, 138, 190, 191, 192,
1042 193, 194, 195, 204, 205, 343, 344, 345, 346, -458,
1043 378, 379, 380, 381, 382, 383, 388, 384, -57, -34,
1044 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
1045 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
1046 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
1047 -458, -458, 94, -458, -458, -458, 385, -458, 387, -458,
1048 -37, -43, -458, -458, -458, -458, -154, -57, -458, -458,
1049 -458, -458, -458, -458, -458, -57, -34, -34, -34, -34,
1050 -34, -34, -34, -34, -458, 390, -34, -34, -34, -34,
1051 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
1052 -34, -34, -34, -34, -34, -34, -34, -34, -458, 393,
1053 -458, 397, -38, -38, -38, -38, -38, -38, -38, -38,
1054 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
1055 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
1056 -38, -38, -38, -458, 394, 395, -43, -458, -57, -30,
1057 -458, -86, -458, -38, -38, -38, -38, -38, -38, -38,
1058 -38, -458, -38, -38, -38, -38, -38, -38, -38, -38,
1059 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
1060 -38, -38, -38, -38, -458, -458, 448, 449, -458, -57,
1061 -458, -458, -57, 396, -458, 453, 454, -458, -84, -63,
1062 452, 455, 396, -458, 456, -458, 457, 459, -59, -458,
1063 -458, -458
1064 };
1065
1066 /* YYPGOTO[NTERM-NUM]. */
1067 static const yytype_int16 yypgoto[] =
1068 {
1069 -458, -458, -458, -458, -458, 17, -92, -458, -293, -458,
1070 -309, -458, 491, -458, -56, 306, -231, -457, -399, 146,
1071 -132, 21, -458, -206, -458, -458
1072 };
1073
1074 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1075 positive, shift that token. If negative, reduce the rule which
1076 number is the opposite. If YYTABLE_NINF, syntax error. */
1077 #define YYTABLE_NINF -1
1078 static const yytype_uint16 yytable[] =
1079 {
1080 194, 331, 488, 399, 197, 198, 199, 200, 414, 489,
1081 201, 16, 390, 391, 490, 270, 272, 273, 274, 275,
1082 276, 277, 278, 279, 280, 281, 282, 283, 284, 285,
1083 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
1084 296, 297, 298, 299, 300, 301, 403, 404, 159, 451,
1085 312, 258, 314, 162, 163, 164, 165, 166, 167, 168,
1086 169, 170, 171, 172, 160, 173, 174, 175, 176, 177,
1087 178, 179, 180, 181, 403, 404, 539, 533, 408, 542,
1088 196, 161, 534, 401, 543, 548, 259, 529, 202, 329,
1089 306, 316, 487, 409, 410, 411, 412, 413, 491, 483,
1090 544, 392, 395, 405, 544, 545, 492, 182, 356, 551,
1091 320, 321, 322, 323, 324, 325, 326, 327, 328, 257,
1092 309, 313, 356, 260, 310, 311, 315, 183, 358, 359,
1093 316, 531, 184, 188, 189, 190, 191, 192, 193, 318,
1094 319, 332, 333, 334, 335, 336, 337, 338, 339, 340,
1095 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,
1096 351, 352, 353, 354, 355, 360, 396, 398, 361, 486,
1097 393, 302, 362, 363, 364, 303, 394, 528, 365, 530,
1098 366, 400, 162, 163, 164, 165, 166, 167, 168, 169,
1099 170, 171, 172, 367, 173, 174, 175, 176, 177, 178,
1100 179, 180, 181, 261, 262, 263, 264, 265, 266, 267,
1101 268, 269, 302, 368, 369, 370, 303, 304, 371, 372,
1102 537, 373, 374, 538, 375, 188, 189, 190, 191, 192,
1103 193, 302, 376, 377, 378, 303, 182, 379, 380, 381,
1104 382, 383, 384, 385, 261, 262, 263, 264, 265, 266,
1105 267, 268, 269, 386, 387, 388, 183, 389, 397, 329,
1106 424, 184, 416, 261, 262, 263, 264, 265, 266, 267,
1107 268, 269, 162, 163, 164, 165, 166, 167, 168, 169,
1108 170, 171, 172, 417, 173, 174, 175, 176, 177, 178,
1109 179, 180, 181, 418, 419, 420, 421, 422, 423, 426,
1110 427, 428, 429, 452, 453, 454, 455, 456, 457, 458,
1111 459, 460, 461, 462, 463, 464, 465, 466, 467, 468,
1112 469, 470, 471, 472, 473, 474, 475, 476, 477, 478,
1113 479, 480, 481, 482, 211, 212, 213, 214, 215, 216,
1114 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
1115 227, 228, 229, 230, 430, 431, 432, 433, 434, 435,
1116 493, 494, 495, 496, 497, 498, 499, 500, 436, 437,
1117 502, 503, 504, 505, 506, 507, 508, 509, 510, 511,
1118 512, 513, 514, 515, 516, 517, 518, 519, 520, 521,
1119 522, 523, 18, 19, 20, 21, 22, 23, 24, 25,
1120 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1121 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
1122 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1123 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1124 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
1125 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1126 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1127 96, 97, 98, 99, 100, 101, 138, 139, 140, 141,
1128 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
1129 152, 153, 154, 155, 1, 2, 3, 4, 5, 6,
1130 7, 8, 9, 10, 11, 12, 13, 438, 439, 440,
1131 441, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1132 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
1133 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
1134 137, 156, 442, 443, 444, 445, 446, 447, 448, 484,
1135 501, 485, 102, 524, 450, 526, 527, 405, 103, 203,
1136 204, 205, 206, 207, 208, 209, 210, 525, 233, 234,
1137 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
1138 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
1139 255, 256, 211, 212, 213, 214, 215, 216, 217, 218,
1140 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
1141 229, 230, 535, 536, 540, 541, 546, 531, 549, 547,
1142 550, 402, 0, 0, 0, 0, 261, 262, 263, 264,
1143 265, 266, 267, 268, 269, 532, 0, 0, 0, 0,
1144 0, 0, 0, 0, 0, 0, 0, 0, 307, 308,
1145 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1146 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1147 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1148 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1149 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1150 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
1151 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
1152 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
1153 98, 99, 100, 101
1154 };
1155
1156 #define yypact_value_is_default(yystate) \
1157 ((yystate) == (-458))
1158
1159 #define yytable_value_is_error(yytable_value) \
1160 YYID (0)
1161
1162 static const yytype_int16 yycheck[] =
1163 {
1164 56, 232, 401, 312, 60, 61, 62, 63, 317, 163,
1165 66, 0, 305, 306, 168, 107, 108, 109, 110, 111,
1166 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
1167 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
1168 132, 133, 134, 135, 136, 137, 104, 105, 90, 358,
1169 182, 106, 184, 87, 88, 89, 90, 91, 92, 93,
1170 94, 95, 96, 97, 92, 99, 100, 101, 102, 103,
1171 104, 105, 106, 107, 104, 105, 533, 163, 121, 163,
1172 59, 91, 168, 314, 168, 542, 141, 486, 67, 165,
1173 88, 167, 401, 136, 137, 138, 139, 140, 407, 392,
1174 163, 307, 308, 161, 163, 168, 415, 141, 165, 168,
1175 202, 203, 204, 205, 206, 207, 208, 209, 210, 102,
1176 164, 166, 165, 106, 164, 164, 164, 161, 106, 164,
1177 167, 161, 166, 130, 131, 132, 133, 134, 135, 195,
1178 196, 233, 234, 235, 236, 237, 238, 239, 240, 241,
1179 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
1180 252, 253, 254, 255, 256, 164, 161, 161, 164, 400,
1181 88, 89, 164, 164, 164, 93, 94, 486, 164, 488,
1182 164, 313, 87, 88, 89, 90, 91, 92, 93, 94,
1183 95, 96, 97, 164, 99, 100, 101, 102, 103, 104,
1184 105, 106, 107, 121, 122, 123, 124, 125, 126, 127,
1185 128, 129, 89, 164, 164, 164, 93, 94, 164, 164,
1186 529, 164, 164, 532, 164, 130, 131, 132, 133, 134,
1187 135, 89, 164, 164, 164, 93, 141, 164, 164, 164,
1188 164, 164, 164, 164, 121, 122, 123, 124, 125, 126,
1189 127, 128, 129, 164, 164, 164, 161, 164, 162, 165,
1190 160, 166, 164, 121, 122, 123, 124, 125, 126, 127,
1191 128, 129, 87, 88, 89, 90, 91, 92, 93, 94,
1192 95, 96, 97, 164, 99, 100, 101, 102, 103, 104,
1193 105, 106, 107, 164, 164, 164, 164, 164, 164, 164,
1194 164, 164, 164, 359, 360, 361, 362, 363, 364, 365,
1195 366, 367, 368, 369, 370, 371, 372, 373, 374, 375,
1196 376, 377, 378, 379, 380, 381, 382, 383, 384, 385,
1197 386, 387, 388, 389, 87, 88, 89, 90, 91, 92,
1198 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1199 103, 104, 105, 106, 164, 164, 164, 164, 164, 164,
1200 416, 417, 418, 419, 420, 421, 422, 423, 164, 164,
1201 426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
1202 436, 437, 438, 439, 440, 441, 442, 443, 444, 445,
1203 446, 447, 3, 4, 5, 6, 7, 8, 9, 10,
1204 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1205 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1206 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1207 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1208 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
1209 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1210 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1211 81, 82, 83, 84, 85, 86, 142, 143, 144, 145,
1212 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
1213 156, 157, 158, 159, 108, 109, 110, 111, 112, 113,
1214 114, 115, 116, 117, 118, 119, 120, 164, 164, 164,
1215 164, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1216 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1217 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1218 49, 50, 164, 164, 164, 164, 164, 164, 160, 164,
1219 160, 164, 163, 160, 170, 161, 161, 161, 169, 68,
1220 69, 70, 71, 72, 73, 74, 75, 170, 77, 78,
1221 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1222 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1223 99, 100, 87, 88, 89, 90, 91, 92, 93, 94,
1224 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1225 105, 106, 164, 164, 161, 161, 164, 161, 161, 164,
1226 161, 315, -1, -1, -1, -1, 121, 122, 123, 124,
1227 125, 126, 127, 128, 129, 489, -1, -1, -1, -1,
1228 -1, -1, -1, -1, -1, -1, -1, -1, 157, 158,
1229 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1230 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1231 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1232 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
1233 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1234 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
1235 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1236 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1237 83, 84, 85, 86
1238 };
1239
1240 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1241 symbol of state STATE-NUM. */
1242 static const yytype_uint8 yystos[] =
1243 {
1244 0, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1245 117, 118, 119, 120, 172, 173, 0, 174, 3, 4,
1246 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1247 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1248 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1249 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1250 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1251 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1252 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1253 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1254 85, 86, 163, 169, 175, 176, 196, 183, 183, 183,
1255 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1256 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1257 183, 183, 183, 183, 183, 183, 183, 183, 142, 143,
1258 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
1259 154, 155, 156, 157, 158, 159, 183, 193, 195, 90,
1260 92, 91, 87, 88, 89, 90, 91, 92, 93, 94,
1261 95, 96, 97, 99, 100, 101, 102, 103, 104, 105,
1262 106, 107, 141, 161, 166, 185, 186, 191, 130, 131,
1263 132, 133, 134, 135, 185, 192, 192, 185, 185, 185,
1264 185, 185, 192, 183, 183, 183, 183, 183, 183, 183,
1265 183, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1266 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
1267 106, 177, 178, 183, 183, 183, 183, 183, 183, 183,
1268 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1269 183, 183, 183, 183, 183, 183, 183, 176, 106, 141,
1270 176, 121, 122, 123, 124, 125, 126, 127, 128, 129,
1271 177, 184, 177, 177, 177, 177, 177, 177, 177, 177,
1272 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1273 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1274 177, 177, 89, 93, 94, 194, 88, 183, 183, 164,
1275 164, 164, 191, 166, 191, 164, 167, 187, 185, 185,
1276 177, 177, 177, 177, 177, 177, 177, 177, 177, 165,
1277 179, 187, 177, 177, 177, 177, 177, 177, 177, 177,
1278 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1279 177, 177, 177, 177, 177, 177, 165, 181, 106, 164,
1280 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1281 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1282 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1283 179, 179, 194, 88, 94, 194, 161, 162, 161, 181,
1284 191, 187, 186, 104, 105, 161, 188, 190, 121, 136,
1285 137, 138, 139, 140, 181, 189, 164, 164, 164, 164,
1286 164, 164, 164, 164, 160, 180, 164, 164, 164, 164,
1287 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1288 164, 164, 164, 164, 164, 164, 164, 164, 160, 182,
1289 170, 181, 185, 185, 185, 185, 185, 185, 185, 185,
1290 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1291 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1292 185, 185, 185, 179, 164, 164, 187, 181, 189, 163,
1293 168, 181, 181, 185, 185, 185, 185, 185, 185, 185,
1294 185, 160, 185, 185, 185, 185, 185, 185, 185, 185,
1295 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1296 185, 185, 185, 185, 160, 170, 161, 161, 181, 189,
1297 181, 161, 190, 163, 168, 164, 164, 181, 181, 188,
1298 161, 161, 163, 168, 163, 168, 164, 164, 188, 161,
1299 161, 168
1300 };
1301
1302 #define yyerrok (yyerrstatus = 0)
1303 #define yyclearin (yychar = YYEMPTY)
1304 #define YYEMPTY (-2)
1305 #define YYEOF 0
1306
1307 #define YYACCEPT goto yyacceptlab
1308 #define YYABORT goto yyabortlab
1309 #define YYERROR goto yyerrorlab
1310
1311
1312 /* Like YYERROR except do call yyerror. This remains here temporarily
1313 to ease the transition to the new meaning of YYERROR, for GCC.
1314 Once GCC version 2 has supplanted version 1, this can go. However,
1315 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1316 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1317 discussed. */
1318
1319 #define YYFAIL goto yyerrlab
1320 #if defined YYFAIL
1321 /* This is here to suppress warnings from the GCC cpp's
1322 -Wunused-macros. Normally we don't worry about that warning, but
1323 some users do, and we want to make it easy for users to remove
1324 YYFAIL uses, which will produce warnings from Bison 2.5. */
1325 #endif
1326
1327 #define YYRECOVERING() (!!yyerrstatus)
1328
1329 #define YYBACKUP(Token, Value) \
1330 do \
1331 if (yychar == YYEMPTY && yylen == 1) \
1332 { \
1333 yychar = (Token); \
1334 yylval = (Value); \
1335 YYPOPSTACK (1); \
1336 goto yybackup; \
1337 } \
1338 else \
1339 { \
1340 yyerror (YY_("syntax error: cannot back up")); \
1341 YYERROR; \
1342 } \
1343 while (YYID (0))
1344
1345
1346 #define YYTERROR 1
1347 #define YYERRCODE 256
1348
1349
1350 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1351 If N is 0, then set CURRENT to the empty location which ends
1352 the previous symbol: RHS[0] (always defined). */
1353
1354 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1355 #ifndef YYLLOC_DEFAULT
1356 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1357 do \
1358 if (YYID (N)) \
1359 { \
1360 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1361 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1362 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1363 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1364 } \
1365 else \
1366 { \
1367 (Current).first_line = (Current).last_line = \
1368 YYRHSLOC (Rhs, 0).last_line; \
1369 (Current).first_column = (Current).last_column = \
1370 YYRHSLOC (Rhs, 0).last_column; \
1371 } \
1372 while (YYID (0))
1373 #endif
1374
1375
1376 /* This macro is provided for backward compatibility. */
1377
1378 #ifndef YY_LOCATION_PRINT
1379 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1380 #endif
1381
1382
1383 /* YYLEX -- calling `yylex' with the right arguments. */
1384
1385 #ifdef YYLEX_PARAM
1386 # define YYLEX yylex (YYLEX_PARAM)
1387 #else
1388 # define YYLEX yylex ()
1389 #endif
1390
1391 /* Enable debugging if requested. */
1392 #if YYDEBUG
1393
1394 # ifndef YYFPRINTF
1395 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1396 # define YYFPRINTF fprintf
1397 # endif
1398
1399 # define YYDPRINTF(Args) \
1400 do { \
1401 if (yydebug) \
1402 YYFPRINTF Args; \
1403 } while (YYID (0))
1404
1405 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1406 do { \
1407 if (yydebug) \
1408 { \
1409 YYFPRINTF (stderr, "%s ", Title); \
1410 yy_symbol_print (stderr, \
1411 Type, Value); \
1412 YYFPRINTF (stderr, "\n"); \
1413 } \
1414 } while (YYID (0))
1415
1416
1417 /*--------------------------------.
1418 | Print this symbol on YYOUTPUT. |
1419 `--------------------------------*/
1420
1421 /*ARGSUSED*/
1422 #if (defined __STDC__ || defined __C99__FUNC__ \
1423 || defined __cplusplus || defined _MSC_VER)
1424 static void
1425 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1426 #else
1427 static void
1428 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1429 FILE *yyoutput;
1430 int yytype;
1431 YYSTYPE const * const yyvaluep;
1432 #endif
1433 {
1434 if (!yyvaluep)
1435 return;
1436 # ifdef YYPRINT
1437 if (yytype < YYNTOKENS)
1438 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1439 # else
1440 YYUSE (yyoutput);
1441 # endif
1442 switch (yytype)
1443 {
1444 default:
1445 break;
1446 }
1447 }
1448
1449
1450 /*--------------------------------.
1451 | Print this symbol on YYOUTPUT. |
1452 `--------------------------------*/
1453
1454 #if (defined __STDC__ || defined __C99__FUNC__ \
1455 || defined __cplusplus || defined _MSC_VER)
1456 static void
1457 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1458 #else
1459 static void
1460 yy_symbol_print (yyoutput, yytype, yyvaluep)
1461 FILE *yyoutput;
1462 int yytype;
1463 YYSTYPE const * const yyvaluep;
1464 #endif
1465 {
1466 if (yytype < YYNTOKENS)
1467 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1468 else
1469 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1470
1471 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1472 YYFPRINTF (yyoutput, ")");
1473 }
1474
1475 /*------------------------------------------------------------------.
1476 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1477 | TOP (included). |
1478 `------------------------------------------------------------------*/
1479
1480 #if (defined __STDC__ || defined __C99__FUNC__ \
1481 || defined __cplusplus || defined _MSC_VER)
1482 static void
1483 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1484 #else
1485 static void
1486 yy_stack_print (yybottom, yytop)
1487 yytype_int16 *yybottom;
1488 yytype_int16 *yytop;
1489 #endif
1490 {
1491 YYFPRINTF (stderr, "Stack now");
1492 for (; yybottom <= yytop; yybottom++)
1493 {
1494 int yybot = *yybottom;
1495 YYFPRINTF (stderr, " %d", yybot);
1496 }
1497 YYFPRINTF (stderr, "\n");
1498 }
1499
1500 # define YY_STACK_PRINT(Bottom, Top) \
1501 do { \
1502 if (yydebug) \
1503 yy_stack_print ((Bottom), (Top)); \
1504 } while (YYID (0))
1505
1506
1507 /*------------------------------------------------.
1508 | Report that the YYRULE is going to be reduced. |
1509 `------------------------------------------------*/
1510
1511 #if (defined __STDC__ || defined __C99__FUNC__ \
1512 || defined __cplusplus || defined _MSC_VER)
1513 static void
1514 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1515 #else
1516 static void
1517 yy_reduce_print (yyvsp, yyrule)
1518 YYSTYPE *yyvsp;
1519 int yyrule;
1520 #endif
1521 {
1522 int yynrhs = yyr2[yyrule];
1523 int yyi;
1524 unsigned long int yylno = yyrline[yyrule];
1525 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1526 yyrule - 1, yylno);
1527 /* The symbols being reduced. */
1528 for (yyi = 0; yyi < yynrhs; yyi++)
1529 {
1530 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1531 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1532 &(yyvsp[(yyi + 1) - (yynrhs)])
1533 );
1534 YYFPRINTF (stderr, "\n");
1535 }
1536 }
1537
1538 # define YY_REDUCE_PRINT(Rule) \
1539 do { \
1540 if (yydebug) \
1541 yy_reduce_print (yyvsp, Rule); \
1542 } while (YYID (0))
1543
1544 /* Nonzero means print parse trace. It is left uninitialized so that
1545 multiple parsers can coexist. */
1546 int yydebug;
1547 #else /* !YYDEBUG */
1548 # define YYDPRINTF(Args)
1549 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1550 # define YY_STACK_PRINT(Bottom, Top)
1551 # define YY_REDUCE_PRINT(Rule)
1552 #endif /* !YYDEBUG */
1553
1554
1555 /* YYINITDEPTH -- initial size of the parser's stacks. */
1556 #ifndef YYINITDEPTH
1557 # define YYINITDEPTH 200
1558 #endif
1559
1560 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1561 if the built-in stack extension method is used).
1562
1563 Do not make this value too large; the results are undefined if
1564 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1565 evaluated with infinite-precision integer arithmetic. */
1566
1567 #ifndef YYMAXDEPTH
1568 # define YYMAXDEPTH 10000
1569 #endif
1570
1571
1572 #if YYERROR_VERBOSE
1573
1574 # ifndef yystrlen
1575 # if defined __GLIBC__ && defined _STRING_H
1576 # define yystrlen strlen
1577 # else
1578 /* Return the length of YYSTR. */
1579 #if (defined __STDC__ || defined __C99__FUNC__ \
1580 || defined __cplusplus || defined _MSC_VER)
1581 static YYSIZE_T
1582 yystrlen (const char *yystr)
1583 #else
1584 static YYSIZE_T
1585 yystrlen (yystr)
1586 const char *yystr;
1587 #endif
1588 {
1589 YYSIZE_T yylen;
1590 for (yylen = 0; yystr[yylen]; yylen++)
1591 continue;
1592 return yylen;
1593 }
1594 # endif
1595 # endif
1596
1597 # ifndef yystpcpy
1598 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1599 # define yystpcpy stpcpy
1600 # else
1601 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1602 YYDEST. */
1603 #if (defined __STDC__ || defined __C99__FUNC__ \
1604 || defined __cplusplus || defined _MSC_VER)
1605 static char *
1606 yystpcpy (char *yydest, const char *yysrc)
1607 #else
1608 static char *
1609 yystpcpy (yydest, yysrc)
1610 char *yydest;
1611 const char *yysrc;
1612 #endif
1613 {
1614 char *yyd = yydest;
1615 const char *yys = yysrc;
1616
1617 while ((*yyd++ = *yys++) != '\0')
1618 continue;
1619
1620 return yyd - 1;
1621 }
1622 # endif
1623 # endif
1624
1625 # ifndef yytnamerr
1626 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1627 quotes and backslashes, so that it's suitable for yyerror. The
1628 heuristic is that double-quoting is unnecessary unless the string
1629 contains an apostrophe, a comma, or backslash (other than
1630 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1631 null, do not copy; instead, return the length of what the result
1632 would have been. */
1633 static YYSIZE_T
1634 yytnamerr (char *yyres, const char *yystr)
1635 {
1636 if (*yystr == '"')
1637 {
1638 YYSIZE_T yyn = 0;
1639 char const *yyp = yystr;
1640
1641 for (;;)
1642 switch (*++yyp)
1643 {
1644 case '\'':
1645 case ',':
1646 goto do_not_strip_quotes;
1647
1648 case '\\':
1649 if (*++yyp != '\\')
1650 goto do_not_strip_quotes;
1651 /* Fall through. */
1652 default:
1653 if (yyres)
1654 yyres[yyn] = *yyp;
1655 yyn++;
1656 break;
1657
1658 case '"':
1659 if (yyres)
1660 yyres[yyn] = '\0';
1661 return yyn;
1662 }
1663 do_not_strip_quotes: ;
1664 }
1665
1666 if (! yyres)
1667 return yystrlen (yystr);
1668
1669 return yystpcpy (yyres, yystr) - yyres;
1670 }
1671 # endif
1672
1673 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1674 about the unexpected token YYTOKEN for the state stack whose top is
1675 YYSSP.
1676
1677 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1678 not large enough to hold the message. In that case, also set
1679 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1680 required number of bytes is too large to store. */
1681 static int
1682 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1683 yytype_int16 *yyssp, int yytoken)
1684 {
1685 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1686 YYSIZE_T yysize = yysize0;
1687 YYSIZE_T yysize1;
1688 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1689 /* Internationalized format string. */
1690 const char *yyformat = 0;
1691 /* Arguments of yyformat. */
1692 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1693 /* Number of reported tokens (one for the "unexpected", one per
1694 "expected"). */
1695 int yycount = 0;
1696
1697 /* There are many possibilities here to consider:
1698 - Assume YYFAIL is not used. It's too flawed to consider. See
1699 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1700 for details. YYERROR is fine as it does not invoke this
1701 function.
1702 - If this state is a consistent state with a default action, then
1703 the only way this function was invoked is if the default action
1704 is an error action. In that case, don't check for expected
1705 tokens because there are none.
1706 - The only way there can be no lookahead present (in yychar) is if
1707 this state is a consistent state with a default action. Thus,
1708 detecting the absence of a lookahead is sufficient to determine
1709 that there is no unexpected or expected token to report. In that
1710 case, just report a simple "syntax error".
1711 - Don't assume there isn't a lookahead just because this state is a
1712 consistent state with a default action. There might have been a
1713 previous inconsistent state, consistent state with a non-default
1714 action, or user semantic action that manipulated yychar.
1715 - Of course, the expected token list depends on states to have
1716 correct lookahead information, and it depends on the parser not
1717 to perform extra reductions after fetching a lookahead from the
1718 scanner and before detecting a syntax error. Thus, state merging
1719 (from LALR or IELR) and default reductions corrupt the expected
1720 token list. However, the list is correct for canonical LR with
1721 one exception: it will still contain any token that will not be
1722 accepted due to an error action in a later state.
1723 */
1724 if (yytoken != YYEMPTY)
1725 {
1726 int yyn = yypact[*yyssp];
1727 yyarg[yycount++] = yytname[yytoken];
1728 if (!yypact_value_is_default (yyn))
1729 {
1730 /* Start YYX at -YYN if negative to avoid negative indexes in
1731 YYCHECK. In other words, skip the first -YYN actions for
1732 this state because they are default actions. */
1733 int yyxbegin = yyn < 0 ? -yyn : 0;
1734 /* Stay within bounds of both yycheck and yytname. */
1735 int yychecklim = YYLAST - yyn + 1;
1736 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1737 int yyx;
1738
1739 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1740 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1741 && !yytable_value_is_error (yytable[yyx + yyn]))
1742 {
1743 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1744 {
1745 yycount = 1;
1746 yysize = yysize0;
1747 break;
1748 }
1749 yyarg[yycount++] = yytname[yyx];
1750 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1751 if (! (yysize <= yysize1
1752 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1753 return 2;
1754 yysize = yysize1;
1755 }
1756 }
1757 }
1758
1759 switch (yycount)
1760 {
1761 # define YYCASE_(N, S) \
1762 case N: \
1763 yyformat = S; \
1764 break
1765 YYCASE_(0, YY_("syntax error"));
1766 YYCASE_(1, YY_("syntax error, unexpected %s"));
1767 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1768 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1769 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1770 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1771 # undef YYCASE_
1772 }
1773
1774 yysize1 = yysize + yystrlen (yyformat);
1775 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1776 return 2;
1777 yysize = yysize1;
1778
1779 if (*yymsg_alloc < yysize)
1780 {
1781 *yymsg_alloc = 2 * yysize;
1782 if (! (yysize <= *yymsg_alloc
1783 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1784 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1785 return 1;
1786 }
1787
1788 /* Avoid sprintf, as that infringes on the user's name space.
1789 Don't have undefined behavior even if the translation
1790 produced a string with the wrong number of "%s"s. */
1791 {
1792 char *yyp = *yymsg;
1793 int yyi = 0;
1794 while ((*yyp = *yyformat) != '\0')
1795 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1796 {
1797 yyp += yytnamerr (yyp, yyarg[yyi++]);
1798 yyformat += 2;
1799 }
1800 else
1801 {
1802 yyp++;
1803 yyformat++;
1804 }
1805 }
1806 return 0;
1807 }
1808 #endif /* YYERROR_VERBOSE */
1809
1810 /*-----------------------------------------------.
1811 | Release the memory associated to this symbol. |
1812 `-----------------------------------------------*/
1813
1814 /*ARGSUSED*/
1815 #if (defined __STDC__ || defined __C99__FUNC__ \
1816 || defined __cplusplus || defined _MSC_VER)
1817 static void
1818 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1819 #else
1820 static void
1821 yydestruct (yymsg, yytype, yyvaluep)
1822 const char *yymsg;
1823 int yytype;
1824 YYSTYPE *yyvaluep;
1825 #endif
1826 {
1827 YYUSE (yyvaluep);
1828
1829 if (!yymsg)
1830 yymsg = "Deleting";
1831 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1832
1833 switch (yytype)
1834 {
1835
1836 default:
1837 break;
1838 }
1839 }
1840
1841
1842 /* Prevent warnings from -Wmissing-prototypes. */
1843 #ifdef YYPARSE_PARAM
1844 #if defined __STDC__ || defined __cplusplus
1845 int yyparse (void *YYPARSE_PARAM);
1846 #else
1847 int yyparse ();
1848 #endif
1849 #else /* ! YYPARSE_PARAM */
1850 #if defined __STDC__ || defined __cplusplus
1851 int yyparse (void);
1852 #else
1853 int yyparse ();
1854 #endif
1855 #endif /* ! YYPARSE_PARAM */
1856
1857
1858 /* The lookahead symbol. */
1859 int yychar;
1860
1861 /* The semantic value of the lookahead symbol. */
1862 YYSTYPE yylval;
1863
1864 /* Number of syntax errors so far. */
1865 int yynerrs;
1866
1867
1868 /*----------.
1869 | yyparse. |
1870 `----------*/
1871
1872 #ifdef YYPARSE_PARAM
1873 #if (defined __STDC__ || defined __C99__FUNC__ \
1874 || defined __cplusplus || defined _MSC_VER)
1875 int
1876 yyparse (void *YYPARSE_PARAM)
1877 #else
1878 int
1879 yyparse (YYPARSE_PARAM)
1880 void *YYPARSE_PARAM;
1881 #endif
1882 #else /* ! YYPARSE_PARAM */
1883 #if (defined __STDC__ || defined __C99__FUNC__ \
1884 || defined __cplusplus || defined _MSC_VER)
1885 int
1886 yyparse (void)
1887 #else
1888 int
1889 yyparse ()
1890
1891 #endif
1892 #endif
1893 {
1894 int yystate;
1895 /* Number of tokens to shift before error messages enabled. */
1896 int yyerrstatus;
1897
1898 /* The stacks and their tools:
1899 `yyss': related to states.
1900 `yyvs': related to semantic values.
1901
1902 Refer to the stacks thru separate pointers, to allow yyoverflow
1903 to reallocate them elsewhere. */
1904
1905 /* The state stack. */
1906 yytype_int16 yyssa[YYINITDEPTH];
1907 yytype_int16 *yyss;
1908 yytype_int16 *yyssp;
1909
1910 /* The semantic value stack. */
1911 YYSTYPE yyvsa[YYINITDEPTH];
1912 YYSTYPE *yyvs;
1913 YYSTYPE *yyvsp;
1914
1915 YYSIZE_T yystacksize;
1916
1917 int yyn;
1918 int yyresult;
1919 /* Lookahead token as an internal (translated) token number. */
1920 int yytoken;
1921 /* The variables used to return semantic value and location from the
1922 action routines. */
1923 YYSTYPE yyval;
1924
1925 #if YYERROR_VERBOSE
1926 /* Buffer for error messages, and its allocated size. */
1927 char yymsgbuf[128];
1928 char *yymsg = yymsgbuf;
1929 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1930 #endif
1931
1932 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1933
1934 /* The number of symbols on the RHS of the reduced rule.
1935 Keep to zero when no symbol should be popped. */
1936 int yylen = 0;
1937
1938 yytoken = 0;
1939 yyss = yyssa;
1940 yyvs = yyvsa;
1941 yystacksize = YYINITDEPTH;
1942
1943 YYDPRINTF ((stderr, "Starting parse\n"));
1944
1945 yystate = 0;
1946 yyerrstatus = 0;
1947 yynerrs = 0;
1948 yychar = YYEMPTY; /* Cause a token to be read. */
1949
1950 /* Initialize stack pointers.
1951 Waste one element of value and location stack
1952 so that they stay on the same level as the state stack.
1953 The wasted elements are never initialized. */
1954 yyssp = yyss;
1955 yyvsp = yyvs;
1956
1957 goto yysetstate;
1958
1959 /*------------------------------------------------------------.
1960 | yynewstate -- Push a new state, which is found in yystate. |
1961 `------------------------------------------------------------*/
1962 yynewstate:
1963 /* In all cases, when you get here, the value and location stacks
1964 have just been pushed. So pushing a state here evens the stacks. */
1965 yyssp++;
1966
1967 yysetstate:
1968 *yyssp = yystate;
1969
1970 if (yyss + yystacksize - 1 <= yyssp)
1971 {
1972 /* Get the current used size of the three stacks, in elements. */
1973 YYSIZE_T yysize = yyssp - yyss + 1;
1974
1975 #ifdef yyoverflow
1976 {
1977 /* Give user a chance to reallocate the stack. Use copies of
1978 these so that the &'s don't force the real ones into
1979 memory. */
1980 YYSTYPE *yyvs1 = yyvs;
1981 yytype_int16 *yyss1 = yyss;
1982
1983 /* Each stack pointer address is followed by the size of the
1984 data in use in that stack, in bytes. This used to be a
1985 conditional around just the two extra args, but that might
1986 be undefined if yyoverflow is a macro. */
1987 yyoverflow (YY_("memory exhausted"),
1988 &yyss1, yysize * sizeof (*yyssp),
1989 &yyvs1, yysize * sizeof (*yyvsp),
1990 &yystacksize);
1991
1992 yyss = yyss1;
1993 yyvs = yyvs1;
1994 }
1995 #else /* no yyoverflow */
1996 # ifndef YYSTACK_RELOCATE
1997 goto yyexhaustedlab;
1998 # else
1999 /* Extend the stack our own way. */
2000 if (YYMAXDEPTH <= yystacksize)
2001 goto yyexhaustedlab;
2002 yystacksize *= 2;
2003 if (YYMAXDEPTH < yystacksize)
2004 yystacksize = YYMAXDEPTH;
2005
2006 {
2007 yytype_int16 *yyss1 = yyss;
2008 union yyalloc *yyptr =
2009 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2010 if (! yyptr)
2011 goto yyexhaustedlab;
2012 YYSTACK_RELOCATE (yyss_alloc, yyss);
2013 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2014 # undef YYSTACK_RELOCATE
2015 if (yyss1 != yyssa)
2016 YYSTACK_FREE (yyss1);
2017 }
2018 # endif
2019 #endif /* no yyoverflow */
2020
2021 yyssp = yyss + yysize - 1;
2022 yyvsp = yyvs + yysize - 1;
2023
2024 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2025 (unsigned long int) yystacksize));
2026
2027 if (yyss + yystacksize - 1 <= yyssp)
2028 YYABORT;
2029 }
2030
2031 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2032
2033 if (yystate == YYFINAL)
2034 YYACCEPT;
2035
2036 goto yybackup;
2037
2038 /*-----------.
2039 | yybackup. |
2040 `-----------*/
2041 yybackup:
2042
2043 /* Do appropriate processing given the current state. Read a
2044 lookahead token if we need one and don't already have one. */
2045
2046 /* First try to decide what to do without reference to lookahead token. */
2047 yyn = yypact[yystate];
2048 if (yypact_value_is_default (yyn))
2049 goto yydefault;
2050
2051 /* Not known => get a lookahead token if don't already have one. */
2052
2053 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2054 if (yychar == YYEMPTY)
2055 {
2056 YYDPRINTF ((stderr, "Reading a token: "));
2057 yychar = YYLEX;
2058 }
2059
2060 if (yychar <= YYEOF)
2061 {
2062 yychar = yytoken = YYEOF;
2063 YYDPRINTF ((stderr, "Now at end of input.\n"));
2064 }
2065 else
2066 {
2067 yytoken = YYTRANSLATE (yychar);
2068 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2069 }
2070
2071 /* If the proper action on seeing token YYTOKEN is to reduce or to
2072 detect an error, take that action. */
2073 yyn += yytoken;
2074 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2075 goto yydefault;
2076 yyn = yytable[yyn];
2077 if (yyn <= 0)
2078 {
2079 if (yytable_value_is_error (yyn))
2080 goto yyerrlab;
2081 yyn = -yyn;
2082 goto yyreduce;
2083 }
2084
2085 /* Count tokens shifted since error; after three, turn off error
2086 status. */
2087 if (yyerrstatus)
2088 yyerrstatus--;
2089
2090 /* Shift the lookahead token. */
2091 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2092
2093 /* Discard the shifted token. */
2094 yychar = YYEMPTY;
2095
2096 yystate = yyn;
2097 *++yyvsp = yylval;
2098
2099 goto yynewstate;
2100
2101
2102 /*-----------------------------------------------------------.
2103 | yydefault -- do the default action for the current state. |
2104 `-----------------------------------------------------------*/
2105 yydefault:
2106 yyn = yydefact[yystate];
2107 if (yyn == 0)
2108 goto yyerrlab;
2109 goto yyreduce;
2110
2111
2112 /*-----------------------------.
2113 | yyreduce -- Do a reduction. |
2114 `-----------------------------*/
2115 yyreduce:
2116 /* yyn is the number of a rule to reduce with. */
2117 yylen = yyr2[yyn];
2118
2119 /* If YYLEN is nonzero, implement the default value of the action:
2120 `$$ = $1'.
2121
2122 Otherwise, the following line sets YYVAL to garbage.
2123 This behavior is undocumented and Bison
2124 users should not rely upon it. Assigning to YYVAL
2125 unconditionally makes the parser a bit smaller, and it avoids a
2126 GCC warning that YYVAL may be used uninitialized. */
2127 yyval = yyvsp[1-yylen];
2128
2129
2130 YY_REDUCE_PRINT (yyn);
2131 switch (yyn)
2132 {
2133 case 2:
2134
2135 /* Line 1806 of yacc.c */
2136 #line 312 "asmshader.y"
2137 {
2138 asm_ctx.funcs->end(&asm_ctx);
2139 }
2140 break;
2141
2142 case 3:
2143
2144 /* Line 1806 of yacc.c */
2145 #line 317 "asmshader.y"
2146 {
2147 TRACE("Vertex shader 1.0\n");
2148 create_vs10_parser(&asm_ctx);
2149 }
2150 break;
2151
2152 case 4:
2153
2154 /* Line 1806 of yacc.c */
2155 #line 322 "asmshader.y"
2156 {
2157 TRACE("Vertex shader 1.1\n");
2158 create_vs11_parser(&asm_ctx);
2159 }
2160 break;
2161
2162 case 5:
2163
2164 /* Line 1806 of yacc.c */
2165 #line 327 "asmshader.y"
2166 {
2167 TRACE("Vertex shader 2.0\n");
2168 create_vs20_parser(&asm_ctx);
2169 }
2170 break;
2171
2172 case 6:
2173
2174 /* Line 1806 of yacc.c */
2175 #line 332 "asmshader.y"
2176 {
2177 TRACE("Vertex shader 2.x\n");
2178 create_vs2x_parser(&asm_ctx);
2179 }
2180 break;
2181
2182 case 7:
2183
2184 /* Line 1806 of yacc.c */
2185 #line 337 "asmshader.y"
2186 {
2187 TRACE("Vertex shader 3.0\n");
2188 create_vs30_parser(&asm_ctx);
2189 }
2190 break;
2191
2192 case 8:
2193
2194 /* Line 1806 of yacc.c */
2195 #line 342 "asmshader.y"
2196 {
2197 TRACE("Pixel shader 1.0\n");
2198 create_ps10_parser(&asm_ctx);
2199 }
2200 break;
2201
2202 case 9:
2203
2204 /* Line 1806 of yacc.c */
2205 #line 347 "asmshader.y"
2206 {
2207 TRACE("Pixel shader 1.1\n");
2208 create_ps11_parser(&asm_ctx);
2209 }
2210 break;
2211
2212 case 10:
2213
2214 /* Line 1806 of yacc.c */
2215 #line 352 "asmshader.y"
2216 {
2217 TRACE("Pixel shader 1.2\n");
2218 create_ps12_parser(&asm_ctx);
2219 }
2220 break;
2221
2222 case 11:
2223
2224 /* Line 1806 of yacc.c */
2225 #line 357 "asmshader.y"
2226 {
2227 TRACE("Pixel shader 1.3\n");
2228 create_ps13_parser(&asm_ctx);
2229 }
2230 break;
2231
2232 case 12:
2233
2234 /* Line 1806 of yacc.c */
2235 #line 362 "asmshader.y"
2236 {
2237 TRACE("Pixel shader 1.4\n");
2238 create_ps14_parser(&asm_ctx);
2239 }
2240 break;
2241
2242 case 13:
2243
2244 /* Line 1806 of yacc.c */
2245 #line 367 "asmshader.y"
2246 {
2247 TRACE("Pixel shader 2.0\n");
2248 create_ps20_parser(&asm_ctx);
2249 }
2250 break;
2251
2252 case 14:
2253
2254 /* Line 1806 of yacc.c */
2255 #line 372 "asmshader.y"
2256 {
2257 TRACE("Pixel shader 2.x\n");
2258 create_ps2x_parser(&asm_ctx);
2259 }
2260 break;
2261
2262 case 15:
2263
2264 /* Line 1806 of yacc.c */
2265 #line 377 "asmshader.y"
2266 {
2267 TRACE("Pixel shader 3.0\n");
2268 create_ps30_parser(&asm_ctx);
2269 }
2270 break;
2271
2272 case 17:
2273
2274 /* Line 1806 of yacc.c */
2275 #line 384 "asmshader.y"
2276 {
2277 /* Nothing to do */
2278 }
2279 break;
2280
2281 case 18:
2282
2283 /* Line 1806 of yacc.c */
2284 #line 389 "asmshader.y"
2285 {
2286
2287 }
2288 break;
2289
2290 case 19:
2291
2292 /* Line 1806 of yacc.c */
2293 #line 393 "asmshader.y"
2294 {
2295 TRACE("predicate\n");
2296 asm_ctx.funcs->predicate(&asm_ctx, &(yyvsp[(1) - (2)].reg));
2297 }
2298 break;
2299
2300 case 20:
2301
2302 /* Line 1806 of yacc.c */
2303 #line 398 "asmshader.y"
2304 {
2305 TRACE("coissue\n");
2306 asm_ctx.funcs->coissue(&asm_ctx);
2307 }
2308 break;
2309
2310 case 21:
2311
2312 /* Line 1806 of yacc.c */
2313 #line 404 "asmshader.y"
2314 {
2315 TRACE("ADD\n");
2316 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ADD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2317 }
2318 break;
2319
2320 case 22:
2321
2322 /* Line 1806 of yacc.c */
2323 #line 409 "asmshader.y"
2324 {
2325 TRACE("NOP\n");
2326 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_NOP, 0, 0, 0, 0, 0, 0);
2327 }
2328 break;
2329
2330 case 23:
2331
2332 /* Line 1806 of yacc.c */
2333 #line 414 "asmshader.y"
2334 {
2335 TRACE("MOV\n");
2336 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MOV, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2337 }
2338 break;
2339
2340 case 24:
2341
2342 /* Line 1806 of yacc.c */
2343 #line 419 "asmshader.y"
2344 {
2345 TRACE("SUB\n");
2346 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SUB, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2347 }
2348 break;
2349
2350 case 25:
2351
2352 /* Line 1806 of yacc.c */
2353 #line 424 "asmshader.y"
2354 {
2355 TRACE("MAD\n");
2356 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MAD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
2357 }
2358 break;
2359
2360 case 26:
2361
2362 /* Line 1806 of yacc.c */
2363 #line 429 "asmshader.y"
2364 {
2365 TRACE("MUL\n");
2366 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MUL, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2367 }
2368 break;
2369
2370 case 27:
2371
2372 /* Line 1806 of yacc.c */
2373 #line 434 "asmshader.y"
2374 {
2375 TRACE("RCP\n");
2376 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RCP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2377 }
2378 break;
2379
2380 case 28:
2381
2382 /* Line 1806 of yacc.c */
2383 #line 439 "asmshader.y"
2384 {
2385 TRACE("RSQ\n");
2386 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RSQ, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2387 }
2388 break;
2389
2390 case 29:
2391
2392 /* Line 1806 of yacc.c */
2393 #line 444 "asmshader.y"
2394 {
2395 TRACE("DP3\n");
2396 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP3, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2397 }
2398 break;
2399
2400 case 30:
2401
2402 /* Line 1806 of yacc.c */
2403 #line 449 "asmshader.y"
2404 {
2405 TRACE("DP4\n");
2406 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP4, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2407 }
2408 break;
2409
2410 case 31:
2411
2412 /* Line 1806 of yacc.c */
2413 #line 454 "asmshader.y"
2414 {
2415 TRACE("MIN\n");
2416 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MIN, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2417 }
2418 break;
2419
2420 case 32:
2421
2422 /* Line 1806 of yacc.c */
2423 #line 459 "asmshader.y"
2424 {
2425 TRACE("MAX\n");
2426 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MAX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2427 }
2428 break;
2429
2430 case 33:
2431
2432 /* Line 1806 of yacc.c */
2433 #line 464 "asmshader.y"
2434 {
2435 TRACE("SLT\n");
2436 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SLT, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2437 }
2438 break;
2439
2440 case 34:
2441
2442 /* Line 1806 of yacc.c */
2443 #line 469 "asmshader.y"
2444 {
2445 TRACE("SGE\n");
2446 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SGE, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2447 }
2448 break;
2449
2450 case 35:
2451
2452 /* Line 1806 of yacc.c */
2453 #line 474 "asmshader.y"
2454 {
2455 TRACE("ABS\n");
2456 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ABS, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2457 }
2458 break;
2459
2460 case 36:
2461
2462 /* Line 1806 of yacc.c */
2463 #line 479 "asmshader.y"
2464 {
2465 TRACE("EXP\n");
2466 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_EXP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2467 }
2468 break;
2469
2470 case 37:
2471
2472 /* Line 1806 of yacc.c */
2473 #line 484 "asmshader.y"
2474 {
2475 TRACE("LOG\n");
2476 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOG, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2477 }
2478 break;
2479
2480 case 38:
2481
2482 /* Line 1806 of yacc.c */
2483 #line 489 "asmshader.y"
2484 {
2485 TRACE("LOGP\n");
2486 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOGP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2487 }
2488 break;
2489
2490 case 39:
2491
2492 /* Line 1806 of yacc.c */
2493 #line 494 "asmshader.y"
2494 {
2495 TRACE("EXPP\n");
2496 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_EXPP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2497 }
2498 break;
2499
2500 case 40:
2501
2502 /* Line 1806 of yacc.c */
2503 #line 499 "asmshader.y"
2504 {
2505 TRACE("DST\n");
2506 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DST, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2507 }
2508 break;
2509
2510 case 41:
2511
2512 /* Line 1806 of yacc.c */
2513 #line 504 "asmshader.y"
2514 {
2515 TRACE("LRP\n");
2516 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LRP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
2517 }
2518 break;
2519
2520 case 42:
2521
2522 /* Line 1806 of yacc.c */
2523 #line 509 "asmshader.y"
2524 {
2525 TRACE("FRC\n");
2526 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_FRC, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2527 }
2528 break;
2529
2530 case 43:
2531
2532 /* Line 1806 of yacc.c */
2533 #line 514 "asmshader.y"
2534 {
2535 TRACE("POW\n");
2536 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_POW, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2537 }
2538 break;
2539
2540 case 44:
2541
2542 /* Line 1806 of yacc.c */
2543 #line 519 "asmshader.y"
2544 {
2545 TRACE("CRS\n");
2546 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CRS, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2547 }
2548 break;
2549
2550 case 45:
2551
2552 /* Line 1806 of yacc.c */
2553 #line 524 "asmshader.y"
2554 {
2555 TRACE("SGN\n");
2556 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SGN, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
2557 }
2558 break;
2559
2560 case 46:
2561
2562 /* Line 1806 of yacc.c */
2563 #line 529 "asmshader.y"
2564 {
2565 TRACE("NRM\n");
2566 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_NRM, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2567 }
2568 break;
2569
2570 case 47:
2571
2572 /* Line 1806 of yacc.c */
2573 #line 534 "asmshader.y"
2574 {
2575 TRACE("SINCOS\n");
2576 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SINCOS, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
2577 }
2578 break;
2579
2580 case 48:
2581
2582 /* Line 1806 of yacc.c */
2583 #line 539 "asmshader.y"
2584 {
2585 TRACE("M4x4\n");
2586 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M4x4, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2587 }
2588 break;
2589
2590 case 49:
2591
2592 /* Line 1806 of yacc.c */
2593 #line 544 "asmshader.y"
2594 {
2595 TRACE("M4x3\n");
2596 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M4x3, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2597 }
2598 break;
2599
2600 case 50:
2601
2602 /* Line 1806 of yacc.c */
2603 #line 549 "asmshader.y"
2604 {
2605 TRACE("M3x4\n");
2606 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x4, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2607 }
2608 break;
2609
2610 case 51:
2611
2612 /* Line 1806 of yacc.c */
2613 #line 554 "asmshader.y"
2614 {
2615 TRACE("M3x3\n");
2616 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x3, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2617 }
2618 break;
2619
2620 case 52:
2621
2622 /* Line 1806 of yacc.c */
2623 #line 559 "asmshader.y"
2624 {
2625 TRACE("M3x2\n");
2626 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x2, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
2627 }
2628 break;
2629
2630 case 53:
2631
2632 /* Line 1806 of yacc.c */
2633 #line 564 "asmshader.y"
2634 {
2635 struct shader_reg reg;
2636 TRACE("Output reg declaration\n");
2637 ZeroMemory(&reg, sizeof(reg));
2638 reg.type = BWRITERSPR_OUTPUT;
2639 reg.regnum = (yyvsp[(3) - (3)].regnum);
2640 reg.rel_reg = NULL;
2641 reg.srcmod = 0;
2642 reg.u.writemask = BWRITERSP_WRITEMASK_ALL;
2643 asm_ctx.funcs->dcl_output(&asm_ctx, (yyvsp[(2) - (3)].declaration).dclusage, (yyvsp[(2) - (3)].declaration).regnum, &reg);
2644 }
2645 break;
2646
2647 case 54:
2648
2649 /* Line 1806 of yacc.c */
2650 #line 576 "asmshader.y"
2651 {
2652 struct shader_reg reg;
2653 TRACE("Output reg declaration\n");
2654 ZeroMemory(&reg, sizeof(reg));
2655 reg.type = BWRITERSPR_OUTPUT;
2656 reg.regnum = (yyvsp[(3) - (4)].regnum);
2657 reg.rel_reg = NULL;
2658 reg.srcmod = 0;
2659 reg.u.writemask = (yyvsp[(4) - (4)].writemask);
2660 asm_ctx.funcs->dcl_output(&asm_ctx, (yyvsp[(2) - (4)].declaration).dclusage, (yyvsp[(2) - (4)].declaration).regnum, &reg);
2661 }
2662 break;
2663
2664 case 55:
2665
2666 /* Line 1806 of yacc.c */
2667 #line 588 "asmshader.y"
2668 {
2669 struct shader_reg reg;
2670 TRACE("Input reg declaration\n");
2671 if((yyvsp[(3) - (4)].modshift).shift != 0) {
2672 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2673 asm_ctx.line_no);
2674 set_parse_status(&asm_ctx.status, PARSE_ERR);
2675 }
2676 if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) ||
2677 asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) {
2678 asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n",
2679 asm_ctx.line_no);
2680 set_parse_status(&asm_ctx.status, PARSE_ERR);
2681 }
2682 ZeroMemory(&reg, sizeof(reg));
2683 reg.type = (yyvsp[(4) - (4)].reg).type;
2684 reg.regnum = (yyvsp[(4) - (4)].reg).regnum;
2685 reg.rel_reg = NULL;
2686 reg.srcmod = 0;
2687 reg.u.writemask = BWRITERSP_WRITEMASK_ALL;
2688 asm_ctx.funcs->dcl_input(&asm_ctx, (yyvsp[(2) - (4)].declaration).dclusage, (yyvsp[(2) - (4)].declaration).regnum, (yyvsp[(3) - (4)].modshift).mod, &reg);
2689 }
2690 break;
2691
2692 case 56:
2693
2694 /* Line 1806 of yacc.c */
2695 #line 611 "asmshader.y"
2696 {
2697 struct shader_reg reg;
2698 TRACE("Input reg declaration\n");
2699 if((yyvsp[(3) - (5)].modshift).shift != 0) {
2700 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2701 asm_ctx.line_no);
2702 set_parse_status(&asm_ctx.status, PARSE_ERR);
2703 }
2704 if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) ||
2705 asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) {
2706 asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n",
2707 asm_ctx.line_no);
2708 set_parse_status(&asm_ctx.status, PARSE_ERR);
2709 }
2710 ZeroMemory(&reg, sizeof(reg));
2711 reg.type = (yyvsp[(4) - (5)].reg).type;
2712 reg.regnum = (yyvsp[(4) - (5)].reg).regnum;
2713 reg.rel_reg = NULL;
2714 reg.srcmod = 0;
2715 reg.u.writemask = (yyvsp[(5) - (5)].writemask);
2716 asm_ctx.funcs->dcl_input(&asm_ctx, (yyvsp[(2) - (5)].declaration).dclusage, (yyvsp[(2) - (5)].declaration).regnum, (yyvsp[(3) - (5)].modshift).mod, &reg);
2717 }
2718 break;
2719
2720 case 57:
2721
2722 /* Line 1806 of yacc.c */
2723 #line 634 "asmshader.y"
2724 {
2725 struct shader_reg reg;
2726 TRACE("Input reg declaration\n");
2727 if((yyvsp[(2) - (3)].modshift).shift != 0) {
2728 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2729 asm_ctx.line_no);
2730 set_parse_status(&asm_ctx.status, PARSE_ERR);
2731 }
2732 if(asm_ctx.shader->type != ST_PIXEL) {
2733 asmparser_message(&asm_ctx, "Line %u: Declaration needs a semantic\n",
2734 asm_ctx.line_no);
2735 set_parse_status(&asm_ctx.status, PARSE_ERR);
2736 }
2737 ZeroMemory(&reg, sizeof(reg));
2738 reg.type = (yyvsp[(3) - (3)].reg).type;
2739 reg.regnum = (yyvsp[(3) - (3)].reg).regnum;
2740 reg.rel_reg = NULL;
2741 reg.srcmod = 0;
2742 reg.u.writemask = BWRITERSP_WRITEMASK_ALL;
2743 asm_ctx.funcs->dcl_input(&asm_ctx, 0, 0, (yyvsp[(2) - (3)].modshift).mod, &reg);
2744 }
2745 break;
2746
2747 case 58:
2748
2749 /* Line 1806 of yacc.c */
2750 #line 656 "asmshader.y"
2751 {
2752 struct shader_reg reg;
2753 TRACE("Input reg declaration\n");
2754 if((yyvsp[(2) - (4)].modshift).shift != 0) {
2755 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2756 asm_ctx.line_no);
2757 set_parse_status(&asm_ctx.status, PARSE_ERR);
2758 }
2759 if(asm_ctx.shader->type != ST_PIXEL) {
2760 asmparser_message(&asm_ctx, "Line %u: Declaration needs a semantic\n",
2761 asm_ctx.line_no);
2762 set_parse_status(&asm_ctx.status, PARSE_ERR);
2763 }
2764 ZeroMemory(&reg, sizeof(reg));
2765 reg.type = (yyvsp[(3) - (4)].reg).type;
2766 reg.regnum = (yyvsp[(3) - (4)].reg).regnum;
2767 reg.rel_reg = NULL;
2768 reg.srcmod = 0;
2769 reg.u.writemask = (yyvsp[(4) - (4)].writemask);
2770 asm_ctx.funcs->dcl_input(&asm_ctx, 0, 0, (yyvsp[(2) - (4)].modshift).mod, &reg);
2771 }
2772 break;
2773
2774 case 59:
2775
2776 /* Line 1806 of yacc.c */
2777 #line 678 "asmshader.y"
2778 {
2779 TRACE("Sampler declared\n");
2780 if((yyvsp[(3) - (4)].modshift).shift != 0) {
2781 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2782 asm_ctx.line_no);
2783 set_parse_status(&asm_ctx.status, PARSE_ERR);
2784 }
2785 asm_ctx.funcs->dcl_sampler(&asm_ctx, (yyvsp[(2) - (4)].samplertype), (yyvsp[(3) - (4)].modshift).mod, (yyvsp[(4) - (4)].regnum), asm_ctx.line_no);
2786 }
2787 break;
2788
2789 case 60:
2790
2791 /* Line 1806 of yacc.c */
2792 #line 688 "asmshader.y"
2793 {
2794 TRACE("Sampler declared\n");
2795 if((yyvsp[(2) - (3)].modshift).shift != 0) {
2796 asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n",
2797 asm_ctx.line_no);
2798 set_parse_status(&asm_ctx.status, PARSE_ERR);
2799 }
2800 if(asm_ctx.shader->type != ST_PIXEL) {
2801 asmparser_message(&asm_ctx, "Line %u: Declaration needs a sampler type\n",
2802 asm_ctx.line_no);
2803 set_parse_status(&asm_ctx.status, PARSE_ERR);
2804 }
2805 asm_ctx.funcs->dcl_sampler(&asm_ctx, BWRITERSTT_UNKNOWN, (yyvsp[(2) - (3)].modshift).mod, (yyvsp[(3) - (3)].regnum), asm_ctx.line_no);
2806 }
2807 break;
2808
2809 case 61:
2810
2811 /* Line 1806 of yacc.c */
2812 #line 703 "asmshader.y"
2813 {
2814 TRACE("Error rule: sampler decl of input reg\n");
2815 asmparser_message(&asm_ctx, "Line %u: Sampler declarations of input regs is not valid\n",
2816 asm_ctx.line_no);
2817 set_parse_status(&asm_ctx.status, PARSE_WARN);
2818 }
2819 break;
2820
2821 case 62:
2822
2823 /* Line 1806 of yacc.c */
2824 #line 710 "asmshader.y"
2825 {
2826 TRACE("Error rule: sampler decl of output reg\n");
2827 asmparser_message(&asm_ctx, "Line %u: Sampler declarations of output regs is not valid\n",
2828 asm_ctx.line_no);
2829 set_parse_status(&asm_ctx.status, PARSE_WARN);
2830 }
2831 break;
2832
2833 case 63:
2834
2835 /* Line 1806 of yacc.c */
2836 #line 717 "asmshader.y"
2837 {
2838 asm_ctx.funcs->constF(&asm_ctx, (yyvsp[(2) - (10)].regnum), (yyvsp[(4) - (10)].immval).val, (yyvsp[(6) - (10)].immval).val, (yyvsp[(8) - (10)].immval).val, (yyvsp[(10) - (10)].immval).val);
2839 }
2840 break;
2841
2842 case 64:
2843
2844 /* Line 1806 of yacc.c */
2845 #line 721 "asmshader.y"
2846 {
2847 asm_ctx.funcs->constI(&asm_ctx, (yyvsp[(2) - (10)].regnum), (yyvsp[(4) - (10)].immval).val, (yyvsp[(6) - (10)].immval).val, (yyvsp[(8) - (10)].immval).val, (yyvsp[(10) - (10)].immval).val);
2848 }
2849 break;
2850
2851 case 65:
2852
2853 /* Line 1806 of yacc.c */
2854 #line 725 "asmshader.y"
2855 {
2856 asm_ctx.funcs->constB(&asm_ctx, (yyvsp[(2) - (4)].regnum), (yyvsp[(4) - (4)].immbool));
2857 }
2858 break;
2859
2860 case 66:
2861
2862 /* Line 1806 of yacc.c */
2863 #line 729 "asmshader.y"
2864 {
2865 TRACE("REP\n");
2866 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_REP, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 1);
2867 }
2868 break;
2869
2870 case 67:
2871
2872 /* Line 1806 of yacc.c */
2873 #line 734 "asmshader.y"
2874 {
2875 TRACE("ENDREP\n");
2876 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDREP, 0, 0, 0, 0, 0, 0);
2877 }
2878 break;
2879
2880 case 68:
2881
2882 /* Line 1806 of yacc.c */
2883 #line 739 "asmshader.y"
2884 {
2885 TRACE("IF\n");
2886 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_IF, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 1);
2887 }
2888 break;
2889
2890 case 69:
2891
2892 /* Line 1806 of yacc.c */
2893 #line 744 "asmshader.y"
2894 {
2895 TRACE("IFC\n");
2896 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_IFC, 0, 0, (yyvsp[(2) - (3)].comptype), 0, &(yyvsp[(3) - (3)].sregs), 2);
2897 }
2898 break;
2899
2900 case 70:
2901
2902 /* Line 1806 of yacc.c */
2903 #line 749 "asmshader.y"
2904 {
2905 TRACE("ELSE\n");
2906 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ELSE, 0, 0, 0, 0, 0, 0);
2907 }
2908 break;
2909
2910 case 71:
2911
2912 /* Line 1806 of yacc.c */
2913 #line 754 "asmshader.y"
2914 {
2915 TRACE("ENDIF\n");
2916 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDIF, 0, 0, 0, 0, 0, 0);
2917 }
2918 break;
2919
2920 case 72:
2921
2922 /* Line 1806 of yacc.c */
2923 #line 759 "asmshader.y"
2924 {
2925 TRACE("BREAK\n");
2926 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAK, 0, 0, 0, 0, 0, 0);
2927 }
2928 break;
2929
2930 case 73:
2931
2932 /* Line 1806 of yacc.c */
2933 #line 764 "asmshader.y"
2934 {
2935 TRACE("BREAKC\n");
2936 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAKC, 0, 0, (yyvsp[(2) - (3)].comptype), 0, &(yyvsp[(3) - (3)].sregs), 2);
2937 }
2938 break;
2939
2940 case 74:
2941
2942 /* Line 1806 of yacc.c */
2943 #line 769 "asmshader.y"
2944 {
2945 TRACE("BREAKP\n");
2946 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAKP, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 1);
2947 }
2948 break;
2949
2950 case 75:
2951
2952 /* Line 1806 of yacc.c */
2953 #line 774 "asmshader.y"
2954 {
2955 TRACE("CALL\n");
2956 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CALL, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 1);
2957 }
2958 break;
2959
2960 case 76:
2961
2962 /* Line 1806 of yacc.c */
2963 #line 779 "asmshader.y"
2964 {
2965 TRACE("CALLNZ\n");
2966 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CALLNZ, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 2);
2967 }
2968 break;
2969
2970 case 77:
2971
2972 /* Line 1806 of yacc.c */
2973 #line 784 "asmshader.y"
2974 {
2975 TRACE("LOOP\n");
2976 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOOP, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 2);
2977 }
2978 break;
2979
2980 case 78:
2981
2982 /* Line 1806 of yacc.c */
2983 #line 789 "asmshader.y"
2984 {
2985 TRACE("RET\n");
2986 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RET, 0, 0, 0, 0, 0, 0);
2987 }
2988 break;
2989
2990 case 79:
2991
2992 /* Line 1806 of yacc.c */
2993 #line 794 "asmshader.y"
2994 {
2995 TRACE("ENDLOOP\n");
2996 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDLOOP, 0, 0, 0, 0, 0, 0);
2997 }
2998 break;
2999
3000 case 80:
3001
3002 /* Line 1806 of yacc.c */
3003 #line 799 "asmshader.y"
3004 {
3005 TRACE("LABEL\n");
3006 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LABEL, 0, 0, 0, 0, &(yyvsp[(2) - (2)].sregs), 1);
3007 }
3008 break;
3009
3010 case 81:
3011
3012 /* Line 1806 of yacc.c */
3013 #line 804 "asmshader.y"
3014 {
3015 TRACE("SETP\n");
3016 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SETP, 0, 0, (yyvsp[(2) - (5)].comptype), &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3017 }
3018 break;
3019
3020 case 82:
3021
3022 /* Line 1806 of yacc.c */
3023 #line 809 "asmshader.y"
3024 {
3025 TRACE("TEXLDL\n");
3026 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDL, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3027 }
3028 break;
3029
3030 case 83:
3031
3032 /* Line 1806 of yacc.c */
3033 #line 814 "asmshader.y"
3034 {
3035 TRACE("LIT\n");
3036 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LIT, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3037 }
3038 break;
3039
3040 case 84:
3041
3042 /* Line 1806 of yacc.c */
3043 #line 819 "asmshader.y"
3044 {
3045 TRACE("MOVA\n");
3046 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MOVA, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3047 }
3048 break;
3049
3050 case 85:
3051
3052 /* Line 1806 of yacc.c */
3053 #line 824 "asmshader.y"
3054 {
3055 TRACE("CND\n");
3056 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CND, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
3057 }
3058 break;
3059
3060 case 86:
3061
3062 /* Line 1806 of yacc.c */
3063 #line 829 "asmshader.y"
3064 {
3065 TRACE("CMP\n");
3066 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CMP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
3067 }
3068 break;
3069
3070 case 87:
3071
3072 /* Line 1806 of yacc.c */
3073 #line 834 "asmshader.y"
3074 {
3075 TRACE("DP2ADD\n");
3076 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP2ADD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 3);
3077 }
3078 break;
3079
3080 case 88:
3081
3082 /* Line 1806 of yacc.c */
3083 #line 839 "asmshader.y"
3084 {
3085 TRACE("TEXCOORD\n");
3086 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXCOORD, (yyvsp[(2) - (3)].modshift).mod, (yyvsp[(2) - (3)].modshift).shift, 0, &(yyvsp[(3) - (3)].reg), 0, 0);
3087 }
3088 break;
3089
3090 case 89:
3091
3092 /* Line 1806 of yacc.c */
3093 #line 844 "asmshader.y"
3094 {
3095 TRACE("TEXCRD\n");
3096 /* texcoord and texcrd share the same opcode */
3097 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXCOORD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3098 }
3099 break;
3100
3101 case 90:
3102
3103 /* Line 1806 of yacc.c */
3104 #line 850 "asmshader.y"
3105 {
3106 TRACE("TEXKILL\n");
3107 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXKILL, 0, 0, 0, &(yyvsp[(2) - (2)].reg), 0, 0);
3108 }
3109 break;
3110
3111 case 91:
3112
3113 /* Line 1806 of yacc.c */
3114 #line 855 "asmshader.y"
3115 {
3116 TRACE("TEX\n");
3117 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEX, (yyvsp[(2) - (3)].modshift).mod, (yyvsp[(2) - (3)].modshift).shift, 0, &(yyvsp[(3) - (3)].reg), 0, 0);
3118 }
3119 break;
3120
3121 case 92:
3122
3123 /* Line 1806 of yacc.c */
3124 #line 860 "asmshader.y"
3125 {
3126 TRACE("TEXDEPTH\n");
3127 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDEPTH, (yyvsp[(2) - (3)].modshift).mod, (yyvsp[(2) - (3)].modshift).shift, 0, &(yyvsp[(3) - (3)].reg), 0, 0);
3128 }
3129 break;
3130
3131 case 93:
3132
3133 /* Line 1806 of yacc.c */
3134 #line 865 "asmshader.y"
3135 {
3136 TRACE("TEXLD\n");
3137 /* There is more than one acceptable syntax for texld:
3138 with 1 sreg (PS 1.4) or
3139 with 2 sregs (PS 2.0+)
3140 Moreover, texld shares the same opcode as the tex instruction,
3141 so there are a total of 3 valid syntaxes
3142 These variations are handled in asmparser.c */
3143 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3144 }
3145 break;
3146
3147 case 94:
3148
3149 /* Line 1806 of yacc.c */
3150 #line 876 "asmshader.y"
3151 {
3152 TRACE("TEXLDP\n");
3153 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDP, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3154 }
3155 break;
3156
3157 case 95:
3158
3159 /* Line 1806 of yacc.c */
3160 #line 881 "asmshader.y"
3161 {
3162 TRACE("TEXLDB\n");
3163 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDB, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3164 }
3165 break;
3166
3167 case 96:
3168
3169 /* Line 1806 of yacc.c */
3170 #line 886 "asmshader.y"
3171 {
3172 TRACE("TEXBEM\n");
3173 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXBEM, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3174 }
3175 break;
3176
3177 case 97:
3178
3179 /* Line 1806 of yacc.c */
3180 #line 891 "asmshader.y"
3181 {
3182 TRACE("TEXBEML\n");
3183 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXBEML, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3184 }
3185 break;
3186
3187 case 98:
3188
3189 /* Line 1806 of yacc.c */
3190 #line 896 "asmshader.y"
3191 {
3192 TRACE("TEXREG2AR\n");
3193 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2AR, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3194 }
3195 break;
3196
3197 case 99:
3198
3199 /* Line 1806 of yacc.c */
3200 #line 901 "asmshader.y"
3201 {
3202 TRACE("TEXREG2GB\n");
3203 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2GB, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3204 }
3205 break;
3206
3207 case 100:
3208
3209 /* Line 1806 of yacc.c */
3210 #line 906 "asmshader.y"
3211 {
3212 TRACE("TEXREG2RGB\n");
3213 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2RGB, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3214 }
3215 break;
3216
3217 case 101:
3218
3219 /* Line 1806 of yacc.c */
3220 #line 911 "asmshader.y"
3221 {
3222 TRACE("TEXM3x2PAD\n");
3223 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2PAD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3224 }
3225 break;
3226
3227 case 102:
3228
3229 /* Line 1806 of yacc.c */
3230 #line 916 "asmshader.y"
3231 {
3232 TRACE("INSTR_TEXM3x3PAD\n");
3233 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3PAD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3234 }
3235 break;
3236
3237 case 103:
3238
3239 /* Line 1806 of yacc.c */
3240 #line 921 "asmshader.y"
3241 {
3242 TRACE("TEXM3x3SPEC\n");
3243 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3SPEC, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3244 }
3245 break;
3246
3247 case 104:
3248
3249 /* Line 1806 of yacc.c */
3250 #line 926 "asmshader.y"
3251 {
3252 TRACE("TEXM3x3VSPEC\n");
3253 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3VSPEC, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3254 }
3255 break;
3256
3257 case 105:
3258
3259 /* Line 1806 of yacc.c */
3260 #line 931 "asmshader.y"
3261 {
3262 TRACE("TEXM3x3TEX\n");
3263 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3TEX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3264 }
3265 break;
3266
3267 case 106:
3268
3269 /* Line 1806 of yacc.c */
3270 #line 936 "asmshader.y"
3271 {
3272 TRACE("TEXDP3TEX\n");
3273 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDP3TEX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3274 }
3275 break;
3276
3277 case 107:
3278
3279 /* Line 1806 of yacc.c */
3280 #line 941 "asmshader.y"
3281 {
3282 TRACE("TEXM3x2DEPTH\n");
3283 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2DEPTH, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3284 }
3285 break;
3286
3287 case 108:
3288
3289 /* Line 1806 of yacc.c */
3290 #line 946 "asmshader.y"
3291 {
3292 TRACE("TEXM3x2TEX\n");
3293 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2TEX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3294 }
3295 break;
3296
3297 case 109:
3298
3299 /* Line 1806 of yacc.c */
3300 #line 951 "asmshader.y"
3301 {
3302 TRACE("TEXDP3\n");
3303 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDP3, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3304 }
3305 break;
3306
3307 case 110:
3308
3309 /* Line 1806 of yacc.c */
3310 #line 956 "asmshader.y"
3311 {
3312 TRACE("TEXM3x3\n");
3313 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3314 }
3315 break;
3316
3317 case 111:
3318
3319 /* Line 1806 of yacc.c */
3320 #line 961 "asmshader.y"
3321 {
3322 TRACE("BEM\n");
3323 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BEM, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 2);
3324 }
3325 break;
3326
3327 case 112:
3328
3329 /* Line 1806 of yacc.c */
3330 #line 966 "asmshader.y"
3331 {
3332 TRACE("DSX\n");
3333 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DSX, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3334 }
3335 break;
3336
3337 case 113:
3338
3339 /* Line 1806 of yacc.c */
3340 #line 971 "asmshader.y"
3341 {
3342 TRACE("DSY\n");
3343 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DSY, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 1);
3344 }
3345 break;
3346
3347 case 114:
3348
3349 /* Line 1806 of yacc.c */
3350 #line 976 "asmshader.y"
3351 {
3352 TRACE("TEXLDD\n");
3353 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDD, (yyvsp[(2) - (5)].modshift).mod, (yyvsp[(2) - (5)].modshift).shift, 0, &(yyvsp[(3) - (5)].reg), &(yyvsp[(5) - (5)].sregs), 4);
3354 }
3355 break;
3356
3357 case 115:
3358
3359 /* Line 1806 of yacc.c */
3360 #line 981 "asmshader.y"
3361 {
3362 TRACE("PHASE\n");
3363 asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_PHASE, 0, 0, 0, 0, 0, 0);
3364 }
3365 break;
3366
3367 case 116:
3368
3369 /* Line 1806 of yacc.c */
3370 #line 988 "asmshader.y"
3371 {
3372 (yyval.reg).regnum = (yyvsp[(1) - (2)].reg).regnum;
3373 (yyval.reg).type = (yyvsp[(1) - (2)].reg).type;
3374 (yyval.reg).u.writemask = BWRITERSP_WRITEMASK_ALL;
3375 (yyval.reg).srcmod = BWRITERSPSM_NONE;
3376 set_rel_reg(&(yyval.reg), &(yyvsp[(2) - (2)].rel_reg));
3377 }
3378 break;
3379
3380 case 117:
3381
3382 /* Line 1806 of yacc.c */
3383 #line 996 "asmshader.y"
3384 {
3385 (yyval.reg).regnum = (yyvsp[(1) - (2)].reg).regnum;
3386 (yyval.reg).type = (yyvsp[(1) - (2)].reg).type;
3387 (yyval.reg).u.writemask = (yyvsp[(2) - (2)].writemask);
3388 (yyval.reg).srcmod = BWRITERSPSM_NONE;
3389 (yyval.reg).rel_reg = NULL;
3390 }
3391 break;
3392
3393 case 118:
3394
3395 /* Line 1806 of yacc.c */
3396 #line 1005 "asmshader.y"
3397 {
3398 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEMP;
3399 }
3400 break;
3401
3402 case 119:
3403
3404 /* Line 1806 of yacc.c */
3405 #line 1009 "asmshader.y"
3406 {
3407 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_OUTPUT;
3408 }
3409 break;
3410
3411 case 120:
3412
3413 /* Line 1806 of yacc.c */
3414 #line 1013 "asmshader.y"
3415 {
3416 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_INPUT;
3417 }
3418 break;
3419
3420 case 121:
3421
3422 /* Line 1806 of yacc.c */
3423 #line 1017 "asmshader.y"
3424 {
3425 asmparser_message(&asm_ctx, "Line %u: Register c%u is not a valid destination register\n",
3426 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
3427 set_parse_status(&asm_ctx.status, PARSE_WARN);
3428 }
3429 break;
3430
3431 case 122:
3432
3433 /* Line 1806 of yacc.c */
3434 #line 1023 "asmshader.y"
3435 {
3436 asmparser_message(&asm_ctx, "Line %u: Register i%u is not a valid destination register\n",
3437 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
3438 set_parse_status(&asm_ctx.status, PARSE_WARN);
3439 }
3440 break;
3441
3442 case 123:
3443
3444 /* Line 1806 of yacc.c */
3445 #line 1029 "asmshader.y"
3446 {
3447 asmparser_message(&asm_ctx, "Line %u: Register b%u is not a valid destination register\n",
3448 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
3449 set_parse_status(&asm_ctx.status, PARSE_WARN);
3450 }
3451 break;
3452
3453 case 124:
3454
3455 /* Line 1806 of yacc.c */
3456 #line 1035 "asmshader.y"
3457 {
3458 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE;
3459 }
3460 break;
3461
3462 case 125:
3463
3464 /* Line 1806 of yacc.c */
3465 #line 1039 "asmshader.y"
3466 {
3467 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEXCRDOUT;
3468 }
3469 break;
3470
3471 case 126:
3472
3473 /* Line 1806 of yacc.c */
3474 #line 1043 "asmshader.y"
3475 {
3476 asmparser_message(&asm_ctx, "Line %u: Register s%u is not a valid destination register\n",
3477 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
3478 set_parse_status(&asm_ctx.status, PARSE_WARN);
3479 }
3480 break;
3481
3482 case 127:
3483
3484 /* Line 1806 of yacc.c */
3485 #line 1049 "asmshader.y"
3486 {
3487 (yyval.reg).regnum = BWRITERSRO_POSITION; (yyval.reg).type = BWRITERSPR_RASTOUT;
3488 }
3489 break;
3490
3491 case 128:
3492
3493 /* Line 1806 of yacc.c */
3494 #line 1053 "asmshader.y"
3495 {
3496 (yyval.reg).regnum = BWRITERSRO_POINT_SIZE; (yyval.reg).type = BWRITERSPR_RASTOUT;
3497 }
3498 break;
3499
3500 case 129:
3501
3502 /* Line 1806 of yacc.c */
3503 #line 1057 "asmshader.y"
3504 {
3505 (yyval.reg).regnum = BWRITERSRO_FOG; (yyval.reg).type = BWRITERSPR_RASTOUT;
3506 }
3507 break;
3508
3509 case 130:
3510
3511 /* Line 1806 of yacc.c */
3512 #line 1061 "asmshader.y"
3513 {
3514 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_ATTROUT;
3515 }
3516 break;
3517
3518 case 131:
3519
3520 /* Line 1806 of yacc.c */
3521 #line 1065 "asmshader.y"
3522 {
3523 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_COLOROUT;
3524 }
3525 break;
3526
3527 case 132:
3528
3529 /* Line 1806 of yacc.c */
3530 #line 1069 "asmshader.y"
3531 {
3532 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_DEPTHOUT;
3533 }
3534 break;
3535
3536 case 133:
3537
3538 /* Line 1806 of yacc.c */
3539 #line 1073 "asmshader.y"
3540 {
3541 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_PREDICATE;
3542 }
3543 break;
3544
3545 case 134:
3546
3547 /* Line 1806 of yacc.c */
3548 #line 1077 "asmshader.y"
3549 {
3550 asmparser_message(&asm_ctx, "Line %u: Register vPos is not a valid destination register\n",
3551 asm_ctx.line_no);
3552 set_parse_status(&asm_ctx.status, PARSE_WARN);
3553 }
3554 break;
3555
3556 case 135:
3557
3558 /* Line 1806 of yacc.c */
3559 #line 1083 "asmshader.y"
3560 {
3561 asmparser_message(&asm_ctx, "Line %u: Register vFace is not a valid destination register\n",
3562 asm_ctx.line_no);
3563 set_parse_status(&asm_ctx.status, PARSE_WARN);
3564 }
3565 break;
3566
3567 case 136:
3568
3569 /* Line 1806 of yacc.c */
3570 #line 1089 "asmshader.y"
3571 {
3572 /* index 0 is hardcoded for the addr register */
3573 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR;
3574 }
3575 break;
3576
3577 case 137:
3578
3579 /* Line 1806 of yacc.c */
3580 #line 1094 "asmshader.y"
3581 {
3582 asmparser_message(&asm_ctx, "Line %u: Register aL is not a valid destination register\n",
3583 asm_ctx.line_no);
3584 set_parse_status(&asm_ctx.status, PARSE_WARN);
3585 }
3586 break;
3587
3588 case 138:
3589
3590 /* Line 1806 of yacc.c */
3591 #line 1101 "asmshader.y"
3592 {
3593 if((yyvsp[(2) - (2)].wm_components).writemask == SWIZZLE_ERR) {
3594 asmparser_message(&asm_ctx, "Line %u: Invalid writemask specified\n",
3595 asm_ctx.line_no);
3596 set_parse_status(&asm_ctx.status, PARSE_ERR);
3597 /* Provide a correct writemask to prevent following complaints */
3598 (yyval.writemask) = BWRITERSP_WRITEMASK_ALL;
3599 }
3600 else {
3601 (yyval.writemask) = (yyvsp[(2) - (2)].wm_components).writemask;
3602 TRACE("Writemask: %x\n", (yyval.writemask));
3603 }
3604 }
3605 break;
3606
3607 case 139:
3608
3609 /* Line 1806 of yacc.c */
3610 #line 1116 "asmshader.y"
3611 {
3612 (yyval.wm_components).writemask = 1 << (yyvsp[(1) - (1)].component);
3613 (yyval.wm_components).last = (yyvsp[(1) - (1)].component);
3614 (yyval.wm_components).idx = 1;
3615 }
3616 break;
3617
3618 case 140:
3619
3620 /* Line 1806 of yacc.c */
3621 #line 1122 "asmshader.y"
3622 {
3623 if((yyvsp[(1) - (2)].wm_components).writemask == SWIZZLE_ERR || (yyvsp[(1) - (2)].wm_components).idx == 4)
3624 /* Wrong writemask */
3625 (yyval.wm_components).writemask = SWIZZLE_ERR;
3626 else {
3627 if((yyvsp[(2) - (2)].component) <= (yyvsp[(1) - (2)].wm_components).last)
3628 (yyval.wm_components).writemask = SWIZZLE_ERR;
3629 else {
3630 (yyval.wm_components).writemask = (yyvsp[(1) - (2)].wm_components).writemask | (1 << (yyvsp[(2) - (2)].component));
3631 (yyval.wm_components).idx = (yyvsp[(1) - (2)].wm_components).idx + 1;
3632 }
3633 }
3634 }
3635 break;
3636
3637 case 141:
3638
3639 /* Line 1806 of yacc.c */
3640 #line 1137 "asmshader.y"
3641 {
3642 (yyval.swizzle) = BWRITERVS_NOSWIZZLE;
3643 TRACE("Default swizzle: %08x\n", (yyval.swizzle));
3644 }
3645 break;
3646
3647 case 142:
3648
3649 /* Line 1806 of yacc.c */
3650 #line 1142 "asmshader.y"
3651 {
3652 if((yyvsp[(2) - (2)].sw_components).swizzle == SWIZZLE_ERR) {
3653 asmparser_message(&asm_ctx, "Line %u: Invalid swizzle\n",
3654 asm_ctx.line_no);
3655 set_parse_status(&asm_ctx.status, PARSE_ERR);
3656 /* Provide a correct swizzle to prevent following complaints */
3657 (yyval.swizzle) = BWRITERVS_NOSWIZZLE;
3658 }
3659 else {
3660 DWORD last, i;
3661
3662 (yyval.swizzle) = (yyvsp[(2) - (2)].sw_components).swizzle << BWRITERVS_SWIZZLE_SHIFT;
3663 /* Fill the swizzle by extending the last component */
3664 last = ((yyvsp[(2) - (2)].sw_components).swizzle >> 2 * ((yyvsp[(2) - (2)].sw_components).idx - 1)) & 0x03;
3665 for(i = (yyvsp[(2) - (2)].sw_components).idx; i < 4; i++){
3666 (yyval.swizzle) |= last << (BWRITERVS_SWIZZLE_SHIFT + 2 * i);
3667 }
3668 TRACE("Got a swizzle: %08x\n", (yyval.swizzle));
3669 }
3670 }
3671 break;
3672
3673 case 143:
3674
3675 /* Line 1806 of yacc.c */
3676 #line 1164 "asmshader.y"
3677 {
3678 (yyval.sw_components).swizzle = (yyvsp[(1) - (1)].component);
3679 (yyval.sw_components).idx = 1;
3680 }
3681 break;
3682
3683 case 144:
3684
3685 /* Line 1806 of yacc.c */
3686 #line 1169 "asmshader.y"
3687 {
3688 if((yyvsp[(1) - (2)].sw_components).idx == 4) {
3689 /* Too many sw_components */
3690 (yyval.sw_components).swizzle = SWIZZLE_ERR;
3691 (yyval.sw_components).idx = 4;
3692 }
3693 else {
3694 (yyval.sw_components).swizzle = (yyvsp[(1) - (2)].sw_components).swizzle | ((yyvsp[(2) - (2)].component) << 2 * (yyvsp[(1) - (2)].sw_components).idx);
3695 (yyval.sw_components).idx = (yyvsp[(1) - (2)].sw_components).idx + 1;
3696 }
3697 }
3698 break;
3699
3700 case 145:
3701
3702 /* Line 1806 of yacc.c */
3703 #line 1182 "asmshader.y"
3704 {
3705 (yyval.modshift).mod = 0;
3706 (yyval.modshift).shift = 0;
3707 }
3708 break;
3709
3710 case 146:
3711
3712 /* Line 1806 of yacc.c */
3713 #line 1187 "asmshader.y"
3714 {
3715 (yyval.modshift).mod = (yyvsp[(1) - (2)].modshift).mod | (yyvsp[(2) - (2)].modshift).mod;
3716 if((yyvsp[(1) - (2)].modshift).shift && (yyvsp[(2) - (2)].modshift).shift) {
3717 asmparser_message(&asm_ctx, "Line %u: More than one shift flag\n",
3718 asm_ctx.line_no);
3719 set_parse_status(&asm_ctx.status, PARSE_ERR);
3720 (yyval.modshift).shift = (yyvsp[(1) - (2)].modshift).shift;
3721 } else {
3722 (yyval.modshift).shift = (yyvsp[(1) - (2)].modshift).shift | (yyvsp[(2) - (2)].modshift).shift;
3723 }
3724 }
3725 break;
3726
3727 case 147:
3728
3729 /* Line 1806 of yacc.c */
3730 #line 1200 "asmshader.y"
3731 {
3732 (yyval.modshift).mod = 0;
3733 (yyval.modshift).shift = 1;
3734 }
3735 break;
3736
3737 case 148:
3738
3739 /* Line 1806 of yacc.c */
3740 #line 1205 "asmshader.y"
3741 {
3742 (yyval.modshift).mod = 0;
3743 (yyval.modshift).shift = 2;
3744 }
3745 break;
3746
3747 case 149:
3748
3749 /* Line 1806 of yacc.c */
3750 #line 1210 "asmshader.y"
3751 {
3752 (yyval.modshift).mod = 0;
3753 (yyval.modshift).shift = 3;
3754 }
3755 break;
3756
3757 case 150:
3758
3759 /* Line 1806 of yacc.c */
3760 #line 1215 "asmshader.y"
3761 {
3762 (yyval.modshift).mod = 0;
3763 (yyval.modshift).shift = 15;
3764 }
3765 break;
3766
3767 case 151:
3768
3769 /* Line 1806 of yacc.c */
3770 #line 1220 "asmshader.y"
3771 {
3772 (yyval.modshift).mod = 0;
3773 (yyval.modshift).shift = 14;
3774 }
3775 break;
3776
3777 case 152:
3778
3779 /* Line 1806 of yacc.c */
3780 #line 1225 "asmshader.y"
3781 {
3782 (yyval.modshift).mod = 0;
3783 (yyval.modshift).shift = 13;
3784 }
3785 break;
3786
3787 case 153:
3788
3789 /* Line 1806 of yacc.c */
3790 #line 1230 "asmshader.y"
3791 {
3792 (yyval.modshift).mod = BWRITERSPDM_SATURATE;
3793 (yyval.modshift).shift = 0;
3794 }
3795 break;
3796
3797 case 154:
3798
3799 /* Line 1806 of yacc.c */
3800 #line 1235 "asmshader.y"
3801 {
3802 (yyval.modshift).mod = BWRITERSPDM_PARTIALPRECISION;
3803 (yyval.modshift).shift = 0;
3804 }
3805 break;
3806
3807 case 155:
3808
3809 /* Line 1806 of yacc.c */
3810 #line 1240 "asmshader.y"
3811 {
3812 (yyval.modshift).mod = BWRITERSPDM_MSAMPCENTROID;
3813 (yyval.modshift).shift = 0;
3814 }
3815 break;
3816
3817 case 156:
3818
3819 /* Line 1806 of yacc.c */
3820 #line 1246 "asmshader.y"
3821 {
3822 (yyval.sregs).reg[0] = (yyvsp[(1) - (1)].reg);
3823 (yyval.sregs).count = 1;
3824 }
3825 break;
3826
3827 case 157:
3828
3829 /* Line 1806 of yacc.c */
3830 #line 1251 "asmshader.y"
3831 {
3832 if((yyval.sregs).count == MAX_SRC_REGS){
3833 asmparser_message(&asm_ctx, "Line %u: Too many source registers in this instruction\n",
3834 asm_ctx.line_no);
3835 set_parse_status(&asm_ctx.status, PARSE_ERR);
3836 }
3837 else
3838 (yyval.sregs).reg[(yyval.sregs).count++] = (yyvsp[(3) - (3)].reg);
3839 }
3840 break;
3841
3842 case 158:
3843
3844 /* Line 1806 of yacc.c */
3845 #line 1262 "asmshader.y"
3846 {
3847 (yyval.reg).type = (yyvsp[(1) - (3)].reg).type;
3848 (yyval.reg).regnum = (yyvsp[(1) - (3)].reg).regnum;
3849 (yyval.reg).u.swizzle = (yyvsp[(3) - (3)].swizzle);
3850 (yyval.reg).srcmod = BWRITERSPSM_NONE;
3851 set_rel_reg(&(yyval.reg), &(yyvsp[(2) - (3)].rel_reg));
3852 }
3853 break;
3854
3855 case 159:
3856
3857 /* Line 1806 of yacc.c */
3858 #line 1270 "asmshader.y"
3859 {
3860 (yyval.reg).type = (yyvsp[(1) - (4)].reg).type;
3861 (yyval.reg).regnum = (yyvsp[(1) - (4)].reg).regnum;
3862 set_rel_reg(&(yyval.reg), &(yyvsp[(2) - (4)].rel_reg));
3863 (yyval.reg).srcmod = (yyvsp[(3) - (4)].srcmod);
3864 (yyval.reg).u.swizzle = (yyvsp[(4) - (4)].swizzle);
3865 }
3866 break;
3867
3868 case 160:
3869
3870 /* Line 1806 of yacc.c */
3871 #line 1278 "asmshader.y"
3872 {
3873 (yyval.reg).type = (yyvsp[(2) - (4)].reg).type;
3874 (yyval.reg).regnum = (yyvsp[(2) - (4)].reg).regnum;
3875 (yyval.reg).srcmod = BWRITERSPSM_NEG;
3876 set_rel_reg(&(yyval.reg), &(yyvsp[(3) - (4)].rel_reg));
3877 (yyval.reg).u.swizzle = (yyvsp[(4) - (4)].swizzle);
3878 }
3879 break;
3880
3881 case 161:
3882
3883 /* Line 1806 of yacc.c */
3884 #line 1286 "asmshader.y"
3885 {
3886 (yyval.reg).type = (yyvsp[(2) - (5)].reg).type;
3887 (yyval.reg).regnum = (yyvsp[(2) - (5)].reg).regnum;
3888 set_rel_reg(&(yyval.reg), &(yyvsp[(3) - (5)].rel_reg));
3889 switch((yyvsp[(4) - (5)].srcmod)) {
3890 case BWRITERSPSM_BIAS: (yyval.reg).srcmod = BWRITERSPSM_BIASNEG; break;
3891 case BWRITERSPSM_X2: (yyval.reg).srcmod = BWRITERSPSM_X2NEG; break;
3892 case BWRITERSPSM_SIGN: (yyval.reg).srcmod = BWRITERSPSM_SIGNNEG; break;
3893 case BWRITERSPSM_ABS: (yyval.reg).srcmod = BWRITERSPSM_ABSNEG; break;
3894 case BWRITERSPSM_DZ:
3895 asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DZ\n",
3896 asm_ctx.line_no);
3897 set_parse_status(&asm_ctx.status, PARSE_ERR);
3898 break;
3899 case BWRITERSPSM_DW:
3900 asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DW\n",
3901 asm_ctx.line_no);
3902 set_parse_status(&asm_ctx.status, PARSE_ERR);
3903 break;
3904 default:
3905 FIXME("Unhandled combination of NEGATE and %u\n", (yyvsp[(4) - (5)].srcmod));
3906 }
3907 (yyval.reg).u.swizzle = (yyvsp[(5) - (5)].swizzle);
3908 }
3909 break;
3910
3911 case 162:
3912
3913 /* Line 1806 of yacc.c */
3914 #line 1311 "asmshader.y"
3915 {
3916 if((yyvsp[(1) - (5)].immval).val != 1.0 || (!(yyvsp[(1) - (5)].immval).integer)) {
3917 asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP, "
3918 "%g - reg found\n", asm_ctx.line_no, (yyvsp[(1) - (5)].immval).val);
3919 set_parse_status(&asm_ctx.status, PARSE_ERR);
3920 }
3921 /* Complement - not compatible with other source modifiers */
3922 (yyval.reg).type = (yyvsp[(3) - (5)].reg).type;
3923 (yyval.reg).regnum = (yyvsp[(3) - (5)].reg).regnum;
3924 (yyval.reg).srcmod = BWRITERSPSM_COMP;
3925 set_rel_reg(&(yyval.reg), &(yyvsp[(4) - (5)].rel_reg));
3926 (yyval.reg).u.swizzle = (yyvsp[(5) - (5)].swizzle);
3927 }
3928 break;
3929
3930 case 163:
3931
3932 /* Line 1806 of yacc.c */
3933 #line 1325 "asmshader.y"
3934 {
3935 /* For nicer error reporting */
3936 if((yyvsp[(1) - (6)].immval).val != 1.0 || (!(yyvsp[(1) - (6)].immval).integer)) {
3937 asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP\n",
3938 asm_ctx.line_no);
3939 set_parse_status(&asm_ctx.status, PARSE_ERR);
3940 } else {
3941 asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: D3DSPSM_COMP and %s\n",
3942 asm_ctx.line_no,
3943 debug_print_srcmod((yyvsp[(5) - (6)].srcmod)));
3944 set_parse_status(&asm_ctx.status, PARSE_ERR);
3945 }
3946 }
3947 break;
3948
3949 case 164:
3950
3951 /* Line 1806 of yacc.c */
3952 #line 1339 "asmshader.y"
3953 {
3954 (yyval.reg).type = (yyvsp[(2) - (3)].reg).type;
3955 (yyval.reg).regnum = (yyvsp[(2) - (3)].reg).regnum;
3956 (yyval.reg).rel_reg = NULL;
3957 (yyval.reg).srcmod = BWRITERSPSM_NOT;
3958 (yyval.reg).u.swizzle = (yyvsp[(3) - (3)].swizzle);
3959 }
3960 break;
3961
3962 case 165:
3963
3964 /* Line 1806 of yacc.c */
3965 #line 1348 "asmshader.y"
3966 {
3967 (yyval.rel_reg).has_rel_reg = FALSE;
3968 (yyval.rel_reg).additional_offset = 0;
3969 }
3970 break;
3971
3972 case 166:
3973
3974 /* Line 1806 of yacc.c */
3975 #line 1353 "asmshader.y"
3976 {
3977 (yyval.rel_reg).has_rel_reg = FALSE;
3978 (yyval.rel_reg).additional_offset = (yyvsp[(2) - (3)].immval).val;
3979 }
3980 break;
3981
3982 case 167:
3983
3984 /* Line 1806 of yacc.c */
3985 #line 1358 "asmshader.y"
3986 {
3987 (yyval.rel_reg).has_rel_reg = TRUE;
3988 (yyval.rel_reg).type = (yyvsp[(2) - (4)].reg).type;
3989 (yyval.rel_reg).additional_offset = 0;
3990 (yyval.rel_reg).rel_regnum = (yyvsp[(2) - (4)].reg).regnum;
3991 (yyval.rel_reg).swizzle = (yyvsp[(3) - (4)].swizzle);
3992 }
3993 break;
3994
3995 case 168:
3996
3997 /* Line 1806 of yacc.c */
3998 #line 1366 "asmshader.y"
3999 {
4000 (yyval.rel_reg).has_rel_reg = TRUE;
4001 (yyval.rel_reg).type = (yyvsp[(4) - (6)].reg).type;
4002 (yyval.rel_reg).additional_offset = (yyvsp[(2) - (6)].immval).val;
4003 (yyval.rel_reg).rel_regnum = (yyvsp[(4) - (6)].reg).regnum;
4004 (yyval.rel_reg).swizzle = (yyvsp[(5) - (6)].swizzle);
4005 }
4006 break;
4007
4008 case 169:
4009
4010 /* Line 1806 of yacc.c */
4011 #line 1374 "asmshader.y"
4012 {
4013 (yyval.rel_reg).has_rel_reg = TRUE;
4014 (yyval.rel_reg).type = (yyvsp[(2) - (6)].reg).type;
4015 (yyval.rel_reg).additional_offset = (yyvsp[(5) - (6)].immval).val;
4016 (yyval.rel_reg).rel_regnum = (yyvsp[(2) - (6)].reg).regnum;
4017 (yyval.rel_reg).swizzle = (yyvsp[(3) - (6)].swizzle);
4018 }
4019 break;
4020
4021 case 170:
4022
4023 /* Line 1806 of yacc.c */
4024 #line 1382 "asmshader.y"
4025 {
4026 (yyval.rel_reg).has_rel_reg = TRUE;
4027 (yyval.rel_reg).type = (yyvsp[(4) - (8)].reg).type;
4028 (yyval.rel_reg).additional_offset = (yyvsp[(2) - (8)].immval).val + (yyvsp[(7) - (8)].immval).val;
4029 (yyval.rel_reg).rel_regnum = (yyvsp[(4) - (8)].reg).regnum;
4030 (yyval.rel_reg).swizzle = (yyvsp[(5) - (8)].swizzle);
4031 }
4032 break;
4033
4034 case 171:
4035
4036 /* Line 1806 of yacc.c */
4037 #line 1391 "asmshader.y"
4038 {
4039 if(!(yyvsp[(1) - (1)].immval).integer) {
4040 asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n",
4041 asm_ctx.line_no, (yyvsp[(1) - (1)].immval).val);
4042 set_parse_status(&asm_ctx.status, PARSE_ERR);
4043 }
4044 (yyval.immval).val = (yyvsp[(1) - (1)].immval).val;
4045 }
4046 break;
4047
4048 case 172:
4049
4050 /* Line 1806 of yacc.c */
4051 #line 1400 "asmshader.y"
4052 {
4053 if(!(yyvsp[(3) - (3)].immval).integer) {
4054 asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n",
4055 asm_ctx.line_no, (yyvsp[(3) - (3)].immval).val);
4056 set_parse_status(&asm_ctx.status, PARSE_ERR);
4057 }
4058 (yyval.immval).val = (yyvsp[(1) - (3)].immval).val + (yyvsp[(3) - (3)].immval).val;
4059 }
4060 break;
4061
4062 case 173:
4063
4064 /* Line 1806 of yacc.c */
4065 #line 1410 "asmshader.y"
4066 {
4067 (yyval.srcmod) = BWRITERSPSM_BIAS;
4068 }
4069 break;
4070
4071 case 174:
4072
4073 /* Line 1806 of yacc.c */
4074 #line 1414 "asmshader.y"
4075 {
4076 (yyval.srcmod) = BWRITERSPSM_X2;
4077 }
4078 break;
4079
4080 case 175:
4081
4082 /* Line 1806 of yacc.c */
4083 #line 1418 "asmshader.y"
4084 {
4085 (yyval.srcmod) = BWRITERSPSM_SIGN;
4086 }
4087 break;
4088
4089 case 176:
4090
4091 /* Line 1806 of yacc.c */
4092 #line 1422 "asmshader.y"
4093 {
4094 (yyval.srcmod) = BWRITERSPSM_DZ;
4095 }
4096 break;
4097
4098 case 177:
4099
4100 /* Line 1806 of yacc.c */
4101 #line 1426 "asmshader.y"
4102 {
4103 (yyval.srcmod) = BWRITERSPSM_DW;
4104 }
4105 break;
4106
4107 case 178:
4108
4109 /* Line 1806 of yacc.c */
4110 #line 1430 "asmshader.y"
4111 {
4112 (yyval.srcmod) = BWRITERSPSM_ABS;
4113 }
4114 break;
4115
4116 case 179:
4117
4118 /* Line 1806 of yacc.c */
4119 #line 1435 "asmshader.y"
4120 {
4121 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR;
4122 }
4123 break;
4124
4125 case 180:
4126
4127 /* Line 1806 of yacc.c */
4128 #line 1439 "asmshader.y"
4129 {
4130 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_LOOP;
4131 }
4132 break;
4133
4134 case 181:
4135
4136 /* Line 1806 of yacc.c */
4137 #line 1444 "asmshader.y"
4138 {
4139 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEMP;
4140 }
4141 break;
4142
4143 case 182:
4144
4145 /* Line 1806 of yacc.c */
4146 #line 1448 "asmshader.y"
4147 {
4148 asmparser_message(&asm_ctx, "Line %u: Register o%u is not a valid source register\n",
4149 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
4150 set_parse_status(&asm_ctx.status, PARSE_WARN);
4151 }
4152 break;
4153
4154 case 183:
4155
4156 /* Line 1806 of yacc.c */
4157 #line 1454 "asmshader.y"
4158 {
4159 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_INPUT;
4160 }
4161 break;
4162
4163 case 184:
4164
4165 /* Line 1806 of yacc.c */
4166 #line 1458 "asmshader.y"
4167 {
4168 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_CONST;
4169 }
4170 break;
4171
4172 case 185:
4173
4174 /* Line 1806 of yacc.c */
4175 #line 1462 "asmshader.y"
4176 {
4177 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_CONSTINT;
4178 }
4179 break;
4180
4181 case 186:
4182
4183 /* Line 1806 of yacc.c */
4184 #line 1466 "asmshader.y"
4185 {
4186 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_CONSTBOOL;
4187 }
4188 break;
4189
4190 case 187:
4191
4192 /* Line 1806 of yacc.c */
4193 #line 1470 "asmshader.y"
4194 {
4195 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE;
4196 }
4197 break;
4198
4199 case 188:
4200
4201 /* Line 1806 of yacc.c */
4202 #line 1474 "asmshader.y"
4203 {
4204 asmparser_message(&asm_ctx, "Line %u: Register oT%u is not a valid source register\n",
4205 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
4206 set_parse_status(&asm_ctx.status, PARSE_WARN);
4207 }
4208 break;
4209
4210 case 189:
4211
4212 /* Line 1806 of yacc.c */
4213 #line 1480 "asmshader.y"
4214 {
4215 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_SAMPLER;
4216 }
4217 break;
4218
4219 case 190:
4220
4221 /* Line 1806 of yacc.c */
4222 #line 1484 "asmshader.y"
4223 {
4224 asmparser_message(&asm_ctx, "Line %u: Register oPos is not a valid source register\n",
4225 asm_ctx.line_no);
4226 set_parse_status(&asm_ctx.status, PARSE_WARN);
4227 }
4228 break;
4229
4230 case 191:
4231
4232 /* Line 1806 of yacc.c */
4233 #line 1490 "asmshader.y"
4234 {
4235 asmparser_message(&asm_ctx, "Line %u: Register oFog is not a valid source register\n",
4236 asm_ctx.line_no);
4237 set_parse_status(&asm_ctx.status, PARSE_WARN);
4238 }
4239 break;
4240
4241 case 192:
4242
4243 /* Line 1806 of yacc.c */
4244 #line 1496 "asmshader.y"
4245 {
4246 asmparser_message(&asm_ctx, "Line %u: Register oD%u is not a valid source register\n",
4247 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
4248 set_parse_status(&asm_ctx.status, PARSE_WARN);
4249 }
4250 break;
4251
4252 case 193:
4253
4254 /* Line 1806 of yacc.c */
4255 #line 1502 "asmshader.y"
4256 {
4257 asmparser_message(&asm_ctx, "Line %u: Register oC%u is not a valid source register\n",
4258 asm_ctx.line_no, (yyvsp[(1) - (1)].regnum));
4259 set_parse_status(&asm_ctx.status, PARSE_WARN);
4260 }
4261 break;
4262
4263 case 194:
4264
4265 /* Line 1806 of yacc.c */
4266 #line 1508 "asmshader.y"
4267 {
4268 asmparser_message(&asm_ctx, "Line %u: Register oDepth is not a valid source register\n",
4269 asm_ctx.line_no);
4270 set_parse_status(&asm_ctx.status, PARSE_WARN);
4271 }
4272 break;
4273
4274 case 195:
4275
4276 /* Line 1806 of yacc.c */
4277 #line 1514 "asmshader.y"
4278 {
4279 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_PREDICATE;
4280 }
4281 break;
4282
4283 case 196:
4284
4285 /* Line 1806 of yacc.c */
4286 #line 1518 "asmshader.y"
4287 {
4288 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_MISCTYPE;
4289 }
4290 break;
4291
4292 case 197:
4293
4294 /* Line 1806 of yacc.c */
4295 #line 1522 "asmshader.y"
4296 {
4297 (yyval.reg).regnum = 1; (yyval.reg).type = BWRITERSPR_MISCTYPE;
4298 }
4299 break;
4300
4301 case 198:
4302
4303 /* Line 1806 of yacc.c */
4304 #line 1526 "asmshader.y"
4305 {
4306 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR;
4307 }
4308 break;
4309
4310 case 199:
4311
4312 /* Line 1806 of yacc.c */
4313 #line 1530 "asmshader.y"
4314 {
4315 (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_LOOP;
4316 }
4317 break;
4318
4319 case 200:
4320
4321 /* Line 1806 of yacc.c */
4322 #line 1534 "asmshader.y"
4323 {
4324 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_LABEL;
4325 }
4326 break;
4327
4328 case 201:
4329
4330 /* Line 1806 of yacc.c */
4331 #line 1538 "asmshader.y"
4332 { (yyval.comptype) = BWRITER_COMPARISON_GT; }
4333 break;
4334
4335 case 202:
4336
4337 /* Line 1806 of yacc.c */
4338 #line 1539 "asmshader.y"
4339 { (yyval.comptype) = BWRITER_COMPARISON_LT; }
4340 break;
4341
4342 case 203:
4343
4344 /* Line 1806 of yacc.c */
4345 #line 1540 "asmshader.y"
4346 { (yyval.comptype) = BWRITER_COMPARISON_GE; }
4347 break;
4348
4349 case 204:
4350
4351 /* Line 1806 of yacc.c */
4352 #line 1541 "asmshader.y"
4353 { (yyval.comptype) = BWRITER_COMPARISON_LE; }
4354 break;
4355
4356 case 205:
4357
4358 /* Line 1806 of yacc.c */
4359 #line 1542 "asmshader.y"
4360 { (yyval.comptype) = BWRITER_COMPARISON_EQ; }
4361 break;
4362
4363 case 206:
4364
4365 /* Line 1806 of yacc.c */
4366 #line 1543 "asmshader.y"
4367 { (yyval.comptype) = BWRITER_COMPARISON_NE; }
4368 break;
4369
4370 case 207:
4371
4372 /* Line 1806 of yacc.c */
4373 #line 1546 "asmshader.y"
4374 {
4375 TRACE("dcl_position%u\n", (yyvsp[(1) - (1)].regnum));
4376 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4377 (yyval.declaration).dclusage = BWRITERDECLUSAGE_POSITION;
4378 }
4379 break;
4380
4381 case 208:
4382
4383 /* Line 1806 of yacc.c */
4384 #line 1552 "asmshader.y"
4385 {
4386 TRACE("dcl_blendweight%u\n", (yyvsp[(1) - (1)].regnum));
4387 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4388 (yyval.declaration).dclusage = BWRITERDECLUSAGE_BLENDWEIGHT;
4389 }
4390 break;
4391
4392 case 209:
4393
4394 /* Line 1806 of yacc.c */
4395 #line 1558 "asmshader.y"
4396 {
4397 TRACE("dcl_blendindices%u\n", (yyvsp[(1) - (1)].regnum));
4398 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4399 (yyval.declaration).dclusage = BWRITERDECLUSAGE_BLENDINDICES;
4400 }
4401 break;
4402
4403 case 210:
4404
4405 /* Line 1806 of yacc.c */
4406 #line 1564 "asmshader.y"
4407 {
4408 TRACE("dcl_normal%u\n", (yyvsp[(1) - (1)].regnum));
4409 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4410 (yyval.declaration).dclusage = BWRITERDECLUSAGE_NORMAL;
4411 }
4412 break;
4413
4414 case 211:
4415
4416 /* Line 1806 of yacc.c */
4417 #line 1570 "asmshader.y"
4418 {
4419 TRACE("dcl_psize%u\n", (yyvsp[(1) - (1)].regnum));
4420 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4421 (yyval.declaration).dclusage = BWRITERDECLUSAGE_PSIZE;
4422 }
4423 break;
4424
4425 case 212:
4426
4427 /* Line 1806 of yacc.c */
4428 #line 1576 "asmshader.y"
4429 {
4430 TRACE("dcl_texcoord%u\n", (yyvsp[(1) - (1)].regnum));
4431 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4432 (yyval.declaration).dclusage = BWRITERDECLUSAGE_TEXCOORD;
4433 }
4434 break;
4435
4436 case 213:
4437
4438 /* Line 1806 of yacc.c */
4439 #line 1582 "asmshader.y"
4440 {
4441 TRACE("dcl_tangent%u\n", (yyvsp[(1) - (1)].regnum));
4442 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4443 (yyval.declaration).dclusage = BWRITERDECLUSAGE_TANGENT;
4444 }
4445 break;
4446
4447 case 214:
4448
4449 /* Line 1806 of yacc.c */
4450 #line 1588 "asmshader.y"
4451 {
4452 TRACE("dcl_binormal%u\n", (yyvsp[(1) - (1)].regnum));
4453 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4454 (yyval.declaration).dclusage = BWRITERDECLUSAGE_BINORMAL;
4455 }
4456 break;
4457
4458 case 215:
4459
4460 /* Line 1806 of yacc.c */
4461 #line 1594 "asmshader.y"
4462 {
4463 TRACE("dcl_tessfactor%u\n", (yyvsp[(1) - (1)].regnum));
4464 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4465 (yyval.declaration).dclusage = BWRITERDECLUSAGE_TESSFACTOR;
4466 }
4467 break;
4468
4469 case 216:
4470
4471 /* Line 1806 of yacc.c */
4472 #line 1600 "asmshader.y"
4473 {
4474 TRACE("dcl_positiont%u\n", (yyvsp[(1) - (1)].regnum));
4475 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4476 (yyval.declaration).dclusage = BWRITERDECLUSAGE_POSITIONT;
4477 }
4478 break;
4479
4480 case 217:
4481
4482 /* Line 1806 of yacc.c */
4483 #line 1606 "asmshader.y"
4484 {
4485 TRACE("dcl_color%u\n", (yyvsp[(1) - (1)].regnum));
4486 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4487 (yyval.declaration).dclusage = BWRITERDECLUSAGE_COLOR;
4488 }
4489 break;
4490
4491 case 218:
4492
4493 /* Line 1806 of yacc.c */
4494 #line 1612 "asmshader.y"
4495 {
4496 TRACE("dcl_fog%u\n", (yyvsp[(1) - (1)].regnum));
4497 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4498 (yyval.declaration).dclusage = BWRITERDECLUSAGE_FOG;
4499 }
4500 break;
4501
4502 case 219:
4503
4504 /* Line 1806 of yacc.c */
4505 #line 1618 "asmshader.y"
4506 {
4507 TRACE("dcl_depth%u\n", (yyvsp[(1) - (1)].regnum));
4508 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4509 (yyval.declaration).dclusage = BWRITERDECLUSAGE_DEPTH;
4510 }
4511 break;
4512
4513 case 220:
4514
4515 /* Line 1806 of yacc.c */
4516 #line 1624 "asmshader.y"
4517 {
4518 TRACE("dcl_sample%u\n", (yyvsp[(1) - (1)].regnum));
4519 (yyval.declaration).regnum = (yyvsp[(1) - (1)].regnum);
4520 (yyval.declaration).dclusage = BWRITERDECLUSAGE_SAMPLE;
4521 }
4522 break;
4523
4524 case 221:
4525
4526 /* Line 1806 of yacc.c */
4527 #line 1631 "asmshader.y"
4528 {
4529 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_INPUT;
4530 }
4531 break;
4532
4533 case 222:
4534
4535 /* Line 1806 of yacc.c */
4536 #line 1635 "asmshader.y"
4537 {
4538 (yyval.reg).regnum = (yyvsp[(1) - (1)].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE;
4539 }
4540 break;
4541
4542 case 223:
4543
4544 /* Line 1806 of yacc.c */
4545 #line 1640 "asmshader.y"
4546 {
4547 (yyval.samplertype) = BWRITERSTT_1D;
4548 }
4549 break;
4550
4551 case 224:
4552
4553 /* Line 1806 of yacc.c */
4554 #line 1644 "asmshader.y"
4555 {
4556 (yyval.samplertype) = BWRITERSTT_2D;
4557 }
4558 break;
4559
4560 case 225:
4561
4562 /* Line 1806 of yacc.c */
4563 #line 1648 "asmshader.y"
4564 {
4565 (yyval.samplertype) = BWRITERSTT_CUBE;
4566 }
4567 break;
4568
4569 case 226:
4570
4571 /* Line 1806 of yacc.c */
4572 #line 1652 "asmshader.y"
4573 {
4574 (yyval.samplertype) = BWRITERSTT_VOLUME;
4575 }
4576 break;
4577
4578 case 227:
4579
4580 /* Line 1806 of yacc.c */
4581 #line 1657 "asmshader.y"
4582 {
4583 (yyval.reg).type = BWRITERSPR_PREDICATE;
4584 (yyval.reg).regnum = 0;
4585 (yyval.reg).rel_reg = NULL;
4586 (yyval.reg).srcmod = BWRITERSPSM_NONE;
4587 (yyval.reg).u.swizzle = (yyvsp[(3) - (4)].swizzle);
4588 }
4589 break;
4590
4591 case 228:
4592
4593 /* Line 1806 of yacc.c */
4594 #line 1665 "asmshader.y"
4595 {
4596 (yyval.reg).type = BWRITERSPR_PREDICATE;
4597 (yyval.reg).regnum = 0;
4598 (yyval.reg).rel_reg = NULL;
4599 (yyval.reg).srcmod = BWRITERSPSM_NOT;
4600 (yyval.reg).u.swizzle = (yyvsp[(4) - (5)].swizzle);
4601 }
4602 break;
4603
4604
4605
4606 /* Line 1806 of yacc.c */
4607 #line 4612 "asmshader.tab.c"
4608 default: break;
4609 }
4610 /* User semantic actions sometimes alter yychar, and that requires
4611 that yytoken be updated with the new translation. We take the
4612 approach of translating immediately before every use of yytoken.
4613 One alternative is translating here after every semantic action,
4614 but that translation would be missed if the semantic action invokes
4615 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4616 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4617 incorrect destructor might then be invoked immediately. In the
4618 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4619 to an incorrect destructor call or verbose syntax error message
4620 before the lookahead is translated. */
4621 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4622
4623 YYPOPSTACK (yylen);
4624 yylen = 0;
4625 YY_STACK_PRINT (yyss, yyssp);
4626
4627 *++yyvsp = yyval;
4628
4629 /* Now `shift' the result of the reduction. Determine what state
4630 that goes to, based on the state we popped back to and the rule
4631 number reduced by. */
4632
4633 yyn = yyr1[yyn];
4634
4635 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4636 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4637 yystate = yytable[yystate];
4638 else
4639 yystate = yydefgoto[yyn - YYNTOKENS];
4640
4641 goto yynewstate;
4642
4643
4644 /*------------------------------------.
4645 | yyerrlab -- here on detecting error |
4646 `------------------------------------*/
4647 yyerrlab:
4648 /* Make sure we have latest lookahead translation. See comments at
4649 user semantic actions for why this is necessary. */
4650 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4651
4652 /* If not already recovering from an error, report this error. */
4653 if (!yyerrstatus)
4654 {
4655 ++yynerrs;
4656 #if ! YYERROR_VERBOSE
4657 yyerror (YY_("syntax error"));
4658 #else
4659 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4660 yyssp, yytoken)
4661 {
4662 char const *yymsgp = YY_("syntax error");
4663 int yysyntax_error_status;
4664 yysyntax_error_status = YYSYNTAX_ERROR;
4665 if (yysyntax_error_status == 0)
4666 yymsgp = yymsg;
4667 else if (yysyntax_error_status == 1)
4668 {
4669 if (yymsg != yymsgbuf)
4670 YYSTACK_FREE (yymsg);
4671 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4672 if (!yymsg)
4673 {
4674 yymsg = yymsgbuf;
4675 yymsg_alloc = sizeof yymsgbuf;
4676 yysyntax_error_status = 2;
4677 }
4678 else
4679 {
4680 yysyntax_error_status = YYSYNTAX_ERROR;
4681 yymsgp = yymsg;
4682 }
4683 }
4684 yyerror (yymsgp);
4685 if (yysyntax_error_status == 2)
4686 goto yyexhaustedlab;
4687 }
4688 # undef YYSYNTAX_ERROR
4689 #endif
4690 }
4691
4692
4693
4694 if (yyerrstatus == 3)
4695 {
4696 /* If just tried and failed to reuse lookahead token after an
4697 error, discard it. */
4698
4699 if (yychar <= YYEOF)
4700 {
4701 /* Return failure if at end of input. */
4702 if (yychar == YYEOF)
4703 YYABORT;
4704 }
4705 else
4706 {
4707 yydestruct ("Error: discarding",
4708 yytoken, &yylval);
4709 yychar = YYEMPTY;
4710 }
4711 }
4712
4713 /* Else will try to reuse lookahead token after shifting the error
4714 token. */
4715 goto yyerrlab1;
4716
4717
4718 /*---------------------------------------------------.
4719 | yyerrorlab -- error raised explicitly by YYERROR. |
4720 `---------------------------------------------------*/
4721 yyerrorlab:
4722
4723 /* Pacify compilers like GCC when the user code never invokes
4724 YYERROR and the label yyerrorlab therefore never appears in user
4725 code. */
4726 if (/*CONSTCOND*/ 0)
4727 goto yyerrorlab;
4728
4729 /* Do not reclaim the symbols of the rule which action triggered
4730 this YYERROR. */
4731 YYPOPSTACK (yylen);
4732 yylen = 0;
4733 YY_STACK_PRINT (yyss, yyssp);
4734 yystate = *yyssp;
4735 goto yyerrlab1;
4736
4737
4738 /*-------------------------------------------------------------.
4739 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4740 `-------------------------------------------------------------*/
4741 yyerrlab1:
4742 yyerrstatus = 3; /* Each real token shifted decrements this. */
4743
4744 for (;;)
4745 {
4746 yyn = yypact[yystate];
4747 if (!yypact_value_is_default (yyn))
4748 {
4749 yyn += YYTERROR;
4750 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4751 {
4752 yyn = yytable[yyn];
4753 if (0 < yyn)
4754 break;
4755 }
4756 }
4757
4758 /* Pop the current state because it cannot handle the error token. */
4759 if (yyssp == yyss)
4760 YYABORT;
4761
4762
4763 yydestruct ("Error: popping",
4764 yystos[yystate], yyvsp);
4765 YYPOPSTACK (1);
4766 yystate = *yyssp;
4767 YY_STACK_PRINT (yyss, yyssp);
4768 }
4769
4770 *++yyvsp = yylval;
4771
4772
4773 /* Shift the error token. */
4774 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4775
4776 yystate = yyn;
4777 goto yynewstate;
4778
4779
4780 /*-------------------------------------.
4781 | yyacceptlab -- YYACCEPT comes here. |
4782 `-------------------------------------*/
4783 yyacceptlab:
4784 yyresult = 0;
4785 goto yyreturn;
4786
4787 /*-----------------------------------.
4788 | yyabortlab -- YYABORT comes here. |
4789 `-----------------------------------*/
4790 yyabortlab:
4791 yyresult = 1;
4792 goto yyreturn;
4793
4794 #if !defined(yyoverflow) || YYERROR_VERBOSE
4795 /*-------------------------------------------------.
4796 | yyexhaustedlab -- memory exhaustion comes here. |
4797 `-------------------------------------------------*/
4798 yyexhaustedlab:
4799 yyerror (YY_("memory exhausted"));
4800 yyresult = 2;
4801 /* Fall through. */
4802 #endif
4803
4804 yyreturn:
4805 if (yychar != YYEMPTY)
4806 {
4807 /* Make sure we have latest lookahead translation. See comments at
4808 user semantic actions for why this is necessary. */
4809 yytoken = YYTRANSLATE (yychar);
4810 yydestruct ("Cleanup: discarding lookahead",
4811 yytoken, &yylval);
4812 }
4813 /* Do not reclaim the symbols of the rule which action triggered
4814 this YYABORT or YYACCEPT. */
4815 YYPOPSTACK (yylen);
4816 YY_STACK_PRINT (yyss, yyssp);
4817 while (yyssp != yyss)
4818 {
4819 yydestruct ("Cleanup: popping",
4820 yystos[*yyssp], yyvsp);
4821 YYPOPSTACK (1);
4822 }
4823 #ifndef yyoverflow
4824 if (yyss != yyssa)
4825 YYSTACK_FREE (yyss);
4826 #endif
4827 #if YYERROR_VERBOSE
4828 if (yymsg != yymsgbuf)
4829 YYSTACK_FREE (yymsg);
4830 #endif
4831 /* Make sure YYID is used. */
4832 return YYID (yyresult);
4833 }
4834
4835
4836
4837 /* Line 2067 of yacc.c */
4838 #line 1673 "asmshader.y"
4839
4840
4841 struct bwriter_shader *parse_asm_shader(char **messages)
4842 {
4843 struct bwriter_shader *ret = NULL;
4844
4845 asm_ctx.shader = NULL;
4846 asm_ctx.status = PARSE_SUCCESS;
4847 asm_ctx.messages.size = asm_ctx.messages.capacity = 0;
4848 asm_ctx.line_no = 1;
4849
4850 asmshader_parse();
4851
4852 if (asm_ctx.status != PARSE_ERR)
4853 ret = asm_ctx.shader;
4854 else if (asm_ctx.shader)
4855 SlDeleteShader(asm_ctx.shader);
4856
4857 if (messages)
4858 {
4859 if (asm_ctx.messages.size)
4860 {
4861 /* Shrink the buffer to the used size */
4862 *messages = d3dcompiler_realloc(asm_ctx.messages.string, asm_ctx.messages.size + 1);
4863 if (!*messages)
4864 {
4865 ERR("Out of memory, no messages reported\n");
4866 d3dcompiler_free(asm_ctx.messages.string);
4867 }
4868 }
4869 else
4870 {
4871 *messages = NULL;
4872 }
4873 }
4874 else
4875 {
4876 if (asm_ctx.messages.capacity)
4877 d3dcompiler_free(asm_ctx.messages.string);
4878 }
4879
4880 return ret;
4881 }
4882