2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 1
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 1 "program_parse.y"
74 * Copyright © 2009 Intel Corporation
76 * Permission is hereby granted, free of charge, to any person obtaining a
77 * copy of this software and associated documentation files (the "Software"),
78 * to deal in the Software without restriction, including without limitation
79 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
80 * and/or sell copies of the Software, and to permit persons to whom the
81 * Software is furnished to do so, subject to the following conditions:
83 * The above copyright notice and this permission notice (including the next
84 * paragraph) shall be included in all copies or substantial portions of the
87 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
90 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93 * DEALINGS IN THE SOFTWARE.
99 #include "main/mtypes.h"
100 #include "main/imports.h"
101 #include "program/program.h"
102 #include "program/prog_parameter.h"
103 #include "program/prog_parameter_layout.h"
104 #include "program/prog_statevars.h"
105 #include "program/prog_instruction.h"
107 #include "program/symbol_table.h"
108 #include "program/program_parser.h"
110 extern void *yy_scan_string(char *);
111 extern void yy_delete_buffer(void *);
113 static struct asm_symbol
*declare_variable(struct asm_parser_state
*state
,
114 char *name
, enum asm_type t
, struct YYLTYPE
*locp
);
116 static int add_state_reference(struct gl_program_parameter_list
*param_list
,
117 const gl_state_index tokens
[STATE_LENGTH
]);
119 static int initialize_symbol_from_state(struct gl_program
*prog
,
120 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
122 static int initialize_symbol_from_param(struct gl_program
*prog
,
123 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
125 static int initialize_symbol_from_const(struct gl_program
*prog
,
126 struct asm_symbol
*param_var
, const struct asm_vector
*vec
,
127 GLboolean allowSwizzle
);
129 static int yyparse(struct asm_parser_state
*state
);
131 static char *make_error_string(const char *fmt
, ...);
133 static void yyerror(struct YYLTYPE
*locp
, struct asm_parser_state
*state
,
136 static int validate_inputs(struct YYLTYPE
*locp
,
137 struct asm_parser_state
*state
);
139 static void init_dst_reg(struct prog_dst_register
*r
);
141 static void set_dst_reg(struct prog_dst_register
*r
,
142 gl_register_file file
, GLint index
);
144 static void init_src_reg(struct asm_src_register
*r
);
146 static void set_src_reg(struct asm_src_register
*r
,
147 gl_register_file file
, GLint index
);
149 static void set_src_reg_swz(struct asm_src_register
*r
,
150 gl_register_file file
, GLint index
, GLuint swizzle
);
152 static void asm_instruction_set_operands(struct asm_instruction
*inst
,
153 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
154 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
156 static struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
157 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
158 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
160 static struct asm_instruction
*asm_instruction_copy_ctor(
161 const struct prog_instruction
*base
, const struct prog_dst_register
*dst
,
162 const struct asm_src_register
*src0
, const struct asm_src_register
*src1
,
163 const struct asm_src_register
*src2
);
167 #define TRUE (!FALSE)
170 #define YYLLOC_DEFAULT(Current, Rhs, N) \
173 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
174 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
175 (Current).position = YYRHSLOC(Rhs, 1).position; \
176 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
177 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
179 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
180 (Current).last_line = (Current).first_line; \
181 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
182 (Current).last_column = (Current).first_column; \
183 (Current).position = YYRHSLOC(Rhs, 0).position \
184 + (Current).first_column; \
188 #define YYLEX_PARAM state->scanner
191 /* Line 189 of yacc.c */
192 #line 193 "program_parse.tab.c"
194 /* Enabling traces. */
199 /* Enabling verbose error messages. */
200 #ifdef YYERROR_VERBOSE
201 # undef YYERROR_VERBOSE
202 # define YYERROR_VERBOSE 1
204 # define YYERROR_VERBOSE 1
207 /* Enabling the token table. */
208 #ifndef YYTOKEN_TABLE
209 # define YYTOKEN_TABLE 0
216 /* Put the tokens into the symbol table, so that GDB and other debuggers
307 TEX_SHADOWRECT
= 346,
310 TEX_ARRAYSHADOW1D
= 349,
311 TEX_ARRAYSHADOW2D
= 350,
316 USED_IDENTIFIER
= 355,
329 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
330 typedef union YYSTYPE
333 /* Line 214 of yacc.c */
334 #line 126 "program_parse.y"
336 struct asm_instruction
*inst
;
337 struct asm_symbol
*sym
;
338 struct asm_symbol temp_sym
;
339 struct asm_swizzle_mask swiz_mask
;
340 struct asm_src_register src_reg
;
341 struct prog_dst_register dst_reg
;
342 struct prog_instruction temp_inst
;
348 gl_state_index state
[STATE_LENGTH
];
350 struct asm_vector vector
;
351 gl_inst_opcode opcode
;
355 unsigned rgba_valid
:1;
356 unsigned xyzw_valid
:1;
362 /* Line 214 of yacc.c */
363 #line 364 "program_parse.tab.c"
365 # define YYSTYPE_IS_TRIVIAL 1
366 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
367 # define YYSTYPE_IS_DECLARED 1
370 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
371 typedef struct YYLTYPE
378 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
379 # define YYLTYPE_IS_DECLARED 1
380 # define YYLTYPE_IS_TRIVIAL 1
384 /* Copy the second part of user declarations. */
386 /* Line 264 of yacc.c */
387 #line 271 "program_parse.y"
389 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
393 /* Line 264 of yacc.c */
394 #line 395 "program_parse.tab.c"
401 typedef YYTYPE_UINT8 yytype_uint8
;
403 typedef unsigned char yytype_uint8
;
407 typedef YYTYPE_INT8 yytype_int8
;
408 #elif (defined __STDC__ || defined __C99__FUNC__ \
409 || defined __cplusplus || defined _MSC_VER)
410 typedef signed char yytype_int8
;
412 typedef short int yytype_int8
;
416 typedef YYTYPE_UINT16 yytype_uint16
;
418 typedef unsigned short int yytype_uint16
;
422 typedef YYTYPE_INT16 yytype_int16
;
424 typedef short int yytype_int16
;
428 # ifdef __SIZE_TYPE__
429 # define YYSIZE_T __SIZE_TYPE__
430 # elif defined size_t
431 # define YYSIZE_T size_t
432 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
433 || defined __cplusplus || defined _MSC_VER)
434 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
435 # define YYSIZE_T size_t
437 # define YYSIZE_T unsigned int
441 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
446 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
447 # define YY_(msgid) dgettext ("bison-runtime", msgid)
451 # define YY_(msgid) msgid
455 /* Suppress unused-variable warnings by "using" E. */
456 #if ! defined lint || defined __GNUC__
457 # define YYUSE(e) ((void) (e))
459 # define YYUSE(e) /* empty */
462 /* Identity function, used to suppress warnings about constant conditions. */
466 #if (defined __STDC__ || defined __C99__FUNC__ \
467 || defined __cplusplus || defined _MSC_VER)
480 #if ! defined yyoverflow || YYERROR_VERBOSE
482 /* The parser invokes alloca or malloc; define the necessary symbols. */
484 # ifdef YYSTACK_USE_ALLOCA
485 # if YYSTACK_USE_ALLOCA
487 # define YYSTACK_ALLOC __builtin_alloca
488 # elif defined __BUILTIN_VA_ARG_INCR
489 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
491 # define YYSTACK_ALLOC __alloca
492 # elif defined _MSC_VER
493 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
494 # define alloca _alloca
496 # define YYSTACK_ALLOC alloca
497 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
498 || defined __cplusplus || defined _MSC_VER)
499 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
508 # ifdef YYSTACK_ALLOC
509 /* Pacify GCC's `empty if-body' warning. */
510 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
511 # ifndef YYSTACK_ALLOC_MAXIMUM
512 /* The OS might guarantee only one guard page at the bottom of the stack,
513 and a page size can be as small as 4096 bytes. So we cannot safely
514 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
515 to allow for a few compiler-allocated temporary stack slots. */
516 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
519 # define YYSTACK_ALLOC YYMALLOC
520 # define YYSTACK_FREE YYFREE
521 # ifndef YYSTACK_ALLOC_MAXIMUM
522 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
524 # if (defined __cplusplus && ! defined _STDLIB_H \
525 && ! ((defined YYMALLOC || defined malloc) \
526 && (defined YYFREE || defined free)))
527 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
533 # define YYMALLOC malloc
534 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
535 || defined __cplusplus || defined _MSC_VER)
536 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
541 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
542 || defined __cplusplus || defined _MSC_VER)
543 void free (void *); /* INFRINGES ON USER NAME SPACE */
547 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
550 #if (! defined yyoverflow \
551 && (! defined __cplusplus \
552 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
553 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
555 /* A type that is properly aligned for any stack member. */
558 yytype_int16 yyss_alloc
;
563 /* The size of the maximum gap between one aligned stack and the next. */
564 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
566 /* The size of an array large to enough to hold all stacks, each with
568 # define YYSTACK_BYTES(N) \
569 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
570 + 2 * YYSTACK_GAP_MAXIMUM)
572 /* Copy COUNT objects from FROM to TO. The source and destination do
575 # if defined __GNUC__ && 1 < __GNUC__
576 # define YYCOPY(To, From, Count) \
577 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
579 # define YYCOPY(To, From, Count) \
583 for (yyi = 0; yyi < (Count); yyi++) \
584 (To)[yyi] = (From)[yyi]; \
590 /* Relocate STACK from its old location to the new one. The
591 local variables YYSIZE and YYSTACKSIZE give the old and new number of
592 elements in the stack, and YYPTR gives the new location of the
593 stack. Advance YYPTR to a properly aligned location for the next
595 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
598 YYSIZE_T yynewbytes; \
599 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
600 Stack = &yyptr->Stack_alloc; \
601 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
602 yyptr += yynewbytes / sizeof (*yyptr); \
608 /* YYFINAL -- State number of the termination state. */
610 /* YYLAST -- Last index in YYTABLE. */
613 /* YYNTOKENS -- Number of terminals. */
614 #define YYNTOKENS 120
615 /* YYNNTS -- Number of nonterminals. */
617 /* YYNRULES -- Number of rules. */
619 /* YYNRULES -- Number of states. */
620 #define YYNSTATES 475
622 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
624 #define YYMAXUTOK 362
626 #define YYTRANSLATE(YYX) \
627 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
629 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
630 static const yytype_uint8 yytranslate
[] =
632 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 115, 116, 2, 113, 109, 114, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 108,
638 2, 117, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 111, 2, 112, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 118, 110, 119, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
658 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
659 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
660 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
661 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
662 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
663 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
664 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
665 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
666 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
667 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
672 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
674 static const yytype_uint16 yyprhs
[] =
676 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
677 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
678 46, 48, 50, 52, 54, 59, 64, 69, 76, 83,
679 92, 101, 104, 107, 120, 123, 125, 127, 129, 131,
680 133, 135, 137, 139, 141, 143, 145, 147, 154, 157,
681 162, 165, 167, 171, 177, 181, 184, 192, 195, 197,
682 199, 201, 203, 208, 210, 212, 214, 216, 218, 220,
683 222, 226, 227, 230, 233, 235, 237, 239, 241, 243,
684 245, 247, 249, 251, 252, 254, 256, 258, 260, 261,
685 265, 269, 270, 273, 276, 278, 280, 282, 284, 286,
686 288, 290, 292, 297, 300, 303, 305, 308, 310, 313,
687 315, 318, 323, 328, 330, 331, 335, 337, 339, 342,
688 344, 347, 349, 351, 355, 362, 363, 365, 368, 373,
689 375, 379, 381, 383, 385, 387, 389, 391, 393, 395,
690 397, 399, 402, 405, 408, 411, 414, 417, 420, 423,
691 426, 429, 432, 435, 439, 441, 443, 445, 451, 453,
692 455, 457, 460, 462, 464, 467, 469, 472, 479, 481,
693 485, 487, 489, 491, 493, 495, 500, 502, 504, 506,
694 508, 510, 512, 515, 517, 519, 525, 527, 530, 532,
695 534, 540, 543, 544, 551, 555, 556, 558, 560, 562,
696 564, 566, 569, 571, 573, 576, 581, 586, 587, 591,
697 593, 595, 597, 600, 602, 604, 606, 608, 614, 616,
698 620, 626, 632, 634, 638, 644, 646, 648, 650, 652,
699 654, 656, 658, 660, 662, 666, 672, 680, 690, 693,
700 696, 698, 700, 701, 702, 707, 709, 710, 711, 715,
701 719, 721, 727, 730, 733, 736, 739, 743, 746, 750,
702 751, 753, 755, 756, 758, 760, 761, 763, 765, 766,
703 768, 770, 771, 775, 776, 780, 781, 785, 787, 789,
707 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
708 static const yytype_int16 yyrhs
[] =
710 121, 0, -1, 122, 123, 125, 12, -1, 3, -1,
711 4, -1, 123, 124, -1, -1, 8, 262, 108, -1,
712 125, 126, -1, -1, 127, 108, -1, 170, 108, -1,
713 128, -1, 129, -1, 130, -1, 131, -1, 132, -1,
714 133, -1, 134, -1, 135, -1, 141, -1, 136, -1,
715 137, -1, 138, -1, 19, 146, 109, 142, -1, 18,
716 145, 109, 144, -1, 16, 145, 109, 142, -1, 14,
717 145, 109, 142, 109, 142, -1, 13, 145, 109, 144,
718 109, 144, -1, 17, 145, 109, 144, 109, 144, 109,
719 144, -1, 15, 145, 109, 144, 109, 139, 109, 140,
720 -1, 20, 144, -1, 20, 166, -1, 22, 145, 109,
721 144, 109, 144, 109, 144, 109, 139, 109, 140, -1,
722 83, 256, -1, 84, -1, 85, -1, 86, -1, 87,
723 -1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
724 -1, 93, -1, 94, -1, 95, -1, 21, 145, 109,
725 150, 109, 147, -1, 241, 143, -1, 241, 110, 143,
726 110, -1, 150, 162, -1, 238, -1, 241, 150, 163,
727 -1, 241, 110, 150, 163, 110, -1, 151, 164, 165,
728 -1, 159, 161, -1, 148, 109, 148, 109, 148, 109,
729 148, -1, 241, 149, -1, 23, -1, 262, -1, 100,
730 -1, 172, -1, 152, 111, 153, 112, -1, 186, -1,
731 249, -1, 100, -1, 100, -1, 154, -1, 155, -1,
732 23, -1, 159, 160, 156, -1, -1, 113, 157, -1,
733 114, 158, -1, 23, -1, 23, -1, 100, -1, 104,
734 -1, 104, -1, 104, -1, 104, -1, 101, -1, 105,
735 -1, -1, 101, -1, 102, -1, 103, -1, 104, -1,
736 -1, 115, 166, 116, -1, 115, 167, 116, -1, -1,
737 168, 163, -1, 169, 163, -1, 99, -1, 100, -1,
738 171, -1, 178, -1, 242, -1, 245, -1, 248, -1,
739 261, -1, 7, 99, 117, 172, -1, 96, 173, -1,
740 38, 177, -1, 60, -1, 98, 175, -1, 53, -1,
741 29, 254, -1, 37, -1, 74, 255, -1, 50, 111,
742 176, 112, -1, 97, 111, 174, 112, -1, 23, -1,
743 -1, 111, 176, 112, -1, 23, -1, 60, -1, 29,
744 254, -1, 37, -1, 74, 255, -1, 179, -1, 180,
745 -1, 10, 99, 182, -1, 10, 99, 111, 181, 112,
746 183, -1, -1, 23, -1, 117, 185, -1, 117, 118,
747 184, 119, -1, 187, -1, 184, 109, 187, -1, 189,
748 -1, 225, -1, 235, -1, 189, -1, 225, -1, 236,
749 -1, 188, -1, 226, -1, 235, -1, 189, -1, 73,
750 213, -1, 73, 190, -1, 73, 192, -1, 73, 195,
751 -1, 73, 197, -1, 73, 203, -1, 73, 199, -1,
752 73, 206, -1, 73, 208, -1, 73, 210, -1, 73,
753 212, -1, 73, 224, -1, 47, 253, 191, -1, 201,
754 -1, 33, -1, 69, -1, 43, 111, 202, 112, 193,
755 -1, 201, -1, 60, -1, 26, -1, 72, 194, -1,
756 40, -1, 32, -1, 44, 196, -1, 25, -1, 253,
757 67, -1, 45, 111, 202, 112, 253, 198, -1, 201,
758 -1, 75, 257, 200, -1, 29, -1, 25, -1, 31,
759 -1, 71, -1, 23, -1, 76, 255, 204, 205, -1,
760 35, -1, 54, -1, 79, -1, 80, -1, 78, -1,
761 77, -1, 36, 207, -1, 29, -1, 56, -1, 28,
762 111, 209, 112, 57, -1, 23, -1, 58, 211, -1,
763 70, -1, 26, -1, 215, 66, 111, 218, 112, -1,
764 215, 214, -1, -1, 66, 111, 218, 106, 218, 112,
765 -1, 49, 219, 216, -1, -1, 217, -1, 41, -1,
766 82, -1, 42, -1, 23, -1, 51, 220, -1, 63,
767 -1, 52, -1, 81, 255, -1, 55, 111, 222, 112,
768 -1, 48, 111, 223, 112, -1, -1, 111, 221, 112,
769 -1, 23, -1, 23, -1, 23, -1, 30, 64, -1,
770 229, -1, 232, -1, 227, -1, 230, -1, 62, 34,
771 111, 228, 112, -1, 233, -1, 233, 106, 233, -1,
772 62, 34, 111, 233, 112, -1, 62, 46, 111, 231,
773 112, -1, 234, -1, 234, 106, 234, -1, 62, 46,
774 111, 234, 112, -1, 23, -1, 23, -1, 237, -1,
775 239, -1, 238, -1, 239, -1, 240, -1, 24, -1,
776 23, -1, 118, 240, 119, -1, 118, 240, 109, 240,
777 119, -1, 118, 240, 109, 240, 109, 240, 119, -1,
778 118, 240, 109, 240, 109, 240, 109, 240, 119, -1,
779 241, 24, -1, 241, 23, -1, 113, -1, 114, -1,
780 -1, -1, 244, 11, 243, 247, -1, 262, -1, -1,
781 -1, 5, 246, 247, -1, 247, 109, 99, -1, 99,
782 -1, 244, 9, 99, 117, 249, -1, 65, 60, -1,
783 65, 37, -1, 65, 250, -1, 65, 59, -1, 65,
784 74, 255, -1, 65, 30, -1, 29, 251, 252, -1,
785 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
786 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
787 -1, 111, 258, 112, -1, -1, 111, 259, 112, -1,
788 -1, 111, 260, 112, -1, 23, -1, 23, -1, 23,
789 -1, 6, 99, 117, 100, -1, 99, -1, 100, -1
792 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
793 static const yytype_uint16 yyrline
[] =
795 0, 278, 278, 281, 289, 301, 302, 305, 329, 330,
796 333, 348, 351, 356, 363, 364, 365, 366, 367, 368,
797 369, 372, 373, 374, 377, 383, 389, 395, 402, 408,
798 415, 459, 464, 474, 518, 524, 525, 526, 527, 528,
799 529, 530, 531, 532, 533, 534, 535, 538, 550, 558,
800 575, 582, 601, 612, 632, 657, 664, 697, 704, 719,
801 774, 817, 826, 848, 858, 862, 891, 910, 910, 912,
802 919, 931, 932, 933, 936, 950, 964, 984, 995, 1007,
803 1009, 1010, 1011, 1012, 1015, 1015, 1015, 1015, 1016, 1019,
804 1023, 1028, 1035, 1042, 1049, 1072, 1095, 1096, 1097, 1098,
805 1099, 1100, 1103, 1122, 1126, 1132, 1136, 1140, 1144, 1153,
806 1162, 1166, 1171, 1177, 1188, 1188, 1189, 1191, 1195, 1199,
807 1203, 1209, 1209, 1211, 1229, 1255, 1258, 1269, 1275, 1281,
808 1282, 1289, 1295, 1301, 1309, 1315, 1321, 1329, 1335, 1341,
809 1349, 1350, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360,
810 1361, 1362, 1363, 1366, 1375, 1379, 1383, 1389, 1398, 1402,
811 1406, 1415, 1419, 1425, 1431, 1438, 1443, 1451, 1461, 1463,
812 1471, 1477, 1481, 1485, 1491, 1502, 1511, 1515, 1520, 1524,
813 1528, 1532, 1538, 1545, 1549, 1555, 1563, 1574, 1581, 1585,
814 1591, 1601, 1612, 1616, 1634, 1643, 1646, 1652, 1656, 1660,
815 1666, 1677, 1682, 1687, 1692, 1697, 1702, 1710, 1713, 1718,
816 1731, 1739, 1750, 1758, 1758, 1760, 1760, 1762, 1772, 1777,
817 1784, 1794, 1803, 1808, 1815, 1825, 1835, 1847, 1847, 1848,
818 1848, 1850, 1860, 1868, 1878, 1886, 1894, 1903, 1914, 1918,
819 1924, 1925, 1926, 1929, 1929, 1932, 1967, 1971, 1971, 1974,
820 1981, 1990, 2004, 2013, 2022, 2026, 2035, 2044, 2055, 2062,
821 2067, 2076, 2088, 2091, 2100, 2111, 2112, 2113, 2116, 2117,
822 2118, 2121, 2122, 2125, 2126, 2129, 2130, 2133, 2144, 2155,
827 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
828 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
829 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
830 static const char *const yytname
[] =
832 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
833 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
834 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
835 "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION",
836 "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION",
837 "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
838 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
839 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
840 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE",
841 "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
842 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK", "SPECULAR", "SPOT",
843 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
844 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
845 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D",
846 "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D",
847 "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB",
848 "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2",
849 "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'",
850 "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program",
851 "language", "optionSequence", "option", "statementSequence", "statement",
852 "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction",
853 "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction",
854 "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction",
855 "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget",
856 "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg",
857 "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp",
858 "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem",
859 "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset",
860 "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent",
861 "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask",
862 "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2",
863 "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem",
864 "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem",
865 "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt",
866 "optArraySize", "paramSingleInit", "paramMultipleInit",
867 "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse",
868 "paramMultipleItem", "stateMultipleItem", "stateSingleItem",
869 "stateMaterialItem", "stateMatProperty", "stateLightItem",
870 "stateLightProperty", "stateSpotProperty", "stateLightModelItem",
871 "stateLModProperty", "stateLightProdItem", "stateLProdProperty",
872 "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty",
873 "stateLightNumber", "stateTexGenItem", "stateTexGenType",
874 "stateTexGenCoord", "stateFogItem", "stateFogProperty",
875 "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem",
876 "statePointProperty", "stateMatrixRow", "stateMatrixRows",
877 "optMatrixRows", "stateMatrixItem", "stateOptMatModifier",
878 "stateMatModifier", "stateMatrixRowNum", "stateMatrixName",
879 "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum",
880 "stateProgramMatNum", "stateDepthItem", "programSingleItem",
881 "programMultipleItem", "progEnvParams", "progEnvParamNums",
882 "progEnvParam", "progLocalParams", "progLocalParamNums",
883 "progLocalParam", "progEnvParamNum", "progLocalParamNum",
884 "paramConstDecl", "paramConstUse", "paramConstScalarDecl",
885 "paramConstScalarUse", "paramConstVector", "signedFloatConstant",
886 "optionalSign", "TEMP_statement", "@1", "optVarSize",
887 "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement",
888 "resultBinding", "resultColBinding", "optResultFaceType",
889 "optResultColorType", "optFaceType", "optColorType",
890 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
891 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
892 "ALIAS_statement", "string", 0
897 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
899 static const yytype_uint16 yytoknum
[] =
901 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
902 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
903 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
904 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
905 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
906 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
907 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
908 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
909 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
910 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
911 355, 356, 357, 358, 359, 360, 361, 362, 59, 44,
912 124, 91, 93, 43, 45, 40, 41, 61, 123, 125
916 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
917 static const yytype_uint16 yyr1
[] =
919 0, 120, 121, 122, 122, 123, 123, 124, 125, 125,
920 126, 126, 127, 127, 128, 128, 128, 128, 128, 128,
921 128, 129, 129, 129, 130, 131, 132, 133, 134, 135,
922 136, 137, 137, 138, 139, 140, 140, 140, 140, 140,
923 140, 140, 140, 140, 140, 140, 140, 141, 142, 142,
924 143, 143, 144, 144, 145, 146, 147, 148, 149, 149,
925 150, 150, 150, 150, 151, 151, 152, 153, 153, 154,
926 155, 156, 156, 156, 157, 158, 159, 160, 161, 162,
927 163, 163, 163, 163, 164, 164, 164, 164, 164, 165,
928 165, 165, 166, 167, 168, 169, 170, 170, 170, 170,
929 170, 170, 171, 172, 172, 173, 173, 173, 173, 173,
930 173, 173, 173, 174, 175, 175, 176, 177, 177, 177,
931 177, 178, 178, 179, 180, 181, 181, 182, 183, 184,
932 184, 185, 185, 185, 186, 186, 186, 187, 187, 187,
933 188, 188, 189, 189, 189, 189, 189, 189, 189, 189,
934 189, 189, 189, 190, 191, 191, 191, 192, 193, 193,
935 193, 193, 193, 194, 195, 196, 196, 197, 198, 199,
936 200, 201, 201, 201, 202, 203, 204, 204, 205, 205,
937 205, 205, 206, 207, 207, 208, 209, 210, 211, 211,
938 212, 213, 214, 214, 215, 216, 216, 217, 217, 217,
939 218, 219, 219, 219, 219, 219, 219, 220, 220, 221,
940 222, 223, 224, 225, 225, 226, 226, 227, 228, 228,
941 229, 230, 231, 231, 232, 233, 234, 235, 235, 236,
942 236, 237, 238, 238, 239, 239, 239, 239, 240, 240,
943 241, 241, 241, 243, 242, 244, 244, 246, 245, 247,
944 247, 248, 249, 249, 249, 249, 249, 249, 250, 251,
945 251, 251, 252, 252, 252, 253, 253, 253, 254, 254,
946 254, 255, 255, 256, 256, 257, 257, 258, 259, 260,
950 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
951 static const yytype_uint8 yyr2
[] =
953 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
954 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
955 1, 1, 1, 1, 4, 4, 4, 6, 6, 8,
956 8, 2, 2, 12, 2, 1, 1, 1, 1, 1,
957 1, 1, 1, 1, 1, 1, 1, 6, 2, 4,
958 2, 1, 3, 5, 3, 2, 7, 2, 1, 1,
959 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
960 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
961 1, 1, 1, 0, 1, 1, 1, 1, 0, 3,
962 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
963 1, 1, 4, 2, 2, 1, 2, 1, 2, 1,
964 2, 4, 4, 1, 0, 3, 1, 1, 2, 1,
965 2, 1, 1, 3, 6, 0, 1, 2, 4, 1,
966 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
967 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
968 2, 2, 2, 3, 1, 1, 1, 5, 1, 1,
969 1, 2, 1, 1, 2, 1, 2, 6, 1, 3,
970 1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
971 1, 1, 2, 1, 1, 5, 1, 2, 1, 1,
972 5, 2, 0, 6, 3, 0, 1, 1, 1, 1,
973 1, 2, 1, 1, 2, 4, 4, 0, 3, 1,
974 1, 1, 2, 1, 1, 1, 1, 5, 1, 3,
975 5, 5, 1, 3, 5, 1, 1, 1, 1, 1,
976 1, 1, 1, 1, 3, 5, 7, 9, 2, 2,
977 1, 1, 0, 0, 4, 1, 0, 0, 3, 3,
978 1, 5, 2, 2, 2, 2, 3, 2, 3, 0,
979 1, 1, 0, 1, 1, 0, 1, 1, 0, 1,
980 1, 0, 3, 0, 3, 0, 3, 1, 1, 1,
984 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
985 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
986 means the default is an error. */
987 static const yytype_uint16 yydefact
[] =
989 0, 3, 4, 0, 6, 1, 9, 0, 5, 246,
990 281, 282, 0, 247, 0, 0, 0, 2, 0, 0,
991 0, 0, 0, 0, 0, 242, 0, 0, 8, 0,
992 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
993 23, 20, 0, 96, 97, 121, 122, 98, 0, 99,
994 100, 101, 245, 7, 0, 0, 0, 0, 0, 65,
995 0, 88, 64, 0, 0, 0, 0, 0, 76, 0,
996 0, 94, 240, 241, 31, 32, 83, 0, 0, 0,
997 10, 11, 0, 243, 250, 248, 0, 0, 125, 242,
998 123, 259, 257, 253, 255, 252, 271, 254, 242, 84,
999 85, 86, 87, 91, 242, 242, 242, 242, 242, 242,
1000 78, 55, 81, 80, 82, 92, 233, 232, 0, 0,
1001 0, 0, 60, 0, 242, 83, 0, 61, 63, 134,
1002 135, 213, 214, 136, 229, 230, 0, 242, 0, 0,
1003 0, 280, 102, 126, 0, 127, 131, 132, 133, 227,
1004 228, 231, 0, 261, 260, 262, 0, 256, 0, 0,
1005 54, 0, 0, 0, 26, 0, 25, 24, 268, 119,
1006 117, 271, 104, 0, 0, 0, 0, 0, 0, 265,
1007 0, 265, 0, 0, 275, 271, 142, 143, 144, 145,
1008 147, 146, 148, 149, 150, 151, 0, 152, 268, 109,
1009 0, 107, 105, 271, 0, 114, 103, 83, 0, 52,
1010 0, 0, 0, 0, 244, 249, 0, 239, 238, 263,
1011 264, 258, 277, 0, 242, 95, 0, 0, 83, 242,
1012 0, 48, 0, 51, 0, 242, 269, 270, 118, 120,
1013 0, 0, 0, 212, 183, 184, 182, 0, 165, 267,
1014 266, 164, 0, 0, 0, 0, 207, 203, 0, 202,
1015 271, 195, 189, 188, 187, 0, 0, 0, 0, 108,
1016 0, 110, 0, 0, 106, 0, 242, 234, 69, 0,
1017 67, 68, 0, 242, 242, 251, 0, 124, 272, 28,
1018 89, 90, 93, 27, 0, 79, 50, 273, 0, 0,
1019 225, 0, 226, 0, 186, 0, 174, 0, 166, 0,
1020 171, 172, 155, 156, 173, 153, 154, 0, 0, 201,
1021 0, 204, 197, 199, 198, 194, 196, 279, 0, 170,
1022 169, 176, 177, 0, 0, 116, 0, 113, 0, 0,
1023 53, 0, 62, 77, 71, 47, 0, 0, 0, 242,
1024 49, 0, 34, 0, 242, 220, 224, 0, 0, 265,
1025 211, 0, 209, 0, 210, 0, 276, 181, 180, 178,
1026 179, 175, 200, 0, 111, 112, 115, 242, 235, 0,
1027 0, 70, 242, 58, 57, 59, 242, 0, 0, 0,
1028 129, 137, 140, 138, 215, 216, 139, 278, 0, 35,
1029 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
1030 46, 30, 29, 185, 160, 162, 159, 0, 157, 158,
1031 0, 206, 208, 205, 190, 0, 74, 72, 75, 73,
1032 0, 0, 0, 0, 141, 192, 242, 128, 274, 163,
1033 161, 167, 168, 242, 236, 242, 0, 0, 0, 0,
1034 191, 130, 0, 0, 0, 0, 218, 0, 222, 0,
1035 237, 242, 0, 217, 0, 221, 0, 0, 56, 33,
1039 /* YYDEFGOTO[NTERM-NUM]. */
1040 static const yytype_int16 yydefgoto
[] =
1042 -1, 3, 4, 6, 8, 9, 28, 29, 30, 31,
1043 32, 33, 34, 35, 36, 37, 38, 39, 40, 298,
1044 411, 41, 161, 231, 74, 60, 69, 345, 346, 384,
1045 232, 61, 126, 279, 280, 281, 381, 427, 429, 70,
1046 344, 111, 296, 115, 103, 160, 75, 227, 76, 228,
1047 42, 43, 127, 206, 338, 274, 336, 172, 44, 45,
1048 46, 144, 90, 287, 389, 145, 128, 390, 391, 129,
1049 186, 315, 187, 418, 440, 188, 251, 189, 441, 190,
1050 330, 316, 307, 191, 333, 371, 192, 246, 193, 305,
1051 194, 264, 195, 434, 450, 196, 325, 326, 373, 261,
1052 319, 363, 365, 361, 197, 130, 393, 394, 455, 131,
1053 395, 457, 132, 301, 303, 396, 133, 149, 134, 135,
1054 151, 77, 47, 139, 48, 49, 54, 85, 50, 62,
1055 97, 155, 221, 252, 238, 157, 352, 266, 223, 398,
1059 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1061 #define YYPACT_NINF -401
1062 static const yytype_int16 yypact
[] =
1064 193, -401, -401, 27, -401, -401, 62, 143, -401, 24,
1065 -401, -401, -30, -401, -18, 12, 83, -401, 15, 15,
1066 15, 15, 15, 15, 67, 61, 15, 15, -401, 127,
1067 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1068 -401, -401, 144, -401, -401, -401, -401, -401, 204, -401,
1069 -401, -401, -401, -401, 155, 136, 138, 34, 140, -401,
1070 147, 108, -401, 150, 156, 157, 158, 160, -401, 162,
1071 159, -401, -401, -401, -401, -401, 102, -13, 163, 164,
1072 -401, -401, 165, -401, -401, 166, 170, 10, 235, 0,
1073 -401, 141, -401, -401, -401, -401, 167, -401, 131, -401,
1074 -401, -401, -401, 168, 131, 131, 131, 131, 131, 131,
1075 -401, -401, -401, -401, -401, -401, -401, -401, 104, 97,
1076 114, 38, 169, 30, 131, 102, 171, -401, -401, -401,
1077 -401, -401, -401, -401, -401, -401, 30, 131, 172, 155,
1078 175, -401, -401, -401, 173, -401, -401, -401, -401, -401,
1079 -401, -401, 223, -401, -401, 123, 253, -401, 177, 149,
1080 -401, 178, -10, 181, -401, 182, -401, -401, 134, -401,
1081 -401, 167, -401, 183, 184, 185, 213, 99, 186, 154,
1082 187, 146, 153, 7, 188, 167, -401, -401, -401, -401,
1083 -401, -401, -401, -401, -401, -401, 215, -401, 134, -401,
1084 190, -401, -401, 167, 191, 192, -401, 102, -48, -401,
1085 1, 195, 196, 214, 166, -401, 189, -401, -401, -401,
1086 -401, -401, -401, 180, 131, -401, 194, 197, 102, 131,
1087 30, -401, 203, 205, 201, 131, -401, -401, -401, -401,
1088 285, 288, 289, -401, -401, -401, -401, 291, -401, -401,
1089 -401, -401, 248, 291, 33, 206, 207, -401, 208, -401,
1090 167, 14, -401, -401, -401, 293, 292, 92, 209, -401,
1091 299, -401, 301, 299, -401, 216, 131, -401, -401, 217,
1092 -401, -401, 221, 131, 131, -401, 212, -401, -401, -401,
1093 -401, -401, -401, -401, 218, -401, -401, 220, 224, 225,
1094 -401, 226, -401, 227, -401, 228, -401, 230, -401, 231,
1095 -401, -401, -401, -401, -401, -401, -401, 304, 309, -401,
1096 312, -401, -401, -401, -401, -401, -401, -401, 232, -401,
1097 -401, -401, -401, 161, 313, -401, 233, -401, 234, 238,
1098 -401, 13, -401, -401, 137, -401, 242, -15, 243, 3,
1099 -401, 314, -401, 133, 131, -401, -401, 296, 94, 146,
1100 -401, 245, -401, 246, -401, 247, -401, -401, -401, -401,
1101 -401, -401, -401, 249, -401, -401, -401, 131, -401, 332,
1102 337, -401, 131, -401, -401, -401, 131, 142, 114, 28,
1103 -401, -401, -401, -401, -401, -401, -401, -401, 250, -401,
1104 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1105 -401, -401, -401, -401, -401, -401, -401, 331, -401, -401,
1106 68, -401, -401, -401, -401, 43, -401, -401, -401, -401,
1107 255, 256, 257, 258, -401, 300, 3, -401, -401, -401,
1108 -401, -401, -401, 131, -401, 131, 201, 285, 288, 259,
1109 -401, -401, 252, 264, 265, 263, 261, 266, 270, 313,
1110 -401, 131, 133, -401, 285, -401, 288, 80, -401, -401,
1111 -401, -401, 313, 267, -401
1114 /* YYPGOTO[NTERM-NUM]. */
1115 static const yytype_int16 yypgoto
[] =
1117 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1118 -401, -401, -401, -401, -401, -401, -401, -401, -401, -69,
1119 -82, -401, -100, 151, -86, 210, -401, -401, -366, -401,
1120 -54, -401, -401, -401, -401, -401, -401, -401, -401, 174,
1121 -401, -401, -401, -118, -401, -401, 229, -401, -401, -401,
1122 -401, -401, 295, -401, -401, -401, 110, -401, -401, -401,
1123 -401, -401, -401, -401, -401, -401, -401, -51, -401, -88,
1124 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1125 -401, -311, 139, -401, -401, -401, -401, -401, -401, -401,
1126 -401, -401, -401, -401, -401, -2, -401, -401, -400, -401,
1127 -401, -401, -401, -401, -401, 298, -401, -401, -401, -401,
1128 -401, -401, -401, -390, -295, 302, -401, -401, -136, -87,
1129 -120, -89, -401, -401, -401, -401, -401, 251, -401, 176,
1130 -401, -401, -401, -176, 198, -153, -401, -401, -401, -401,
1134 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1135 positive, shift that token. If negative, reduce the rule which
1136 number is the opposite. If zero, do what YYDEFACT says.
1137 If YYTABLE_NINF, syntax error. */
1138 #define YYTABLE_NINF -230
1139 static const yytype_int16 yytable
[] =
1141 152, 146, 150, 52, 208, 254, 164, 209, 383, 167,
1142 116, 117, 158, 116, 117, 162, 430, 162, 239, 163,
1143 162, 165, 166, 125, 278, 118, 233, 5, 118, 13,
1144 14, 15, 267, 262, 16, 152, 17, 18, 19, 20,
1145 21, 22, 23, 24, 25, 26, 27, 419, 118, 119,
1146 271, 212, 119, 116, 117, 322, 323, 456, 310, 467,
1147 120, 276, 119, 120, 311, 387, 312, 198, 118, 207,
1148 7, 277, 473, 120, 470, 199, 388, 263, 53, 453,
1149 58, 55, 211, 121, 10, 11, 121, 122, 200, 275,
1150 122, 201, 119, 310, 233, 468, 324, 123, 202, 311,
1151 230, 68, 313, 120, 314, 124, 121, 321, 124, 442,
1152 292, 56, 203, 72, 73, 59, 72, 73, 124, 310,
1153 414, 124, 377, 10, 11, 311, 121, 331, 244, 293,
1154 122, 173, 378, 168, 415, 204, 205, 436, 289, 314,
1155 162, 169, 175, 174, 176, 88, 332, 437, 124, 299,
1156 177, 89, 443, 458, 416, 245, 341, 178, 179, 180,
1157 71, 181, 444, 182, 170, 314, 417, 68, 153, 91,
1158 92, 471, 183, 249, 72, 73, 432, 93, 171, 248,
1159 154, 249, 57, 420, 219, 250, 472, 152, 433, 184,
1160 185, 220, 424, 250, 347, 236, 1, 2, 348, 94,
1161 95, 255, 237, 112, 256, 257, 113, 114, 258, 99,
1162 100, 101, 102, 82, 96, 83, 259, 399, 400, 401,
1163 402, 403, 404, 405, 406, 407, 408, 409, 410, 63,
1164 64, 65, 66, 67, 260, 80, 78, 79, 367, 368,
1165 369, 370, 10, 11, 72, 73, 217, 218, 71, 225,
1166 379, 380, 81, 86, 84, 87, 98, 425, 143, 104,
1167 152, 392, 150, 110, 138, 105, 106, 107, 412, 108,
1168 141, 109, 136, 137, 215, 140, 222, 243, 156, 58,
1169 -66, 268, 210, 159, 297, 216, 224, 229, 152, 213,
1170 234, 235, 288, 347, 240, 241, 242, 247, 253, 265,
1171 431, 270, 272, 273, 283, 284, 286, 295, 300, -229,
1172 290, 302, 304, 291, 306, 308, 327, 317, 318, 320,
1173 334, 329, 335, 452, 337, 343, 340, 360, 350, 342,
1174 349, 351, 362, 353, 354, 364, 372, 397, 355, 356,
1175 357, 385, 358, 359, 366, 374, 375, 152, 392, 150,
1176 376, 382, 386, 413, 152, 426, 347, 421, 422, 423,
1177 428, 424, 438, 439, 445, 446, 449, 464, 447, 448,
1178 459, 460, 347, 461, 462, 463, 466, 454, 465, 474,
1179 469, 294, 142, 339, 282, 451, 435, 147, 226, 285,
1180 214, 148, 309, 0, 0, 0, 269
1183 static const yytype_int16 yycheck
[] =
1185 89, 89, 89, 9, 124, 181, 106, 125, 23, 109,
1186 23, 24, 98, 23, 24, 104, 382, 106, 171, 105,
1187 109, 107, 108, 77, 23, 38, 162, 0, 38, 5,
1188 6, 7, 185, 26, 10, 124, 12, 13, 14, 15,
1189 16, 17, 18, 19, 20, 21, 22, 358, 38, 62,
1190 203, 137, 62, 23, 24, 41, 42, 447, 25, 459,
1191 73, 109, 62, 73, 31, 62, 33, 29, 38, 123,
1192 8, 119, 472, 73, 464, 37, 73, 70, 108, 445,
1193 65, 99, 136, 96, 99, 100, 96, 100, 50, 207,
1194 100, 53, 62, 25, 230, 461, 82, 110, 60, 31,
1195 110, 100, 69, 73, 71, 118, 96, 260, 118, 420,
1196 228, 99, 74, 113, 114, 100, 113, 114, 118, 25,
1197 26, 118, 109, 99, 100, 31, 96, 35, 29, 229,
1198 100, 34, 119, 29, 40, 97, 98, 109, 224, 71,
1199 229, 37, 28, 46, 30, 111, 54, 119, 118, 235,
1200 36, 117, 109, 448, 60, 56, 276, 43, 44, 45,
1201 99, 47, 119, 49, 60, 71, 72, 100, 27, 29,
1202 30, 466, 58, 27, 113, 114, 34, 37, 74, 25,
1203 39, 27, 99, 359, 61, 39, 106, 276, 46, 75,
1204 76, 68, 112, 39, 283, 61, 3, 4, 284, 59,
1205 60, 48, 68, 101, 51, 52, 104, 105, 55, 101,
1206 102, 103, 104, 9, 74, 11, 63, 84, 85, 86,
1207 87, 88, 89, 90, 91, 92, 93, 94, 95, 19,
1208 20, 21, 22, 23, 81, 108, 26, 27, 77, 78,
1209 79, 80, 99, 100, 113, 114, 23, 24, 99, 100,
1210 113, 114, 108, 117, 99, 117, 109, 377, 23, 109,
1211 349, 349, 349, 104, 99, 109, 109, 109, 354, 109,
1212 100, 109, 109, 109, 99, 109, 23, 64, 111, 65,
1213 111, 66, 111, 115, 83, 112, 109, 109, 377, 117,
1214 109, 109, 112, 382, 111, 111, 111, 111, 111, 111,
1215 386, 111, 111, 111, 109, 109, 117, 104, 23, 104,
1216 116, 23, 23, 116, 23, 67, 23, 111, 111, 111,
1217 111, 29, 23, 443, 23, 104, 110, 23, 110, 112,
1218 118, 111, 23, 109, 109, 23, 23, 23, 112, 112,
1219 112, 347, 112, 112, 112, 112, 112, 436, 436, 436,
1220 112, 109, 109, 57, 443, 23, 445, 112, 112, 112,
1221 23, 112, 112, 32, 109, 109, 66, 106, 111, 111,
1222 111, 119, 461, 109, 109, 112, 106, 446, 112, 112,
1223 462, 230, 87, 273, 210, 436, 388, 89, 159, 213,
1224 139, 89, 253, -1, -1, -1, 198
1227 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1228 symbol of state STATE-NUM. */
1229 static const yytype_uint16 yystos
[] =
1231 0, 3, 4, 121, 122, 0, 123, 8, 124, 125,
1232 99, 100, 262, 5, 6, 7, 10, 12, 13, 14,
1233 15, 16, 17, 18, 19, 20, 21, 22, 126, 127,
1234 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1235 138, 141, 170, 171, 178, 179, 180, 242, 244, 245,
1236 248, 261, 262, 108, 246, 99, 99, 99, 65, 100,
1237 145, 151, 249, 145, 145, 145, 145, 145, 100, 146,
1238 159, 99, 113, 114, 144, 166, 168, 241, 145, 145,
1239 108, 108, 9, 11, 99, 247, 117, 117, 111, 117,
1240 182, 29, 30, 37, 59, 60, 74, 250, 109, 101,
1241 102, 103, 104, 164, 109, 109, 109, 109, 109, 109,
1242 104, 161, 101, 104, 105, 163, 23, 24, 38, 62,
1243 73, 96, 100, 110, 118, 150, 152, 172, 186, 189,
1244 225, 229, 232, 236, 238, 239, 109, 109, 99, 243,
1245 109, 100, 172, 23, 181, 185, 189, 225, 235, 237,
1246 239, 240, 241, 27, 39, 251, 111, 255, 144, 115,
1247 165, 142, 241, 144, 142, 144, 144, 142, 29, 37,
1248 60, 74, 177, 34, 46, 28, 30, 36, 43, 44,
1249 45, 47, 49, 58, 75, 76, 190, 192, 195, 197,
1250 199, 203, 206, 208, 210, 212, 215, 224, 29, 37,
1251 50, 53, 60, 74, 97, 98, 173, 150, 240, 163,
1252 111, 150, 144, 117, 247, 99, 112, 23, 24, 61,
1253 68, 252, 23, 258, 109, 100, 166, 167, 169, 109,
1254 110, 143, 150, 238, 109, 109, 61, 68, 254, 255,
1255 111, 111, 111, 64, 29, 56, 207, 111, 25, 27,
1256 39, 196, 253, 111, 253, 48, 51, 52, 55, 63,
1257 81, 219, 26, 70, 211, 111, 257, 255, 66, 254,
1258 111, 255, 111, 111, 175, 163, 109, 119, 23, 153,
1259 154, 155, 159, 109, 109, 249, 117, 183, 112, 144,
1260 116, 116, 163, 142, 143, 104, 162, 83, 139, 144,
1261 23, 233, 23, 234, 23, 209, 23, 202, 67, 202,
1262 25, 31, 33, 69, 71, 191, 201, 111, 111, 220,
1263 111, 255, 41, 42, 82, 216, 217, 23, 260, 29,
1264 200, 35, 54, 204, 111, 23, 176, 23, 174, 176,
1265 110, 240, 112, 104, 160, 147, 148, 241, 144, 118,
1266 110, 111, 256, 109, 109, 112, 112, 112, 112, 112,
1267 23, 223, 23, 221, 23, 222, 112, 77, 78, 79,
1268 80, 205, 23, 218, 112, 112, 112, 109, 119, 113,
1269 114, 156, 109, 23, 149, 262, 109, 62, 73, 184,
1270 187, 188, 189, 226, 227, 230, 235, 23, 259, 84,
1271 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1272 95, 140, 144, 57, 26, 40, 60, 72, 193, 201,
1273 253, 112, 112, 112, 112, 240, 23, 157, 23, 158,
1274 148, 144, 34, 46, 213, 215, 109, 119, 112, 32,
1275 194, 198, 201, 109, 119, 109, 109, 111, 111, 66,
1276 214, 187, 240, 148, 139, 228, 233, 231, 234, 111,
1277 119, 109, 109, 112, 106, 112, 106, 218, 148, 140,
1278 233, 234, 106, 218, 112
1281 #define yyerrok (yyerrstatus = 0)
1282 #define yyclearin (yychar = YYEMPTY)
1283 #define YYEMPTY (-2)
1286 #define YYACCEPT goto yyacceptlab
1287 #define YYABORT goto yyabortlab
1288 #define YYERROR goto yyerrorlab
1291 /* Like YYERROR except do call yyerror. This remains here temporarily
1292 to ease the transition to the new meaning of YYERROR, for GCC.
1293 Once GCC version 2 has supplanted version 1, this can go. */
1295 #define YYFAIL goto yyerrlab
1297 #define YYRECOVERING() (!!yyerrstatus)
1299 #define YYBACKUP(Token, Value) \
1301 if (yychar == YYEMPTY && yylen == 1) \
1305 yytoken = YYTRANSLATE (yychar); \
1311 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1318 #define YYERRCODE 256
1321 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1322 If N is 0, then set CURRENT to the empty location which ends
1323 the previous symbol: RHS[0] (always defined). */
1325 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1326 #ifndef YYLLOC_DEFAULT
1327 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1331 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1332 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1333 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1334 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1338 (Current).first_line = (Current).last_line = \
1339 YYRHSLOC (Rhs, 0).last_line; \
1340 (Current).first_column = (Current).last_column = \
1341 YYRHSLOC (Rhs, 0).last_column; \
1347 /* YY_LOCATION_PRINT -- Print the location on the stream.
1348 This macro was not mandated originally: define only if we know
1349 we won't break user code: when these are the locations we know. */
1351 #ifndef YY_LOCATION_PRINT
1352 # if YYLTYPE_IS_TRIVIAL
1353 # define YY_LOCATION_PRINT(File, Loc) \
1354 fprintf (File, "%d.%d-%d.%d", \
1355 (Loc).first_line, (Loc).first_column, \
1356 (Loc).last_line, (Loc).last_column)
1358 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1363 /* YYLEX -- calling `yylex' with the right arguments. */
1366 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1368 # define YYLEX yylex (&yylval, &yylloc, scanner)
1371 /* Enable debugging if requested. */
1375 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1376 # define YYFPRINTF fprintf
1379 # define YYDPRINTF(Args) \
1385 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1389 YYFPRINTF (stderr, "%s ", Title); \
1390 yy_symbol_print (stderr, \
1391 Type, Value, Location, state); \
1392 YYFPRINTF (stderr, "\n"); \
1397 /*--------------------------------.
1398 | Print this symbol on YYOUTPUT. |
1399 `--------------------------------*/
1402 #if (defined __STDC__ || defined __C99__FUNC__ \
1403 || defined __cplusplus || defined _MSC_VER)
1405 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1408 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1411 YYSTYPE
const * const yyvaluep
;
1412 YYLTYPE
const * const yylocationp
;
1413 struct asm_parser_state
*state
;
1418 YYUSE (yylocationp
);
1421 if (yytype
< YYNTOKENS
)
1422 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1434 /*--------------------------------.
1435 | Print this symbol on YYOUTPUT. |
1436 `--------------------------------*/
1438 #if (defined __STDC__ || defined __C99__FUNC__ \
1439 || defined __cplusplus || defined _MSC_VER)
1441 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1444 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1447 YYSTYPE
const * const yyvaluep
;
1448 YYLTYPE
const * const yylocationp
;
1449 struct asm_parser_state
*state
;
1452 if (yytype
< YYNTOKENS
)
1453 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1455 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1457 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1458 YYFPRINTF (yyoutput
, ": ");
1459 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1460 YYFPRINTF (yyoutput
, ")");
1463 /*------------------------------------------------------------------.
1464 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1466 `------------------------------------------------------------------*/
1468 #if (defined __STDC__ || defined __C99__FUNC__ \
1469 || defined __cplusplus || defined _MSC_VER)
1471 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1474 yy_stack_print (yybottom
, yytop
)
1475 yytype_int16
*yybottom
;
1476 yytype_int16
*yytop
;
1479 YYFPRINTF (stderr
, "Stack now");
1480 for (; yybottom
<= yytop
; yybottom
++)
1482 int yybot
= *yybottom
;
1483 YYFPRINTF (stderr
, " %d", yybot
);
1485 YYFPRINTF (stderr
, "\n");
1488 # define YY_STACK_PRINT(Bottom, Top) \
1491 yy_stack_print ((Bottom), (Top)); \
1495 /*------------------------------------------------.
1496 | Report that the YYRULE is going to be reduced. |
1497 `------------------------------------------------*/
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500 || defined __cplusplus || defined _MSC_VER)
1502 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1505 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1509 struct asm_parser_state
*state
;
1512 int yynrhs
= yyr2
[yyrule
];
1514 unsigned long int yylno
= yyrline
[yyrule
];
1515 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1517 /* The symbols being reduced. */
1518 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1520 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1521 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1522 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1523 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1524 YYFPRINTF (stderr
, "\n");
1528 # define YY_REDUCE_PRINT(Rule) \
1531 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1534 /* Nonzero means print parse trace. It is left uninitialized so that
1535 multiple parsers can coexist. */
1537 #else /* !YYDEBUG */
1538 # define YYDPRINTF(Args)
1539 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1540 # define YY_STACK_PRINT(Bottom, Top)
1541 # define YY_REDUCE_PRINT(Rule)
1542 #endif /* !YYDEBUG */
1545 /* YYINITDEPTH -- initial size of the parser's stacks. */
1547 # define YYINITDEPTH 200
1550 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1551 if the built-in stack extension method is used).
1553 Do not make this value too large; the results are undefined if
1554 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1555 evaluated with infinite-precision integer arithmetic. */
1558 # define YYMAXDEPTH 10000
1566 # if defined __GLIBC__ && defined _STRING_H
1567 # define yystrlen strlen
1569 /* Return the length of YYSTR. */
1570 #if (defined __STDC__ || defined __C99__FUNC__ \
1571 || defined __cplusplus || defined _MSC_VER)
1573 yystrlen (const char *yystr
)
1581 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1589 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1590 # define yystpcpy stpcpy
1592 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1594 #if (defined __STDC__ || defined __C99__FUNC__ \
1595 || defined __cplusplus || defined _MSC_VER)
1597 yystpcpy (char *yydest
, const char *yysrc
)
1600 yystpcpy (yydest
, yysrc
)
1606 const char *yys
= yysrc
;
1608 while ((*yyd
++ = *yys
++) != '\0')
1617 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1618 quotes and backslashes, so that it's suitable for yyerror. The
1619 heuristic is that double-quoting is unnecessary unless the string
1620 contains an apostrophe, a comma, or backslash (other than
1621 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1622 null, do not copy; instead, return the length of what the result
1625 yytnamerr (char *yyres
, const char *yystr
)
1630 char const *yyp
= yystr
;
1637 goto do_not_strip_quotes
;
1641 goto do_not_strip_quotes
;
1654 do_not_strip_quotes
: ;
1658 return yystrlen (yystr
);
1660 return yystpcpy (yyres
, yystr
) - yyres
;
1664 /* Copy into YYRESULT an error message about the unexpected token
1665 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1666 including the terminating null byte. If YYRESULT is null, do not
1667 copy anything; just return the number of bytes that would be
1668 copied. As a special case, return 0 if an ordinary "syntax error"
1669 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1670 size calculation. */
1672 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1674 int yyn
= yypact
[yystate
];
1676 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1680 int yytype
= YYTRANSLATE (yychar
);
1681 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1682 YYSIZE_T yysize
= yysize0
;
1684 int yysize_overflow
= 0;
1685 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1686 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1690 /* This is so xgettext sees the translatable formats that are
1691 constructed on the fly. */
1692 YY_("syntax error, unexpected %s");
1693 YY_("syntax error, unexpected %s, expecting %s");
1694 YY_("syntax error, unexpected %s, expecting %s or %s");
1695 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1696 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1700 static char const yyunexpected
[] = "syntax error, unexpected %s";
1701 static char const yyexpecting
[] = ", expecting %s";
1702 static char const yyor
[] = " or %s";
1703 char yyformat
[sizeof yyunexpected
1704 + sizeof yyexpecting
- 1
1705 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1706 * (sizeof yyor
- 1))];
1707 char const *yyprefix
= yyexpecting
;
1709 /* Start YYX at -YYN if negative to avoid negative indexes in
1711 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1713 /* Stay within bounds of both yycheck and yytname. */
1714 int yychecklim
= YYLAST
- yyn
+ 1;
1715 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1718 yyarg
[0] = yytname
[yytype
];
1719 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1721 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1722 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1724 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1728 yyformat
[sizeof yyunexpected
- 1] = '\0';
1731 yyarg
[yycount
++] = yytname
[yyx
];
1732 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1733 yysize_overflow
|= (yysize1
< yysize
);
1735 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1739 yyf
= YY_(yyformat
);
1740 yysize1
= yysize
+ yystrlen (yyf
);
1741 yysize_overflow
|= (yysize1
< yysize
);
1744 if (yysize_overflow
)
1745 return YYSIZE_MAXIMUM
;
1749 /* Avoid sprintf, as that infringes on the user's name space.
1750 Don't have undefined behavior even if the translation
1751 produced a string with the wrong number of "%s"s. */
1752 char *yyp
= yyresult
;
1754 while ((*yyp
= *yyf
) != '\0')
1756 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1758 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1771 #endif /* YYERROR_VERBOSE */
1774 /*-----------------------------------------------.
1775 | Release the memory associated to this symbol. |
1776 `-----------------------------------------------*/
1779 #if (defined __STDC__ || defined __C99__FUNC__ \
1780 || defined __cplusplus || defined _MSC_VER)
1782 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1785 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1789 YYLTYPE
*yylocationp
;
1790 struct asm_parser_state
*state
;
1794 YYUSE (yylocationp
);
1799 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1809 /* Prevent warnings from -Wmissing-prototypes. */
1810 #ifdef YYPARSE_PARAM
1811 #if defined __STDC__ || defined __cplusplus
1812 int yyparse (void *YYPARSE_PARAM
);
1816 #else /* ! YYPARSE_PARAM */
1817 #if defined __STDC__ || defined __cplusplus
1818 int yyparse (struct asm_parser_state
*state
);
1822 #endif /* ! YYPARSE_PARAM */
1828 /*-------------------------.
1829 | yyparse or yypush_parse. |
1830 `-------------------------*/
1832 #ifdef YYPARSE_PARAM
1833 #if (defined __STDC__ || defined __C99__FUNC__ \
1834 || defined __cplusplus || defined _MSC_VER)
1836 yyparse (void *YYPARSE_PARAM
)
1839 yyparse (YYPARSE_PARAM
)
1840 void *YYPARSE_PARAM
;
1842 #else /* ! YYPARSE_PARAM */
1843 #if (defined __STDC__ || defined __C99__FUNC__ \
1844 || defined __cplusplus || defined _MSC_VER)
1846 yyparse (struct asm_parser_state
*state
)
1850 struct asm_parser_state
*state
;
1854 /* The lookahead symbol. */
1857 /* The semantic value of the lookahead symbol. */
1860 /* Location data for the lookahead symbol. */
1863 /* Number of syntax errors so far. */
1867 /* Number of tokens to shift before error messages enabled. */
1870 /* The stacks and their tools:
1871 `yyss': related to states.
1872 `yyvs': related to semantic values.
1873 `yyls': related to locations.
1875 Refer to the stacks thru separate pointers, to allow yyoverflow
1876 to reallocate them elsewhere. */
1878 /* The state stack. */
1879 yytype_int16 yyssa
[YYINITDEPTH
];
1881 yytype_int16
*yyssp
;
1883 /* The semantic value stack. */
1884 YYSTYPE yyvsa
[YYINITDEPTH
];
1888 /* The location stack. */
1889 YYLTYPE yylsa
[YYINITDEPTH
];
1893 /* The locations where the error started and ended. */
1894 YYLTYPE yyerror_range
[2];
1896 YYSIZE_T yystacksize
;
1900 /* Lookahead token as an internal (translated) token number. */
1902 /* The variables used to return semantic value and location from the
1908 /* Buffer for error messages, and its allocated size. */
1910 char *yymsg
= yymsgbuf
;
1911 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1914 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1916 /* The number of symbols on the RHS of the reduced rule.
1917 Keep to zero when no symbol should be popped. */
1924 yystacksize
= YYINITDEPTH
;
1926 YYDPRINTF ((stderr
, "Starting parse\n"));
1931 yychar
= YYEMPTY
; /* Cause a token to be read. */
1933 /* Initialize stack pointers.
1934 Waste one element of value and location stack
1935 so that they stay on the same level as the state stack.
1936 The wasted elements are never initialized. */
1941 #if YYLTYPE_IS_TRIVIAL
1942 /* Initialize the default location before parsing starts. */
1943 yylloc
.first_line
= yylloc
.last_line
= 1;
1944 yylloc
.first_column
= yylloc
.last_column
= 1;
1949 /*------------------------------------------------------------.
1950 | yynewstate -- Push a new state, which is found in yystate. |
1951 `------------------------------------------------------------*/
1953 /* In all cases, when you get here, the value and location stacks
1954 have just been pushed. So pushing a state here evens the stacks. */
1960 if (yyss
+ yystacksize
- 1 <= yyssp
)
1962 /* Get the current used size of the three stacks, in elements. */
1963 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1967 /* Give user a chance to reallocate the stack. Use copies of
1968 these so that the &'s don't force the real ones into
1970 YYSTYPE
*yyvs1
= yyvs
;
1971 yytype_int16
*yyss1
= yyss
;
1972 YYLTYPE
*yyls1
= yyls
;
1974 /* Each stack pointer address is followed by the size of the
1975 data in use in that stack, in bytes. This used to be a
1976 conditional around just the two extra args, but that might
1977 be undefined if yyoverflow is a macro. */
1978 yyoverflow (YY_("memory exhausted"),
1979 &yyss1
, yysize
* sizeof (*yyssp
),
1980 &yyvs1
, yysize
* sizeof (*yyvsp
),
1981 &yyls1
, yysize
* sizeof (*yylsp
),
1988 #else /* no yyoverflow */
1989 # ifndef YYSTACK_RELOCATE
1990 goto yyexhaustedlab
;
1992 /* Extend the stack our own way. */
1993 if (YYMAXDEPTH
<= yystacksize
)
1994 goto yyexhaustedlab
;
1996 if (YYMAXDEPTH
< yystacksize
)
1997 yystacksize
= YYMAXDEPTH
;
2000 yytype_int16
*yyss1
= yyss
;
2001 union yyalloc
*yyptr
=
2002 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2004 goto yyexhaustedlab
;
2005 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2006 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2007 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2008 # undef YYSTACK_RELOCATE
2010 YYSTACK_FREE (yyss1
);
2013 #endif /* no yyoverflow */
2015 yyssp
= yyss
+ yysize
- 1;
2016 yyvsp
= yyvs
+ yysize
- 1;
2017 yylsp
= yyls
+ yysize
- 1;
2019 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2020 (unsigned long int) yystacksize
));
2022 if (yyss
+ yystacksize
- 1 <= yyssp
)
2026 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2028 if (yystate
== YYFINAL
)
2038 /* Do appropriate processing given the current state. Read a
2039 lookahead token if we need one and don't already have one. */
2041 /* First try to decide what to do without reference to lookahead token. */
2042 yyn
= yypact
[yystate
];
2043 if (yyn
== YYPACT_NINF
)
2046 /* Not known => get a lookahead token if don't already have one. */
2048 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2049 if (yychar
== YYEMPTY
)
2051 YYDPRINTF ((stderr
, "Reading a token: "));
2055 if (yychar
<= YYEOF
)
2057 yychar
= yytoken
= YYEOF
;
2058 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2062 yytoken
= YYTRANSLATE (yychar
);
2063 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2066 /* If the proper action on seeing token YYTOKEN is to reduce or to
2067 detect an error, take that action. */
2069 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2074 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2080 /* Count tokens shifted since error; after three, turn off error
2085 /* Shift the lookahead token. */
2086 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2088 /* Discard the shifted token. */
2097 /*-----------------------------------------------------------.
2098 | yydefault -- do the default action for the current state. |
2099 `-----------------------------------------------------------*/
2101 yyn
= yydefact
[yystate
];
2107 /*-----------------------------.
2108 | yyreduce -- Do a reduction. |
2109 `-----------------------------*/
2111 /* yyn is the number of a rule to reduce with. */
2114 /* If YYLEN is nonzero, implement the default value of the action:
2117 Otherwise, the following line sets YYVAL to garbage.
2118 This behavior is undocumented and Bison
2119 users should not rely upon it. Assigning to YYVAL
2120 unconditionally makes the parser a bit smaller, and it avoids a
2121 GCC warning that YYVAL may be used uninitialized. */
2122 yyval
= yyvsp
[1-yylen
];
2124 /* Default location. */
2125 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2126 YY_REDUCE_PRINT (yyn
);
2131 /* Line 1455 of yacc.c */
2132 #line 282 "program_parse.y"
2134 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2135 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2138 state
->mode
= ARB_vertex
;
2144 /* Line 1455 of yacc.c */
2145 #line 290 "program_parse.y"
2147 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2148 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2150 state
->mode
= ARB_fragment
;
2152 state
->option
.TexRect
=
2153 (state
->ctx
->Extensions
.NV_texture_rectangle
!= GL_FALSE
);
2159 /* Line 1455 of yacc.c */
2160 #line 306 "program_parse.y"
2164 if (state
->mode
== ARB_vertex
) {
2165 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2166 } else if (state
->mode
== ARB_fragment
) {
2167 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2171 free((yyvsp
[(2) - (3)].string
));
2174 const char *const err_str
= (state
->mode
== ARB_vertex
)
2175 ? "invalid ARB vertex program option"
2176 : "invalid ARB fragment program option";
2178 yyerror(& (yylsp
[(2) - (3)]), state
, err_str
);
2186 /* Line 1455 of yacc.c */
2187 #line 334 "program_parse.y"
2189 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2190 if (state
->inst_tail
== NULL
) {
2191 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2193 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2196 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2197 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2199 state
->prog
->NumInstructions
++;
2206 /* Line 1455 of yacc.c */
2207 #line 352 "program_parse.y"
2209 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2210 state
->prog
->NumAluInstructions
++;
2216 /* Line 1455 of yacc.c */
2217 #line 357 "program_parse.y"
2219 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2220 state
->prog
->NumTexInstructions
++;
2226 /* Line 1455 of yacc.c */
2227 #line 378 "program_parse.y"
2229 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2235 /* Line 1455 of yacc.c */
2236 #line 384 "program_parse.y"
2238 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2244 /* Line 1455 of yacc.c */
2245 #line 390 "program_parse.y"
2247 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2253 /* Line 1455 of yacc.c */
2254 #line 396 "program_parse.y"
2256 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), & (yyvsp
[(6) - (6)].src_reg
), NULL
);
2262 /* Line 1455 of yacc.c */
2263 #line 403 "program_parse.y"
2265 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), & (yyvsp
[(6) - (6)].src_reg
), NULL
);
2271 /* Line 1455 of yacc.c */
2272 #line 410 "program_parse.y"
2274 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (8)].temp_inst
), & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), & (yyvsp
[(6) - (8)].src_reg
), & (yyvsp
[(8) - (8)].src_reg
));
2280 /* Line 1455 of yacc.c */
2281 #line 416 "program_parse.y"
2283 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (8)].temp_inst
), & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2284 if ((yyval
.inst
) != NULL
) {
2285 const GLbitfield tex_mask
= (1U << (yyvsp
[(6) - (8)].integer
));
2286 GLbitfield shadow_tex
= 0;
2287 GLbitfield target_mask
= 0;
2290 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2292 if ((yyvsp
[(8) - (8)].integer
) < 0) {
2293 shadow_tex
= tex_mask
;
2295 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(8) - (8)].integer
);
2296 (yyval
.inst
)->Base
.TexShadow
= 1;
2298 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2301 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2303 /* If this texture unit was previously accessed and that access
2304 * had a different texture target, generate an error.
2306 * If this texture unit was previously accessed and that access
2307 * had a different shadow mode, generate an error.
2309 if ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != 0)
2310 && ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != target_mask
)
2311 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2313 yyerror(& (yylsp
[(8) - (8)]), state
,
2314 "multiple targets used on one texture image unit");
2319 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= target_mask
;
2320 state
->prog
->ShadowSamplers
|= shadow_tex
;
2327 /* Line 1455 of yacc.c */
2328 #line 460 "program_parse.y"
2330 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2331 state
->fragment
.UsesKill
= 1;
2337 /* Line 1455 of yacc.c */
2338 #line 465 "program_parse.y"
2340 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL_NV
, NULL
, NULL
, NULL
, NULL
);
2341 (yyval
.inst
)->Base
.DstReg
.CondMask
= (yyvsp
[(2) - (2)].dst_reg
).CondMask
;
2342 (yyval
.inst
)->Base
.DstReg
.CondSwizzle
= (yyvsp
[(2) - (2)].dst_reg
).CondSwizzle
;
2343 (yyval
.inst
)->Base
.DstReg
.CondSrc
= (yyvsp
[(2) - (2)].dst_reg
).CondSrc
;
2344 state
->fragment
.UsesKill
= 1;
2350 /* Line 1455 of yacc.c */
2351 #line 475 "program_parse.y"
2353 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (12)].temp_inst
), & (yyvsp
[(2) - (12)].dst_reg
), & (yyvsp
[(4) - (12)].src_reg
), & (yyvsp
[(6) - (12)].src_reg
), & (yyvsp
[(8) - (12)].src_reg
));
2354 if ((yyval
.inst
) != NULL
) {
2355 const GLbitfield tex_mask
= (1U << (yyvsp
[(10) - (12)].integer
));
2356 GLbitfield shadow_tex
= 0;
2357 GLbitfield target_mask
= 0;
2360 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(10) - (12)].integer
);
2362 if ((yyvsp
[(12) - (12)].integer
) < 0) {
2363 shadow_tex
= tex_mask
;
2365 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(12) - (12)].integer
);
2366 (yyval
.inst
)->Base
.TexShadow
= 1;
2368 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(12) - (12)].integer
);
2371 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2373 /* If this texture unit was previously accessed and that access
2374 * had a different texture target, generate an error.
2376 * If this texture unit was previously accessed and that access
2377 * had a different shadow mode, generate an error.
2379 if ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != 0)
2380 && ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != target_mask
)
2381 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2383 yyerror(& (yylsp
[(12) - (12)]), state
,
2384 "multiple targets used on one texture image unit");
2389 state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] |= target_mask
;
2390 state
->prog
->ShadowSamplers
|= shadow_tex
;
2397 /* Line 1455 of yacc.c */
2398 #line 519 "program_parse.y"
2400 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2406 /* Line 1455 of yacc.c */
2407 #line 524 "program_parse.y"
2408 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2413 /* Line 1455 of yacc.c */
2414 #line 525 "program_parse.y"
2415 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2420 /* Line 1455 of yacc.c */
2421 #line 526 "program_parse.y"
2422 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2427 /* Line 1455 of yacc.c */
2428 #line 527 "program_parse.y"
2429 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2434 /* Line 1455 of yacc.c */
2435 #line 528 "program_parse.y"
2436 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2441 /* Line 1455 of yacc.c */
2442 #line 529 "program_parse.y"
2443 { (yyval
.integer
) = -TEXTURE_1D_INDEX
; ;}
2448 /* Line 1455 of yacc.c */
2449 #line 530 "program_parse.y"
2450 { (yyval
.integer
) = -TEXTURE_2D_INDEX
; ;}
2455 /* Line 1455 of yacc.c */
2456 #line 531 "program_parse.y"
2457 { (yyval
.integer
) = -TEXTURE_RECT_INDEX
; ;}
2462 /* Line 1455 of yacc.c */
2463 #line 532 "program_parse.y"
2464 { (yyval
.integer
) = TEXTURE_1D_ARRAY_INDEX
; ;}
2469 /* Line 1455 of yacc.c */
2470 #line 533 "program_parse.y"
2471 { (yyval
.integer
) = TEXTURE_2D_ARRAY_INDEX
; ;}
2476 /* Line 1455 of yacc.c */
2477 #line 534 "program_parse.y"
2478 { (yyval
.integer
) = -TEXTURE_1D_ARRAY_INDEX
; ;}
2483 /* Line 1455 of yacc.c */
2484 #line 535 "program_parse.y"
2485 { (yyval
.integer
) = -TEXTURE_2D_ARRAY_INDEX
; ;}
2490 /* Line 1455 of yacc.c */
2491 #line 539 "program_parse.y"
2493 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2494 * FIXME: to the existing swizzle?
2496 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2497 (yyvsp
[(4) - (6)].src_reg
).Base
.Negate
= (yyvsp
[(6) - (6)].swiz_mask
).mask
;
2499 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2505 /* Line 1455 of yacc.c */
2506 #line 551 "program_parse.y"
2508 (yyval
.src_reg
) = (yyvsp
[(2) - (2)].src_reg
);
2510 if ((yyvsp
[(1) - (2)].negate
)) {
2511 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2518 /* Line 1455 of yacc.c */
2519 #line 559 "program_parse.y"
2521 (yyval
.src_reg
) = (yyvsp
[(3) - (4)].src_reg
);
2523 if (!state
->option
.NV_fragment
) {
2524 yyerror(& (yylsp
[(2) - (4)]), state
, "unexpected character '|'");
2528 if ((yyvsp
[(1) - (4)].negate
)) {
2529 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2532 (yyval
.src_reg
).Base
.Abs
= 1;
2538 /* Line 1455 of yacc.c */
2539 #line 576 "program_parse.y"
2541 (yyval
.src_reg
) = (yyvsp
[(1) - (2)].src_reg
);
2543 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2544 (yyvsp
[(2) - (2)].swiz_mask
).swizzle
);
2550 /* Line 1455 of yacc.c */
2551 #line 583 "program_parse.y"
2553 struct asm_symbol temp_sym
;
2555 if (!state
->option
.NV_fragment
) {
2556 yyerror(& (yylsp
[(1) - (1)]), state
, "expected scalar suffix");
2560 memset(& temp_sym
, 0, sizeof(temp_sym
));
2561 temp_sym
.param_binding_begin
= ~0;
2562 initialize_symbol_from_const(state
->prog
, & temp_sym
, & (yyvsp
[(1) - (1)].vector
), GL_TRUE
);
2564 set_src_reg_swz(& (yyval
.src_reg
), PROGRAM_CONSTANT
,
2565 temp_sym
.param_binding_begin
,
2566 temp_sym
.param_binding_swizzle
);
2572 /* Line 1455 of yacc.c */
2573 #line 602 "program_parse.y"
2575 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2577 if ((yyvsp
[(1) - (3)].negate
)) {
2578 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2581 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2582 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2588 /* Line 1455 of yacc.c */
2589 #line 613 "program_parse.y"
2591 (yyval
.src_reg
) = (yyvsp
[(3) - (5)].src_reg
);
2593 if (!state
->option
.NV_fragment
) {
2594 yyerror(& (yylsp
[(2) - (5)]), state
, "unexpected character '|'");
2598 if ((yyvsp
[(1) - (5)].negate
)) {
2599 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2602 (yyval
.src_reg
).Base
.Abs
= 1;
2603 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2604 (yyvsp
[(4) - (5)].swiz_mask
).swizzle
);
2610 /* Line 1455 of yacc.c */
2611 #line 633 "program_parse.y"
2613 (yyval
.dst_reg
) = (yyvsp
[(1) - (3)].dst_reg
);
2614 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (3)].swiz_mask
).mask
;
2615 (yyval
.dst_reg
).CondMask
= (yyvsp
[(3) - (3)].dst_reg
).CondMask
;
2616 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(3) - (3)].dst_reg
).CondSwizzle
;
2617 (yyval
.dst_reg
).CondSrc
= (yyvsp
[(3) - (3)].dst_reg
).CondSrc
;
2619 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2620 /* Technically speaking, this should check that it is in
2621 * vertex program mode. However, PositionInvariant can never be
2622 * set in fragment program mode, so it is somewhat irrelevant.
2624 if (state
->option
.PositionInvariant
2625 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2626 yyerror(& (yylsp
[(1) - (3)]), state
, "position-invariant programs cannot "
2631 state
->prog
->OutputsWritten
|= BITFIELD64_BIT((yyval
.dst_reg
).Index
);
2638 /* Line 1455 of yacc.c */
2639 #line 658 "program_parse.y"
2641 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_ADDRESS
, 0);
2642 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2648 /* Line 1455 of yacc.c */
2649 #line 665 "program_parse.y"
2651 const unsigned xyzw_valid
=
2652 ((yyvsp
[(1) - (7)].ext_swizzle
).xyzw_valid
<< 0)
2653 | ((yyvsp
[(3) - (7)].ext_swizzle
).xyzw_valid
<< 1)
2654 | ((yyvsp
[(5) - (7)].ext_swizzle
).xyzw_valid
<< 2)
2655 | ((yyvsp
[(7) - (7)].ext_swizzle
).xyzw_valid
<< 3);
2656 const unsigned rgba_valid
=
2657 ((yyvsp
[(1) - (7)].ext_swizzle
).rgba_valid
<< 0)
2658 | ((yyvsp
[(3) - (7)].ext_swizzle
).rgba_valid
<< 1)
2659 | ((yyvsp
[(5) - (7)].ext_swizzle
).rgba_valid
<< 2)
2660 | ((yyvsp
[(7) - (7)].ext_swizzle
).rgba_valid
<< 3);
2662 /* All of the swizzle components have to be valid in either RGBA
2663 * or XYZW. Note that 0 and 1 are valid in both, so both masks
2664 * can have some bits set.
2666 * We somewhat deviate from the spec here. It would be really hard
2667 * to figure out which component is the error, and there probably
2668 * isn't a lot of benefit.
2670 if ((rgba_valid
!= 0x0f) && (xyzw_valid
!= 0x0f)) {
2671 yyerror(& (yylsp
[(1) - (7)]), state
, "cannot combine RGBA and XYZW swizzle "
2676 (yyval
.swiz_mask
).swizzle
= MAKE_SWIZZLE4((yyvsp
[(1) - (7)].ext_swizzle
).swz
, (yyvsp
[(3) - (7)].ext_swizzle
).swz
, (yyvsp
[(5) - (7)].ext_swizzle
).swz
, (yyvsp
[(7) - (7)].ext_swizzle
).swz
);
2677 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].ext_swizzle
).negate
) | ((yyvsp
[(3) - (7)].ext_swizzle
).negate
<< 1) | ((yyvsp
[(5) - (7)].ext_swizzle
).negate
<< 2)
2678 | ((yyvsp
[(7) - (7)].ext_swizzle
).negate
<< 3);
2684 /* Line 1455 of yacc.c */
2685 #line 698 "program_parse.y"
2687 (yyval
.ext_swizzle
) = (yyvsp
[(2) - (2)].ext_swizzle
);
2688 (yyval
.ext_swizzle
).negate
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2694 /* Line 1455 of yacc.c */
2695 #line 705 "program_parse.y"
2697 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2698 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2702 (yyval
.ext_swizzle
).swz
= ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2704 /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2707 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2708 (yyval
.ext_swizzle
).rgba_valid
= 1;
2714 /* Line 1455 of yacc.c */
2715 #line 720 "program_parse.y"
2719 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2720 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2724 s
= (yyvsp
[(1) - (1)].string
)[0];
2725 free((yyvsp
[(1) - (1)].string
));
2729 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2730 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2733 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2734 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2737 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2738 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2741 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2742 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2746 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2747 (yyval
.ext_swizzle
).rgba_valid
= 1;
2750 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2751 (yyval
.ext_swizzle
).rgba_valid
= 1;
2754 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2755 (yyval
.ext_swizzle
).rgba_valid
= 1;
2758 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2759 (yyval
.ext_swizzle
).rgba_valid
= 1;
2763 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2772 /* Line 1455 of yacc.c */
2773 #line 775 "program_parse.y"
2775 struct asm_symbol
*const s
= (struct asm_symbol
*)
2776 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2778 free((yyvsp
[(1) - (1)].string
));
2781 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2783 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2784 && (s
->type
!= at_attrib
)) {
2785 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2787 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2788 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2792 init_src_reg(& (yyval
.src_reg
));
2795 set_src_reg(& (yyval
.src_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2798 set_src_reg_swz(& (yyval
.src_reg
), s
->param_binding_type
,
2799 s
->param_binding_begin
,
2800 s
->param_binding_swizzle
);
2803 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, s
->attrib_binding
);
2804 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2806 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2820 /* Line 1455 of yacc.c */
2821 #line 818 "program_parse.y"
2823 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, (yyvsp
[(1) - (1)].attrib
));
2824 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2826 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2834 /* Line 1455 of yacc.c */
2835 #line 827 "program_parse.y"
2837 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2838 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2839 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2843 init_src_reg(& (yyval
.src_reg
));
2844 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2846 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2847 state
->prog
->IndirectRegisterFiles
|= (1 << (yyval
.src_reg
).Base
.File
);
2848 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2850 (yyval
.src_reg
).Base
.RelAddr
= 1;
2851 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2852 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2854 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2861 /* Line 1455 of yacc.c */
2862 #line 849 "program_parse.y"
2864 gl_register_file file
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2865 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2867 set_src_reg_swz(& (yyval
.src_reg
), file
, (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
,
2868 (yyvsp
[(1) - (1)].temp_sym
).param_binding_swizzle
);
2874 /* Line 1455 of yacc.c */
2875 #line 859 "program_parse.y"
2877 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, (yyvsp
[(1) - (1)].result
));
2883 /* Line 1455 of yacc.c */
2884 #line 863 "program_parse.y"
2886 struct asm_symbol
*const s
= (struct asm_symbol
*)
2887 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2889 free((yyvsp
[(1) - (1)].string
));
2892 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2894 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2895 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2901 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2904 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, s
->output_binding
);
2907 set_dst_reg(& (yyval
.dst_reg
), s
->param_binding_type
, s
->param_binding_begin
);
2915 /* Line 1455 of yacc.c */
2916 #line 892 "program_parse.y"
2918 struct asm_symbol
*const s
= (struct asm_symbol
*)
2919 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2921 free((yyvsp
[(1) - (1)].string
));
2924 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2926 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2927 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2937 /* Line 1455 of yacc.c */
2938 #line 913 "program_parse.y"
2940 init_src_reg(& (yyval
.src_reg
));
2941 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2947 /* Line 1455 of yacc.c */
2948 #line 920 "program_parse.y"
2950 /* FINISHME: Add support for multiple address registers.
2952 /* FINISHME: Add support for 4-component address registers.
2954 init_src_reg(& (yyval
.src_reg
));
2955 (yyval
.src_reg
).Base
.RelAddr
= 1;
2956 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2962 /* Line 1455 of yacc.c */
2963 #line 931 "program_parse.y"
2964 { (yyval
.integer
) = 0; ;}
2969 /* Line 1455 of yacc.c */
2970 #line 932 "program_parse.y"
2971 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2976 /* Line 1455 of yacc.c */
2977 #line 933 "program_parse.y"
2978 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2983 /* Line 1455 of yacc.c */
2984 #line 937 "program_parse.y"
2986 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 4095)) {
2988 _mesa_snprintf(s
, sizeof(s
),
2989 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2990 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2993 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3000 /* Line 1455 of yacc.c */
3001 #line 951 "program_parse.y"
3003 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 4096)) {
3005 _mesa_snprintf(s
, sizeof(s
),
3006 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
3007 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
3010 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3017 /* Line 1455 of yacc.c */
3018 #line 965 "program_parse.y"
3020 struct asm_symbol
*const s
= (struct asm_symbol
*)
3021 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
3023 free((yyvsp
[(1) - (1)].string
));
3026 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
3028 } else if (s
->type
!= at_address
) {
3029 yyerror(& (yylsp
[(1) - (1)]), state
,
3030 "invalid variable for indexed array access");
3040 /* Line 1455 of yacc.c */
3041 #line 985 "program_parse.y"
3043 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3044 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
3047 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3054 /* Line 1455 of yacc.c */
3055 #line 996 "program_parse.y"
3057 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3058 yyerror(& (yylsp
[(1) - (1)]), state
,
3059 "address register write mask must be \".x\"");
3062 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3069 /* Line 1455 of yacc.c */
3070 #line 1012 "program_parse.y"
3071 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3076 /* Line 1455 of yacc.c */
3077 #line 1016 "program_parse.y"
3078 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3083 /* Line 1455 of yacc.c */
3084 #line 1020 "program_parse.y"
3086 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3092 /* Line 1455 of yacc.c */
3093 #line 1024 "program_parse.y"
3095 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3101 /* Line 1455 of yacc.c */
3102 #line 1028 "program_parse.y"
3104 (yyval
.dst_reg
).CondMask
= COND_TR
;
3105 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3106 (yyval
.dst_reg
).CondSrc
= 0;
3112 /* Line 1455 of yacc.c */
3113 #line 1036 "program_parse.y"
3115 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3116 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3122 /* Line 1455 of yacc.c */
3123 #line 1043 "program_parse.y"
3125 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3126 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3132 /* Line 1455 of yacc.c */
3133 #line 1050 "program_parse.y"
3135 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3136 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3137 char *const err_str
=
3138 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3140 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3141 ? err_str
: "invalid condition code");
3143 if (err_str
!= NULL
) {
3150 (yyval
.dst_reg
).CondMask
= cond
;
3151 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3152 (yyval
.dst_reg
).CondSrc
= 0;
3158 /* Line 1455 of yacc.c */
3159 #line 1073 "program_parse.y"
3161 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3162 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3163 char *const err_str
=
3164 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3166 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3167 ? err_str
: "invalid condition code");
3169 if (err_str
!= NULL
) {
3176 (yyval
.dst_reg
).CondMask
= cond
;
3177 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3178 (yyval
.dst_reg
).CondSrc
= 0;
3184 /* Line 1455 of yacc.c */
3185 #line 1104 "program_parse.y"
3187 struct asm_symbol
*const s
=
3188 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
3191 free((yyvsp
[(2) - (4)].string
));
3194 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
3195 state
->InputsBound
|= (1U << s
->attrib_binding
);
3197 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
3206 /* Line 1455 of yacc.c */
3207 #line 1123 "program_parse.y"
3209 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3215 /* Line 1455 of yacc.c */
3216 #line 1127 "program_parse.y"
3218 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3224 /* Line 1455 of yacc.c */
3225 #line 1133 "program_parse.y"
3227 (yyval
.attrib
) = VERT_ATTRIB_POS
;
3233 /* Line 1455 of yacc.c */
3234 #line 1137 "program_parse.y"
3236 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
3242 /* Line 1455 of yacc.c */
3243 #line 1141 "program_parse.y"
3245 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
3251 /* Line 1455 of yacc.c */
3252 #line 1145 "program_parse.y"
3254 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
3255 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
3259 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
3265 /* Line 1455 of yacc.c */
3266 #line 1154 "program_parse.y"
3268 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
3269 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
3273 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
3279 /* Line 1455 of yacc.c */
3280 #line 1163 "program_parse.y"
3282 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3288 /* Line 1455 of yacc.c */
3289 #line 1167 "program_parse.y"
3291 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3298 /* Line 1455 of yacc.c */
3299 #line 1172 "program_parse.y"
3301 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
3307 /* Line 1455 of yacc.c */
3308 #line 1178 "program_parse.y"
3310 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
3311 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
3315 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3321 /* Line 1455 of yacc.c */
3322 #line 1192 "program_parse.y"
3324 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
3330 /* Line 1455 of yacc.c */
3331 #line 1196 "program_parse.y"
3333 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
3339 /* Line 1455 of yacc.c */
3340 #line 1200 "program_parse.y"
3342 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
3348 /* Line 1455 of yacc.c */
3349 #line 1204 "program_parse.y"
3351 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3357 /* Line 1455 of yacc.c */
3358 #line 1212 "program_parse.y"
3360 struct asm_symbol
*const s
=
3361 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
3364 free((yyvsp
[(2) - (3)].string
));
3367 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
3368 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
3369 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3370 s
->param_binding_swizzle
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_swizzle
;
3371 s
->param_is_array
= 0;
3378 /* Line 1455 of yacc.c */
3379 #line 1230 "program_parse.y"
3381 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
3382 free((yyvsp
[(2) - (6)].string
));
3383 yyerror(& (yylsp
[(4) - (6)]), state
,
3384 "parameter array size and number of bindings must match");
3387 struct asm_symbol
*const s
=
3388 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
3391 free((yyvsp
[(2) - (6)].string
));
3394 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
3395 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
3396 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
3397 s
->param_binding_swizzle
= SWIZZLE_XYZW
;
3398 s
->param_is_array
= 1;
3406 /* Line 1455 of yacc.c */
3407 #line 1255 "program_parse.y"
3409 (yyval
.integer
) = 0;
3415 /* Line 1455 of yacc.c */
3416 #line 1259 "program_parse.y"
3418 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) > state
->limits
->MaxParameters
)) {
3419 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
3422 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3429 /* Line 1455 of yacc.c */
3430 #line 1270 "program_parse.y"
3432 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
3438 /* Line 1455 of yacc.c */
3439 #line 1276 "program_parse.y"
3441 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
3447 /* Line 1455 of yacc.c */
3448 #line 1283 "program_parse.y"
3450 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3451 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
3457 /* Line 1455 of yacc.c */
3458 #line 1290 "program_parse.y"
3460 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3461 (yyval
.temp_sym
).param_binding_begin
= ~0;
3462 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3468 /* Line 1455 of yacc.c */
3469 #line 1296 "program_parse.y"
3471 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3472 (yyval
.temp_sym
).param_binding_begin
= ~0;
3473 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3479 /* Line 1455 of yacc.c */
3480 #line 1302 "program_parse.y"
3482 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3483 (yyval
.temp_sym
).param_binding_begin
= ~0;
3484 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
), GL_TRUE
);
3490 /* Line 1455 of yacc.c */
3491 #line 1310 "program_parse.y"
3493 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3494 (yyval
.temp_sym
).param_binding_begin
= ~0;
3495 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3501 /* Line 1455 of yacc.c */
3502 #line 1316 "program_parse.y"
3504 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3505 (yyval
.temp_sym
).param_binding_begin
= ~0;
3506 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3512 /* Line 1455 of yacc.c */
3513 #line 1322 "program_parse.y"
3515 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3516 (yyval
.temp_sym
).param_binding_begin
= ~0;
3517 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
), GL_TRUE
);
3523 /* Line 1455 of yacc.c */
3524 #line 1330 "program_parse.y"
3526 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3527 (yyval
.temp_sym
).param_binding_begin
= ~0;
3528 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3534 /* Line 1455 of yacc.c */
3535 #line 1336 "program_parse.y"
3537 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3538 (yyval
.temp_sym
).param_binding_begin
= ~0;
3539 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3545 /* Line 1455 of yacc.c */
3546 #line 1342 "program_parse.y"
3548 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3549 (yyval
.temp_sym
).param_binding_begin
= ~0;
3550 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
), GL_FALSE
);
3556 /* Line 1455 of yacc.c */
3557 #line 1349 "program_parse.y"
3558 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3563 /* Line 1455 of yacc.c */
3564 #line 1350 "program_parse.y"
3565 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3570 /* Line 1455 of yacc.c */
3571 #line 1353 "program_parse.y"
3572 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3577 /* Line 1455 of yacc.c */
3578 #line 1354 "program_parse.y"
3579 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3584 /* Line 1455 of yacc.c */
3585 #line 1355 "program_parse.y"
3586 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3591 /* Line 1455 of yacc.c */
3592 #line 1356 "program_parse.y"
3593 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3598 /* Line 1455 of yacc.c */
3599 #line 1357 "program_parse.y"
3600 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3605 /* Line 1455 of yacc.c */
3606 #line 1358 "program_parse.y"
3607 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3612 /* Line 1455 of yacc.c */
3613 #line 1359 "program_parse.y"
3614 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3619 /* Line 1455 of yacc.c */
3620 #line 1360 "program_parse.y"
3621 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3626 /* Line 1455 of yacc.c */
3627 #line 1361 "program_parse.y"
3628 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3633 /* Line 1455 of yacc.c */
3634 #line 1362 "program_parse.y"
3635 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3640 /* Line 1455 of yacc.c */
3641 #line 1363 "program_parse.y"
3642 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3647 /* Line 1455 of yacc.c */
3648 #line 1367 "program_parse.y"
3650 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3651 (yyval
.state
)[0] = STATE_MATERIAL
;
3652 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3653 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3659 /* Line 1455 of yacc.c */
3660 #line 1376 "program_parse.y"
3662 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3668 /* Line 1455 of yacc.c */
3669 #line 1380 "program_parse.y"
3671 (yyval
.integer
) = STATE_EMISSION
;
3677 /* Line 1455 of yacc.c */
3678 #line 1384 "program_parse.y"
3680 (yyval
.integer
) = STATE_SHININESS
;
3686 /* Line 1455 of yacc.c */
3687 #line 1390 "program_parse.y"
3689 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3690 (yyval
.state
)[0] = STATE_LIGHT
;
3691 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3692 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3698 /* Line 1455 of yacc.c */
3699 #line 1399 "program_parse.y"
3701 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3707 /* Line 1455 of yacc.c */
3708 #line 1403 "program_parse.y"
3710 (yyval
.integer
) = STATE_POSITION
;
3716 /* Line 1455 of yacc.c */
3717 #line 1407 "program_parse.y"
3719 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3720 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3724 (yyval
.integer
) = STATE_ATTENUATION
;
3730 /* Line 1455 of yacc.c */
3731 #line 1416 "program_parse.y"
3733 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3739 /* Line 1455 of yacc.c */
3740 #line 1420 "program_parse.y"
3742 (yyval
.integer
) = STATE_HALF_VECTOR
;
3748 /* Line 1455 of yacc.c */
3749 #line 1426 "program_parse.y"
3751 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3757 /* Line 1455 of yacc.c */
3758 #line 1432 "program_parse.y"
3760 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3761 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3767 /* Line 1455 of yacc.c */
3768 #line 1439 "program_parse.y"
3770 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3771 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3777 /* Line 1455 of yacc.c */
3778 #line 1444 "program_parse.y"
3780 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3781 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3782 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3788 /* Line 1455 of yacc.c */
3789 #line 1452 "program_parse.y"
3791 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3792 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3793 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3794 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3795 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3801 /* Line 1455 of yacc.c */
3802 #line 1464 "program_parse.y"
3804 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3805 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3806 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3812 /* Line 1455 of yacc.c */
3813 #line 1472 "program_parse.y"
3815 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3821 /* Line 1455 of yacc.c */
3822 #line 1478 "program_parse.y"
3824 (yyval
.integer
) = STATE_AMBIENT
;
3830 /* Line 1455 of yacc.c */
3831 #line 1482 "program_parse.y"
3833 (yyval
.integer
) = STATE_DIFFUSE
;
3839 /* Line 1455 of yacc.c */
3840 #line 1486 "program_parse.y"
3842 (yyval
.integer
) = STATE_SPECULAR
;
3848 /* Line 1455 of yacc.c */
3849 #line 1492 "program_parse.y"
3851 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3852 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3856 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3862 /* Line 1455 of yacc.c */
3863 #line 1503 "program_parse.y"
3865 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3866 (yyval
.state
)[0] = STATE_TEXGEN
;
3867 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3868 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3874 /* Line 1455 of yacc.c */
3875 #line 1512 "program_parse.y"
3877 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3883 /* Line 1455 of yacc.c */
3884 #line 1516 "program_parse.y"
3886 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3892 /* Line 1455 of yacc.c */
3893 #line 1521 "program_parse.y"
3895 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3901 /* Line 1455 of yacc.c */
3902 #line 1525 "program_parse.y"
3904 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3910 /* Line 1455 of yacc.c */
3911 #line 1529 "program_parse.y"
3913 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3919 /* Line 1455 of yacc.c */
3920 #line 1533 "program_parse.y"
3922 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3928 /* Line 1455 of yacc.c */
3929 #line 1539 "program_parse.y"
3931 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3932 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3938 /* Line 1455 of yacc.c */
3939 #line 1546 "program_parse.y"
3941 (yyval
.integer
) = STATE_FOG_COLOR
;
3947 /* Line 1455 of yacc.c */
3948 #line 1550 "program_parse.y"
3950 (yyval
.integer
) = STATE_FOG_PARAMS
;
3956 /* Line 1455 of yacc.c */
3957 #line 1556 "program_parse.y"
3959 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3960 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3961 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3967 /* Line 1455 of yacc.c */
3968 #line 1564 "program_parse.y"
3970 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3971 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3975 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3981 /* Line 1455 of yacc.c */
3982 #line 1575 "program_parse.y"
3984 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3985 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3991 /* Line 1455 of yacc.c */
3992 #line 1582 "program_parse.y"
3994 (yyval
.integer
) = STATE_POINT_SIZE
;
4000 /* Line 1455 of yacc.c */
4001 #line 1586 "program_parse.y"
4003 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
4009 /* Line 1455 of yacc.c */
4010 #line 1592 "program_parse.y"
4012 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
4013 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
4014 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4015 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4016 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
4022 /* Line 1455 of yacc.c */
4023 #line 1602 "program_parse.y"
4025 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
4026 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
4027 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
4028 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
4029 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
4035 /* Line 1455 of yacc.c */
4036 #line 1612 "program_parse.y"
4038 (yyval
.state
)[2] = 0;
4039 (yyval
.state
)[3] = 3;
4045 /* Line 1455 of yacc.c */
4046 #line 1617 "program_parse.y"
4048 /* It seems logical that the matrix row range specifier would have
4049 * to specify a range or more than one row (i.e., $5 > $3).
4050 * However, the ARB_vertex_program spec says "a program will fail
4051 * to load if <a> is greater than <b>." This means that $3 == $5
4054 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
4055 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
4059 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
4060 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
4066 /* Line 1455 of yacc.c */
4067 #line 1635 "program_parse.y"
4069 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
4070 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
4071 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
4077 /* Line 1455 of yacc.c */
4078 #line 1643 "program_parse.y"
4080 (yyval
.integer
) = 0;
4086 /* Line 1455 of yacc.c */
4087 #line 1647 "program_parse.y"
4089 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4095 /* Line 1455 of yacc.c */
4096 #line 1653 "program_parse.y"
4098 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
4104 /* Line 1455 of yacc.c */
4105 #line 1657 "program_parse.y"
4107 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
4113 /* Line 1455 of yacc.c */
4114 #line 1661 "program_parse.y"
4116 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
4122 /* Line 1455 of yacc.c */
4123 #line 1667 "program_parse.y"
4125 if ((yyvsp
[(1) - (1)].integer
) > 3) {
4126 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
4130 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4136 /* Line 1455 of yacc.c */
4137 #line 1678 "program_parse.y"
4139 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
4140 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4146 /* Line 1455 of yacc.c */
4147 #line 1683 "program_parse.y"
4149 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
4150 (yyval
.state
)[1] = 0;
4156 /* Line 1455 of yacc.c */
4157 #line 1688 "program_parse.y"
4159 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
4160 (yyval
.state
)[1] = 0;
4166 /* Line 1455 of yacc.c */
4167 #line 1693 "program_parse.y"
4169 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
4170 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4176 /* Line 1455 of yacc.c */
4177 #line 1698 "program_parse.y"
4179 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
4186 /* Line 1455 of yacc.c */
4187 #line 1703 "program_parse.y"
4189 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
4190 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
4196 /* Line 1455 of yacc.c */
4197 #line 1710 "program_parse.y"
4199 (yyval
.integer
) = 0;
4205 /* Line 1455 of yacc.c */
4206 #line 1714 "program_parse.y"
4208 (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
);
4214 /* Line 1455 of yacc.c */
4215 #line 1719 "program_parse.y"
4217 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
4220 if ((yyvsp
[(1) - (1)].integer
) != 0) {
4221 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
4225 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4231 /* Line 1455 of yacc.c */
4232 #line 1732 "program_parse.y"
4234 /* Since GL_ARB_matrix_palette isn't supported, just let any value
4235 * through here. The error will be generated later.
4237 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4243 /* Line 1455 of yacc.c */
4244 #line 1740 "program_parse.y"
4246 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
4247 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
4251 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4257 /* Line 1455 of yacc.c */
4258 #line 1751 "program_parse.y"
4260 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4261 (yyval
.state
)[0] = STATE_DEPTH_RANGE
;
4267 /* Line 1455 of yacc.c */
4268 #line 1763 "program_parse.y"
4270 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4271 (yyval
.state
)[0] = state
->state_param_enum
;
4272 (yyval
.state
)[1] = STATE_ENV
;
4273 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4274 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4280 /* Line 1455 of yacc.c */
4281 #line 1773 "program_parse.y"
4283 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4284 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4290 /* Line 1455 of yacc.c */
4291 #line 1778 "program_parse.y"
4293 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4294 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4300 /* Line 1455 of yacc.c */
4301 #line 1785 "program_parse.y"
4303 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4304 (yyval
.state
)[0] = state
->state_param_enum
;
4305 (yyval
.state
)[1] = STATE_ENV
;
4306 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4307 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4313 /* Line 1455 of yacc.c */
4314 #line 1795 "program_parse.y"
4316 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4317 (yyval
.state
)[0] = state
->state_param_enum
;
4318 (yyval
.state
)[1] = STATE_LOCAL
;
4319 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4320 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4326 /* Line 1455 of yacc.c */
4327 #line 1804 "program_parse.y"
4329 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4330 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4336 /* Line 1455 of yacc.c */
4337 #line 1809 "program_parse.y"
4339 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4340 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4346 /* Line 1455 of yacc.c */
4347 #line 1816 "program_parse.y"
4349 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4350 (yyval
.state
)[0] = state
->state_param_enum
;
4351 (yyval
.state
)[1] = STATE_LOCAL
;
4352 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4353 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4359 /* Line 1455 of yacc.c */
4360 #line 1826 "program_parse.y"
4362 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
4363 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
4366 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4372 /* Line 1455 of yacc.c */
4373 #line 1836 "program_parse.y"
4375 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
4376 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
4379 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4385 /* Line 1455 of yacc.c */
4386 #line 1851 "program_parse.y"
4388 (yyval
.vector
).count
= 4;
4389 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4390 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4391 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4392 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4398 /* Line 1455 of yacc.c */
4399 #line 1861 "program_parse.y"
4401 (yyval
.vector
).count
= 1;
4402 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4403 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4404 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4405 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4411 /* Line 1455 of yacc.c */
4412 #line 1869 "program_parse.y"
4414 (yyval
.vector
).count
= 1;
4415 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
4416 (yyval
.vector
).data
[1] = (float) (yyvsp
[(1) - (1)].integer
);
4417 (yyval
.vector
).data
[2] = (float) (yyvsp
[(1) - (1)].integer
);
4418 (yyval
.vector
).data
[3] = (float) (yyvsp
[(1) - (1)].integer
);
4424 /* Line 1455 of yacc.c */
4425 #line 1879 "program_parse.y"
4427 (yyval
.vector
).count
= 4;
4428 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
4429 (yyval
.vector
).data
[1] = 0.0f
;
4430 (yyval
.vector
).data
[2] = 0.0f
;
4431 (yyval
.vector
).data
[3] = 1.0f
;
4437 /* Line 1455 of yacc.c */
4438 #line 1887 "program_parse.y"
4440 (yyval
.vector
).count
= 4;
4441 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
4442 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
4443 (yyval
.vector
).data
[2] = 0.0f
;
4444 (yyval
.vector
).data
[3] = 1.0f
;
4450 /* Line 1455 of yacc.c */
4451 #line 1896 "program_parse.y"
4453 (yyval
.vector
).count
= 4;
4454 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
4455 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
4456 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
4457 (yyval
.vector
).data
[3] = 1.0f
;
4463 /* Line 1455 of yacc.c */
4464 #line 1905 "program_parse.y"
4466 (yyval
.vector
).count
= 4;
4467 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
4468 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
4469 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
4470 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
4476 /* Line 1455 of yacc.c */
4477 #line 1915 "program_parse.y"
4479 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
4485 /* Line 1455 of yacc.c */
4486 #line 1919 "program_parse.y"
4488 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
4494 /* Line 1455 of yacc.c */
4495 #line 1924 "program_parse.y"
4496 { (yyval
.negate
) = FALSE
; ;}
4501 /* Line 1455 of yacc.c */
4502 #line 1925 "program_parse.y"
4503 { (yyval
.negate
) = TRUE
; ;}
4508 /* Line 1455 of yacc.c */
4509 #line 1926 "program_parse.y"
4510 { (yyval
.negate
) = FALSE
; ;}
4515 /* Line 1455 of yacc.c */
4516 #line 1929 "program_parse.y"
4517 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
4522 /* Line 1455 of yacc.c */
4523 #line 1933 "program_parse.y"
4525 /* NV_fragment_program_option defines the size qualifiers in a
4526 * fairly broken way. "SHORT" or "LONG" can optionally be used
4527 * before TEMP or OUTPUT. However, neither is a reserved word!
4528 * This means that we have to parse it as an identifier, then check
4529 * to make sure it's one of the valid values. *sigh*
4531 * In addition, the grammar in the extension spec does *not* allow
4532 * the size specifier to be optional, but all known implementations
4535 if (!state
->option
.NV_fragment
) {
4536 yyerror(& (yylsp
[(1) - (1)]), state
, "unexpected IDENTIFIER");
4540 if (strcmp("SHORT", (yyvsp
[(1) - (1)].string
)) == 0) {
4541 } else if (strcmp("LONG", (yyvsp
[(1) - (1)].string
)) == 0) {
4543 char *const err_str
=
4544 make_error_string("invalid storage size specifier \"%s\"",
4545 (yyvsp
[(1) - (1)].string
));
4547 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
4548 ? err_str
: "invalid storage size specifier");
4550 if (err_str
!= NULL
) {
4561 /* Line 1455 of yacc.c */
4562 #line 1967 "program_parse.y"
4569 /* Line 1455 of yacc.c */
4570 #line 1971 "program_parse.y"
4571 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4576 /* Line 1455 of yacc.c */
4577 #line 1975 "program_parse.y"
4579 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4580 free((yyvsp
[(3) - (3)].string
));
4588 /* Line 1455 of yacc.c */
4589 #line 1982 "program_parse.y"
4591 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4592 free((yyvsp
[(1) - (1)].string
));
4600 /* Line 1455 of yacc.c */
4601 #line 1991 "program_parse.y"
4603 struct asm_symbol
*const s
=
4604 declare_variable(state
, (yyvsp
[(3) - (5)].string
), at_output
, & (yylsp
[(3) - (5)]));
4607 free((yyvsp
[(3) - (5)].string
));
4610 s
->output_binding
= (yyvsp
[(5) - (5)].result
);
4617 /* Line 1455 of yacc.c */
4618 #line 2005 "program_parse.y"
4620 if (state
->mode
== ARB_vertex
) {
4621 (yyval
.result
) = VERT_RESULT_HPOS
;
4623 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4631 /* Line 1455 of yacc.c */
4632 #line 2014 "program_parse.y"
4634 if (state
->mode
== ARB_vertex
) {
4635 (yyval
.result
) = VERT_RESULT_FOGC
;
4637 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4645 /* Line 1455 of yacc.c */
4646 #line 2023 "program_parse.y"
4648 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4654 /* Line 1455 of yacc.c */
4655 #line 2027 "program_parse.y"
4657 if (state
->mode
== ARB_vertex
) {
4658 (yyval
.result
) = VERT_RESULT_PSIZ
;
4660 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4668 /* Line 1455 of yacc.c */
4669 #line 2036 "program_parse.y"
4671 if (state
->mode
== ARB_vertex
) {
4672 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4674 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4682 /* Line 1455 of yacc.c */
4683 #line 2045 "program_parse.y"
4685 if (state
->mode
== ARB_fragment
) {
4686 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4688 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4696 /* Line 1455 of yacc.c */
4697 #line 2056 "program_parse.y"
4699 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4705 /* Line 1455 of yacc.c */
4706 #line 2062 "program_parse.y"
4708 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4710 : FRAG_RESULT_COLOR
;
4716 /* Line 1455 of yacc.c */
4717 #line 2068 "program_parse.y"
4719 if (state
->mode
== ARB_vertex
) {
4720 (yyval
.integer
) = VERT_RESULT_COL0
;
4722 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4730 /* Line 1455 of yacc.c */
4731 #line 2077 "program_parse.y"
4733 if (state
->mode
== ARB_vertex
) {
4734 (yyval
.integer
) = VERT_RESULT_BFC0
;
4736 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4744 /* Line 1455 of yacc.c */
4745 #line 2088 "program_parse.y"
4747 (yyval
.integer
) = 0;
4753 /* Line 1455 of yacc.c */
4754 #line 2092 "program_parse.y"
4756 if (state
->mode
== ARB_vertex
) {
4757 (yyval
.integer
) = 0;
4759 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4767 /* Line 1455 of yacc.c */
4768 #line 2101 "program_parse.y"
4770 if (state
->mode
== ARB_vertex
) {
4771 (yyval
.integer
) = 1;
4773 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4781 /* Line 1455 of yacc.c */
4782 #line 2111 "program_parse.y"
4783 { (yyval
.integer
) = 0; ;}
4788 /* Line 1455 of yacc.c */
4789 #line 2112 "program_parse.y"
4790 { (yyval
.integer
) = 0; ;}
4795 /* Line 1455 of yacc.c */
4796 #line 2113 "program_parse.y"
4797 { (yyval
.integer
) = 1; ;}
4802 /* Line 1455 of yacc.c */
4803 #line 2116 "program_parse.y"
4804 { (yyval
.integer
) = 0; ;}
4809 /* Line 1455 of yacc.c */
4810 #line 2117 "program_parse.y"
4811 { (yyval
.integer
) = 0; ;}
4816 /* Line 1455 of yacc.c */
4817 #line 2118 "program_parse.y"
4818 { (yyval
.integer
) = 1; ;}
4823 /* Line 1455 of yacc.c */
4824 #line 2121 "program_parse.y"
4825 { (yyval
.integer
) = 0; ;}
4830 /* Line 1455 of yacc.c */
4831 #line 2122 "program_parse.y"
4832 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4837 /* Line 1455 of yacc.c */
4838 #line 2125 "program_parse.y"
4839 { (yyval
.integer
) = 0; ;}
4844 /* Line 1455 of yacc.c */
4845 #line 2126 "program_parse.y"
4846 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4851 /* Line 1455 of yacc.c */
4852 #line 2129 "program_parse.y"
4853 { (yyval
.integer
) = 0; ;}
4858 /* Line 1455 of yacc.c */
4859 #line 2130 "program_parse.y"
4860 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4865 /* Line 1455 of yacc.c */
4866 #line 2134 "program_parse.y"
4868 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4869 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4873 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4879 /* Line 1455 of yacc.c */
4880 #line 2145 "program_parse.y"
4882 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4883 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4887 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4893 /* Line 1455 of yacc.c */
4894 #line 2156 "program_parse.y"
4896 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4897 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4901 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4907 /* Line 1455 of yacc.c */
4908 #line 2167 "program_parse.y"
4910 struct asm_symbol
*exist
= (struct asm_symbol
*)
4911 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4912 struct asm_symbol
*target
= (struct asm_symbol
*)
4913 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4915 free((yyvsp
[(4) - (4)].string
));
4917 if (exist
!= NULL
) {
4919 _mesa_snprintf(m
, sizeof(m
), "redeclared identifier: %s", (yyvsp
[(2) - (4)].string
));
4920 free((yyvsp
[(2) - (4)].string
));
4921 yyerror(& (yylsp
[(2) - (4)]), state
, m
);
4923 } else if (target
== NULL
) {
4924 free((yyvsp
[(2) - (4)].string
));
4925 yyerror(& (yylsp
[(4) - (4)]), state
,
4926 "undefined variable binding in ALIAS statement");
4929 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4936 /* Line 1455 of yacc.c */
4937 #line 4938 "program_parse.tab.c"
4940 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4944 YY_STACK_PRINT (yyss
, yyssp
);
4949 /* Now `shift' the result of the reduction. Determine what state
4950 that goes to, based on the state we popped back to and the rule
4951 number reduced by. */
4955 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4956 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4957 yystate
= yytable
[yystate
];
4959 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4964 /*------------------------------------.
4965 | yyerrlab -- here on detecting error |
4966 `------------------------------------*/
4968 /* If not already recovering from an error, report this error. */
4972 #if ! YYERROR_VERBOSE
4973 yyerror (&yylloc
, state
, YY_("syntax error"));
4976 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4977 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4979 YYSIZE_T yyalloc
= 2 * yysize
;
4980 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4981 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4982 if (yymsg
!= yymsgbuf
)
4983 YYSTACK_FREE (yymsg
);
4984 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4986 yymsg_alloc
= yyalloc
;
4990 yymsg_alloc
= sizeof yymsgbuf
;
4994 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4996 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4997 yyerror (&yylloc
, state
, yymsg
);
5001 yyerror (&yylloc
, state
, YY_("syntax error"));
5003 goto yyexhaustedlab
;
5009 yyerror_range
[0] = yylloc
;
5011 if (yyerrstatus
== 3)
5013 /* If just tried and failed to reuse lookahead token after an
5014 error, discard it. */
5016 if (yychar
<= YYEOF
)
5018 /* Return failure if at end of input. */
5019 if (yychar
== YYEOF
)
5024 yydestruct ("Error: discarding",
5025 yytoken
, &yylval
, &yylloc
, state
);
5030 /* Else will try to reuse lookahead token after shifting the error
5035 /*---------------------------------------------------.
5036 | yyerrorlab -- error raised explicitly by YYERROR. |
5037 `---------------------------------------------------*/
5040 /* Pacify compilers like GCC when the user code never invokes
5041 YYERROR and the label yyerrorlab therefore never appears in user
5043 if (/*CONSTCOND*/ 0)
5046 yyerror_range
[0] = yylsp
[1-yylen
];
5047 /* Do not reclaim the symbols of the rule which action triggered
5051 YY_STACK_PRINT (yyss
, yyssp
);
5056 /*-------------------------------------------------------------.
5057 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5058 `-------------------------------------------------------------*/
5060 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5064 yyn
= yypact
[yystate
];
5065 if (yyn
!= YYPACT_NINF
)
5068 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5076 /* Pop the current state because it cannot handle the error token. */
5080 yyerror_range
[0] = *yylsp
;
5081 yydestruct ("Error: popping",
5082 yystos
[yystate
], yyvsp
, yylsp
, state
);
5085 YY_STACK_PRINT (yyss
, yyssp
);
5090 yyerror_range
[1] = yylloc
;
5091 /* Using YYLLOC is tempting, but would change the location of
5092 the lookahead. YYLOC is available though. */
5093 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
5096 /* Shift the error token. */
5097 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5103 /*-------------------------------------.
5104 | yyacceptlab -- YYACCEPT comes here. |
5105 `-------------------------------------*/
5110 /*-----------------------------------.
5111 | yyabortlab -- YYABORT comes here. |
5112 `-----------------------------------*/
5117 #if !defined(yyoverflow) || YYERROR_VERBOSE
5118 /*-------------------------------------------------.
5119 | yyexhaustedlab -- memory exhaustion comes here. |
5120 `-------------------------------------------------*/
5122 yyerror (&yylloc
, state
, YY_("memory exhausted"));
5128 if (yychar
!= YYEMPTY
)
5129 yydestruct ("Cleanup: discarding lookahead",
5130 yytoken
, &yylval
, &yylloc
, state
);
5131 /* Do not reclaim the symbols of the rule which action triggered
5132 this YYABORT or YYACCEPT. */
5134 YY_STACK_PRINT (yyss
, yyssp
);
5135 while (yyssp
!= yyss
)
5137 yydestruct ("Cleanup: popping",
5138 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
5143 YYSTACK_FREE (yyss
);
5146 if (yymsg
!= yymsgbuf
)
5147 YYSTACK_FREE (yymsg
);
5149 /* Make sure YYID is used. */
5150 return YYID (yyresult
);
5155 /* Line 1675 of yacc.c */
5156 #line 2196 "program_parse.y"
5160 asm_instruction_set_operands(struct asm_instruction
*inst
,
5161 const struct prog_dst_register
*dst
,
5162 const struct asm_src_register
*src0
,
5163 const struct asm_src_register
*src1
,
5164 const struct asm_src_register
*src2
)
5166 /* In the core ARB extensions only the KIL instruction doesn't have a
5167 * destination register.
5170 init_dst_reg(& inst
->Base
.DstReg
);
5172 inst
->Base
.DstReg
= *dst
;
5175 /* The only instruction that doesn't have any source registers is the
5176 * condition-code based KIL instruction added by NV_fragment_program_option.
5179 inst
->Base
.SrcReg
[0] = src0
->Base
;
5180 inst
->SrcReg
[0] = *src0
;
5182 init_src_reg(& inst
->SrcReg
[0]);
5186 inst
->Base
.SrcReg
[1] = src1
->Base
;
5187 inst
->SrcReg
[1] = *src1
;
5189 init_src_reg(& inst
->SrcReg
[1]);
5193 inst
->Base
.SrcReg
[2] = src2
->Base
;
5194 inst
->SrcReg
[2] = *src2
;
5196 init_src_reg(& inst
->SrcReg
[2]);
5201 struct asm_instruction
*
5202 asm_instruction_ctor(gl_inst_opcode op
,
5203 const struct prog_dst_register
*dst
,
5204 const struct asm_src_register
*src0
,
5205 const struct asm_src_register
*src1
,
5206 const struct asm_src_register
*src2
)
5208 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5211 _mesa_init_instructions(& inst
->Base
, 1);
5212 inst
->Base
.Opcode
= op
;
5214 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5221 struct asm_instruction
*
5222 asm_instruction_copy_ctor(const struct prog_instruction
*base
,
5223 const struct prog_dst_register
*dst
,
5224 const struct asm_src_register
*src0
,
5225 const struct asm_src_register
*src1
,
5226 const struct asm_src_register
*src2
)
5228 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5231 _mesa_init_instructions(& inst
->Base
, 1);
5232 inst
->Base
.Opcode
= base
->Opcode
;
5233 inst
->Base
.CondUpdate
= base
->CondUpdate
;
5234 inst
->Base
.CondDst
= base
->CondDst
;
5235 inst
->Base
.SaturateMode
= base
->SaturateMode
;
5236 inst
->Base
.Precision
= base
->Precision
;
5238 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5246 init_dst_reg(struct prog_dst_register
*r
)
5248 memset(r
, 0, sizeof(*r
));
5249 r
->File
= PROGRAM_UNDEFINED
;
5250 r
->WriteMask
= WRITEMASK_XYZW
;
5251 r
->CondMask
= COND_TR
;
5252 r
->CondSwizzle
= SWIZZLE_NOOP
;
5256 /** Like init_dst_reg() but set the File and Index fields. */
5258 set_dst_reg(struct prog_dst_register
*r
, gl_register_file file
, GLint index
)
5260 const GLint maxIndex
= 1 << INST_INDEX_BITS
;
5261 const GLint minIndex
= 0;
5262 ASSERT(index
>= minIndex
);
5264 ASSERT(index
<= maxIndex
);
5266 ASSERT(file
== PROGRAM_TEMPORARY
||
5267 file
== PROGRAM_ADDRESS
||
5268 file
== PROGRAM_OUTPUT
);
5269 memset(r
, 0, sizeof(*r
));
5272 r
->WriteMask
= WRITEMASK_XYZW
;
5273 r
->CondMask
= COND_TR
;
5274 r
->CondSwizzle
= SWIZZLE_NOOP
;
5279 init_src_reg(struct asm_src_register
*r
)
5281 memset(r
, 0, sizeof(*r
));
5282 r
->Base
.File
= PROGRAM_UNDEFINED
;
5283 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5288 /** Like init_src_reg() but set the File and Index fields.
5289 * \return GL_TRUE if a valid src register, GL_FALSE otherwise
5292 set_src_reg(struct asm_src_register
*r
, gl_register_file file
, GLint index
)
5294 set_src_reg_swz(r
, file
, index
, SWIZZLE_XYZW
);
5299 set_src_reg_swz(struct asm_src_register
*r
, gl_register_file file
, GLint index
,
5302 const GLint maxIndex
= (1 << INST_INDEX_BITS
) - 1;
5303 const GLint minIndex
= -(1 << INST_INDEX_BITS
);
5304 ASSERT(file
< PROGRAM_FILE_MAX
);
5305 ASSERT(index
>= minIndex
);
5307 ASSERT(index
<= maxIndex
);
5309 memset(r
, 0, sizeof(*r
));
5310 r
->Base
.File
= file
;
5311 r
->Base
.Index
= index
;
5312 r
->Base
.Swizzle
= swizzle
;
5318 * Validate the set of inputs used by a program
5320 * Validates that legal sets of inputs are used by the program. In this case
5321 * "used" included both reading the input or binding the input to a name using
5322 * the \c ATTRIB command.
5325 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
5328 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
5330 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
5332 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
5333 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
5342 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
5343 struct YYLTYPE
*locp
)
5345 struct asm_symbol
*s
= NULL
;
5346 struct asm_symbol
*exist
= (struct asm_symbol
*)
5347 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
5350 if (exist
!= NULL
) {
5351 yyerror(locp
, state
, "redeclared identifier");
5353 s
= calloc(1, sizeof(struct asm_symbol
));
5359 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
5360 yyerror(locp
, state
, "too many temporaries declared");
5365 s
->temp_binding
= state
->prog
->NumTemporaries
;
5366 state
->prog
->NumTemporaries
++;
5370 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
5371 yyerror(locp
, state
, "too many address registers declared");
5376 /* FINISHME: Add support for multiple address registers.
5378 state
->prog
->NumAddressRegs
++;
5385 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
5386 s
->next
= state
->sym
;
5394 int add_state_reference(struct gl_program_parameter_list
*param_list
,
5395 const gl_state_index tokens
[STATE_LENGTH
])
5397 const GLuint size
= 4; /* XXX fix */
5401 name
= _mesa_program_state_string(tokens
);
5402 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
5403 size
, GL_NONE
, NULL
, tokens
, 0x0);
5404 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
5406 /* free name string here since we duplicated it in add_parameter() */
5414 initialize_symbol_from_state(struct gl_program
*prog
,
5415 struct asm_symbol
*param_var
,
5416 const gl_state_index tokens
[STATE_LENGTH
])
5419 gl_state_index state_tokens
[STATE_LENGTH
];
5422 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5424 param_var
->type
= at_param
;
5425 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
5427 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
5428 * unroll it and call add_state_reference() for each row
5430 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
5431 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
5432 state_tokens
[0] == STATE_MVP_MATRIX
||
5433 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
5434 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
5435 && (state_tokens
[2] != state_tokens
[3])) {
5437 const int first_row
= state_tokens
[2];
5438 const int last_row
= state_tokens
[3];
5440 for (row
= first_row
; row
<= last_row
; row
++) {
5441 state_tokens
[2] = state_tokens
[3] = row
;
5443 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5444 if (param_var
->param_binding_begin
== ~0U) {
5445 param_var
->param_binding_begin
= idx
;
5446 param_var
->param_binding_swizzle
= SWIZZLE_XYZW
;
5449 param_var
->param_binding_length
++;
5453 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5454 if (param_var
->param_binding_begin
== ~0U) {
5455 param_var
->param_binding_begin
= idx
;
5456 param_var
->param_binding_swizzle
= SWIZZLE_XYZW
;
5458 param_var
->param_binding_length
++;
5466 initialize_symbol_from_param(struct gl_program
*prog
,
5467 struct asm_symbol
*param_var
,
5468 const gl_state_index tokens
[STATE_LENGTH
])
5471 gl_state_index state_tokens
[STATE_LENGTH
];
5474 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5476 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
5477 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
5478 assert((state_tokens
[1] == STATE_ENV
)
5479 || (state_tokens
[1] == STATE_LOCAL
));
5482 * The param type is STATE_VAR. The program parameter entry will
5483 * effectively be a pointer into the LOCAL or ENV parameter array.
5485 param_var
->type
= at_param
;
5486 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
5488 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5489 * we need to unroll it and call add_state_reference() for each row
5491 if (state_tokens
[2] != state_tokens
[3]) {
5493 const int first_row
= state_tokens
[2];
5494 const int last_row
= state_tokens
[3];
5496 for (row
= first_row
; row
<= last_row
; row
++) {
5497 state_tokens
[2] = state_tokens
[3] = row
;
5499 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5500 if (param_var
->param_binding_begin
== ~0U) {
5501 param_var
->param_binding_begin
= idx
;
5502 param_var
->param_binding_swizzle
= SWIZZLE_XYZW
;
5504 param_var
->param_binding_length
++;
5508 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5509 if (param_var
->param_binding_begin
== ~0U) {
5510 param_var
->param_binding_begin
= idx
;
5511 param_var
->param_binding_swizzle
= SWIZZLE_XYZW
;
5513 param_var
->param_binding_length
++;
5521 * Put a float/vector constant/literal into the parameter list.
5522 * \param param_var returns info about the parameter/constant's location,
5523 * binding, type, etc.
5524 * \param vec the vector/constant to add
5525 * \param allowSwizzle if true, try to consolidate constants which only differ
5526 * by a swizzle. We don't want to do this when building
5527 * arrays of constants that may be indexed indirectly.
5528 * \return index of the constant in the parameter list.
5531 initialize_symbol_from_const(struct gl_program
*prog
,
5532 struct asm_symbol
*param_var
,
5533 const struct asm_vector
*vec
,
5534 GLboolean allowSwizzle
)
5537 const int idx
= _mesa_add_unnamed_constant(prog
->Parameters
,
5538 vec
->data
, vec
->count
,
5539 allowSwizzle
? &swizzle
: NULL
);
5541 param_var
->type
= at_param
;
5542 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
5544 if (param_var
->param_binding_begin
== ~0U) {
5545 param_var
->param_binding_begin
= idx
;
5546 param_var
->param_binding_swizzle
= allowSwizzle
? swizzle
: SWIZZLE_XYZW
;
5548 param_var
->param_binding_length
++;
5555 make_error_string(const char *fmt
, ...)
5562 /* Call vsnprintf once to determine how large the final string is. Call it
5563 * again to do the actual formatting. from the vsnprintf manual page:
5565 * Upon successful return, these functions return the number of
5566 * characters printed (not including the trailing '\0' used to end
5567 * output to strings).
5569 va_start(args
, fmt
);
5570 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
5573 str
= malloc(length
);
5575 va_start(args
, fmt
);
5576 vsnprintf(str
, length
, fmt
, args
);
5585 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
5590 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
5592 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, "%s", err_str
);
5596 err_str
= make_error_string("line %u, char %u: error: %s\n",
5597 locp
->first_line
, locp
->first_column
, s
);
5598 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
5607 _mesa_parse_arb_program(struct gl_context
*ctx
, GLenum target
, const GLubyte
*str
,
5608 GLsizei len
, struct asm_parser_state
*state
)
5610 struct asm_instruction
*inst
;
5613 GLboolean result
= GL_FALSE
;
5615 struct asm_symbol
*sym
;
5618 state
->prog
->Target
= target
;
5619 state
->prog
->Parameters
= _mesa_new_parameter_list();
5621 /* Make a copy of the program string and force it to be NUL-terminated.
5623 strz
= (GLubyte
*) malloc(len
+ 1);
5625 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5628 memcpy (strz
, str
, len
);
5631 state
->prog
->String
= strz
;
5633 state
->st
= _mesa_symbol_table_ctor();
5635 state
->limits
= (target
== GL_VERTEX_PROGRAM_ARB
)
5636 ? & ctx
->Const
.VertexProgram
5637 : & ctx
->Const
.FragmentProgram
;
5639 state
->MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
5640 state
->MaxTextureCoordUnits
= ctx
->Const
.MaxTextureCoordUnits
;
5641 state
->MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
5642 state
->MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
5643 state
->MaxLights
= ctx
->Const
.MaxLights
;
5644 state
->MaxProgramMatrices
= ctx
->Const
.MaxProgramMatrices
;
5646 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
5647 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
5649 _mesa_set_program_error(ctx
, -1, NULL
);
5651 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
5653 _mesa_program_lexer_dtor(state
->scanner
);
5656 if (ctx
->Program
.ErrorPos
!= -1) {
5660 if (! _mesa_layout_parameters(state
)) {
5664 loc
.first_column
= 0;
5667 yyerror(& loc
, state
, "invalid PARAM usage");
5673 /* Add one instruction to store the "END" instruction.
5675 state
->prog
->Instructions
=
5676 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5677 inst
= state
->inst_head
;
5678 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5679 struct asm_instruction
*const temp
= inst
->next
;
5681 state
->prog
->Instructions
[i
] = inst
->Base
;
5685 /* Finally, tag on an OPCODE_END instruction */
5687 const GLuint numInst
= state
->prog
->NumInstructions
;
5688 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5689 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5691 state
->prog
->NumInstructions
++;
5693 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5694 state
->prog
->NumAttributes
= _mesa_bitcount(state
->prog
->InputsRead
);
5697 * Initialize native counts to logical counts. The device driver may
5698 * change them if program is translated into a hardware program.
5700 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5701 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5702 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5703 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5704 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5709 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5714 state
->inst_head
= NULL
;
5715 state
->inst_tail
= NULL
;
5717 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5720 free((void *) sym
->name
);
5725 _mesa_symbol_table_dtor(state
->st
);