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"
102 #include "prog_parameter.h"
103 #include "prog_parameter_layout.h"
104 #include "prog_statevars.h"
105 #include "prog_instruction.h"
107 #include "symbol_table.h"
108 #include "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
);
128 static int yyparse(struct asm_parser_state
*state
);
130 static char *make_error_string(const char *fmt
, ...);
132 static void yyerror(struct YYLTYPE
*locp
, struct asm_parser_state
*state
,
135 static int validate_inputs(struct YYLTYPE
*locp
,
136 struct asm_parser_state
*state
);
138 static void init_dst_reg(struct prog_dst_register
*r
);
140 static void set_dst_reg(struct prog_dst_register
*r
,
141 gl_register_file file
, GLint index
);
143 static void init_src_reg(struct asm_src_register
*r
);
145 static void set_src_reg(struct asm_src_register
*r
,
146 gl_register_file file
, GLint index
);
148 static void asm_instruction_set_operands(struct asm_instruction
*inst
,
149 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
150 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
152 static struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
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_copy_ctor(
157 const struct prog_instruction
*base
, const struct prog_dst_register
*dst
,
158 const struct asm_src_register
*src0
, const struct asm_src_register
*src1
,
159 const struct asm_src_register
*src2
);
163 #define TRUE (!FALSE)
166 #define YYLLOC_DEFAULT(Current, Rhs, N) \
169 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
170 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
171 (Current).position = YYRHSLOC(Rhs, 1).position; \
172 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
173 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
175 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
176 (Current).last_line = (Current).first_line; \
177 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
178 (Current).last_column = (Current).first_column; \
179 (Current).position = YYRHSLOC(Rhs, 0).position \
180 + (Current).first_column; \
184 #define YYLEX_PARAM state->scanner
187 /* Line 189 of yacc.c */
188 #line 189 "program_parse.tab.c"
190 /* Enabling traces. */
195 /* Enabling verbose error messages. */
196 #ifdef YYERROR_VERBOSE
197 # undef YYERROR_VERBOSE
198 # define YYERROR_VERBOSE 1
200 # define YYERROR_VERBOSE 1
203 /* Enabling the token table. */
204 #ifndef YYTOKEN_TABLE
205 # define YYTOKEN_TABLE 0
212 /* Put the tokens into the symbol table, so that GDB and other debuggers
303 TEX_SHADOWRECT
= 346,
306 TEX_ARRAYSHADOW1D
= 349,
307 TEX_ARRAYSHADOW2D
= 350,
312 USED_IDENTIFIER
= 355,
325 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
326 typedef union YYSTYPE
329 /* Line 214 of yacc.c */
330 #line 122 "program_parse.y"
332 struct asm_instruction
*inst
;
333 struct asm_symbol
*sym
;
334 struct asm_symbol temp_sym
;
335 struct asm_swizzle_mask swiz_mask
;
336 struct asm_src_register src_reg
;
337 struct prog_dst_register dst_reg
;
338 struct prog_instruction temp_inst
;
344 gl_state_index state
[STATE_LENGTH
];
346 struct asm_vector vector
;
347 gl_inst_opcode opcode
;
351 unsigned rgba_valid
:1;
352 unsigned xyzw_valid
:1;
358 /* Line 214 of yacc.c */
359 #line 360 "program_parse.tab.c"
361 # define YYSTYPE_IS_TRIVIAL 1
362 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
363 # define YYSTYPE_IS_DECLARED 1
366 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
367 typedef struct YYLTYPE
374 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
375 # define YYLTYPE_IS_DECLARED 1
376 # define YYLTYPE_IS_TRIVIAL 1
380 /* Copy the second part of user declarations. */
382 /* Line 264 of yacc.c */
383 #line 267 "program_parse.y"
385 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
389 /* Line 264 of yacc.c */
390 #line 391 "program_parse.tab.c"
397 typedef YYTYPE_UINT8 yytype_uint8
;
399 typedef unsigned char yytype_uint8
;
403 typedef YYTYPE_INT8 yytype_int8
;
404 #elif (defined __STDC__ || defined __C99__FUNC__ \
405 || defined __cplusplus || defined _MSC_VER)
406 typedef signed char yytype_int8
;
408 typedef short int yytype_int8
;
412 typedef YYTYPE_UINT16 yytype_uint16
;
414 typedef unsigned short int yytype_uint16
;
418 typedef YYTYPE_INT16 yytype_int16
;
420 typedef short int yytype_int16
;
424 # ifdef __SIZE_TYPE__
425 # define YYSIZE_T __SIZE_TYPE__
426 # elif defined size_t
427 # define YYSIZE_T size_t
428 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
429 || defined __cplusplus || defined _MSC_VER)
430 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
431 # define YYSIZE_T size_t
433 # define YYSIZE_T unsigned int
437 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
442 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
443 # define YY_(msgid) dgettext ("bison-runtime", msgid)
447 # define YY_(msgid) msgid
451 /* Suppress unused-variable warnings by "using" E. */
452 #if ! defined lint || defined __GNUC__
453 # define YYUSE(e) ((void) (e))
455 # define YYUSE(e) /* empty */
458 /* Identity function, used to suppress warnings about constant conditions. */
462 #if (defined __STDC__ || defined __C99__FUNC__ \
463 || defined __cplusplus || defined _MSC_VER)
476 #if ! defined yyoverflow || YYERROR_VERBOSE
478 /* The parser invokes alloca or malloc; define the necessary symbols. */
480 # ifdef YYSTACK_USE_ALLOCA
481 # if YYSTACK_USE_ALLOCA
483 # define YYSTACK_ALLOC __builtin_alloca
484 # elif defined __BUILTIN_VA_ARG_INCR
485 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
487 # define YYSTACK_ALLOC __alloca
488 # elif defined _MSC_VER
489 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
490 # define alloca _alloca
492 # define YYSTACK_ALLOC alloca
493 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
494 || defined __cplusplus || defined _MSC_VER)
495 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
504 # ifdef YYSTACK_ALLOC
505 /* Pacify GCC's `empty if-body' warning. */
506 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
507 # ifndef YYSTACK_ALLOC_MAXIMUM
508 /* The OS might guarantee only one guard page at the bottom of the stack,
509 and a page size can be as small as 4096 bytes. So we cannot safely
510 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
511 to allow for a few compiler-allocated temporary stack slots. */
512 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
515 # define YYSTACK_ALLOC YYMALLOC
516 # define YYSTACK_FREE YYFREE
517 # ifndef YYSTACK_ALLOC_MAXIMUM
518 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
520 # if (defined __cplusplus && ! defined _STDLIB_H \
521 && ! ((defined YYMALLOC || defined malloc) \
522 && (defined YYFREE || defined free)))
523 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
529 # define YYMALLOC malloc
530 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
531 || defined __cplusplus || defined _MSC_VER)
532 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
537 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
538 || defined __cplusplus || defined _MSC_VER)
539 void free (void *); /* INFRINGES ON USER NAME SPACE */
543 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
546 #if (! defined yyoverflow \
547 && (! defined __cplusplus \
548 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
549 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
551 /* A type that is properly aligned for any stack member. */
554 yytype_int16 yyss_alloc
;
559 /* The size of the maximum gap between one aligned stack and the next. */
560 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
562 /* The size of an array large to enough to hold all stacks, each with
564 # define YYSTACK_BYTES(N) \
565 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
566 + 2 * YYSTACK_GAP_MAXIMUM)
568 /* Copy COUNT objects from FROM to TO. The source and destination do
571 # if defined __GNUC__ && 1 < __GNUC__
572 # define YYCOPY(To, From, Count) \
573 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
575 # define YYCOPY(To, From, Count) \
579 for (yyi = 0; yyi < (Count); yyi++) \
580 (To)[yyi] = (From)[yyi]; \
586 /* Relocate STACK from its old location to the new one. The
587 local variables YYSIZE and YYSTACKSIZE give the old and new number of
588 elements in the stack, and YYPTR gives the new location of the
589 stack. Advance YYPTR to a properly aligned location for the next
591 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
594 YYSIZE_T yynewbytes; \
595 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
596 Stack = &yyptr->Stack_alloc; \
597 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
598 yyptr += yynewbytes / sizeof (*yyptr); \
604 /* YYFINAL -- State number of the termination state. */
606 /* YYLAST -- Last index in YYTABLE. */
609 /* YYNTOKENS -- Number of terminals. */
610 #define YYNTOKENS 120
611 /* YYNNTS -- Number of nonterminals. */
613 /* YYNRULES -- Number of rules. */
615 /* YYNRULES -- Number of states. */
616 #define YYNSTATES 475
618 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
620 #define YYMAXUTOK 362
622 #define YYTRANSLATE(YYX) \
623 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
625 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
626 static const yytype_uint8 yytranslate
[] =
628 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 115, 116, 2, 113, 109, 114, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 108,
634 2, 117, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 111, 2, 112, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 118, 110, 119, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
654 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
655 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
656 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
657 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
658 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
659 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
660 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
661 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
662 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
663 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
668 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
670 static const yytype_uint16 yyprhs
[] =
672 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
673 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
674 46, 48, 50, 52, 54, 59, 64, 69, 76, 83,
675 92, 101, 104, 107, 120, 123, 125, 127, 129, 131,
676 133, 135, 137, 139, 141, 143, 145, 147, 154, 157,
677 162, 165, 167, 171, 177, 181, 184, 192, 195, 197,
678 199, 201, 203, 208, 210, 212, 214, 216, 218, 220,
679 222, 226, 227, 230, 233, 235, 237, 239, 241, 243,
680 245, 247, 249, 251, 252, 254, 256, 258, 260, 261,
681 265, 269, 270, 273, 276, 278, 280, 282, 284, 286,
682 288, 290, 292, 297, 300, 303, 305, 308, 310, 313,
683 315, 318, 323, 328, 330, 331, 335, 337, 339, 342,
684 344, 347, 349, 351, 355, 362, 363, 365, 368, 373,
685 375, 379, 381, 383, 385, 387, 389, 391, 393, 395,
686 397, 399, 402, 405, 408, 411, 414, 417, 420, 423,
687 426, 429, 432, 435, 439, 441, 443, 445, 451, 453,
688 455, 457, 460, 462, 464, 467, 469, 472, 479, 481,
689 485, 487, 489, 491, 493, 495, 500, 502, 504, 506,
690 508, 510, 512, 515, 517, 519, 525, 527, 530, 532,
691 534, 540, 543, 544, 551, 555, 556, 558, 560, 562,
692 564, 566, 569, 571, 573, 576, 581, 586, 587, 591,
693 593, 595, 597, 600, 602, 604, 606, 608, 614, 616,
694 620, 626, 632, 634, 638, 644, 646, 648, 650, 652,
695 654, 656, 658, 660, 662, 666, 672, 680, 690, 693,
696 696, 698, 700, 701, 702, 707, 709, 710, 711, 715,
697 719, 721, 727, 730, 733, 736, 739, 743, 746, 750,
698 751, 753, 755, 756, 758, 760, 761, 763, 765, 766,
699 768, 770, 771, 775, 776, 780, 781, 785, 787, 789,
703 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
704 static const yytype_int16 yyrhs
[] =
706 121, 0, -1, 122, 123, 125, 12, -1, 3, -1,
707 4, -1, 123, 124, -1, -1, 8, 262, 108, -1,
708 125, 126, -1, -1, 127, 108, -1, 170, 108, -1,
709 128, -1, 129, -1, 130, -1, 131, -1, 132, -1,
710 133, -1, 134, -1, 135, -1, 141, -1, 136, -1,
711 137, -1, 138, -1, 19, 146, 109, 142, -1, 18,
712 145, 109, 144, -1, 16, 145, 109, 142, -1, 14,
713 145, 109, 142, 109, 142, -1, 13, 145, 109, 144,
714 109, 144, -1, 17, 145, 109, 144, 109, 144, 109,
715 144, -1, 15, 145, 109, 144, 109, 139, 109, 140,
716 -1, 20, 144, -1, 20, 166, -1, 22, 145, 109,
717 144, 109, 144, 109, 144, 109, 139, 109, 140, -1,
718 83, 256, -1, 84, -1, 85, -1, 86, -1, 87,
719 -1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
720 -1, 93, -1, 94, -1, 95, -1, 21, 145, 109,
721 150, 109, 147, -1, 241, 143, -1, 241, 110, 143,
722 110, -1, 150, 162, -1, 238, -1, 241, 150, 163,
723 -1, 241, 110, 150, 163, 110, -1, 151, 164, 165,
724 -1, 159, 161, -1, 148, 109, 148, 109, 148, 109,
725 148, -1, 241, 149, -1, 23, -1, 262, -1, 100,
726 -1, 172, -1, 152, 111, 153, 112, -1, 186, -1,
727 249, -1, 100, -1, 100, -1, 154, -1, 155, -1,
728 23, -1, 159, 160, 156, -1, -1, 113, 157, -1,
729 114, 158, -1, 23, -1, 23, -1, 100, -1, 104,
730 -1, 104, -1, 104, -1, 104, -1, 101, -1, 105,
731 -1, -1, 101, -1, 102, -1, 103, -1, 104, -1,
732 -1, 115, 166, 116, -1, 115, 167, 116, -1, -1,
733 168, 163, -1, 169, 163, -1, 99, -1, 100, -1,
734 171, -1, 178, -1, 242, -1, 245, -1, 248, -1,
735 261, -1, 7, 99, 117, 172, -1, 96, 173, -1,
736 38, 177, -1, 60, -1, 98, 175, -1, 53, -1,
737 29, 254, -1, 37, -1, 74, 255, -1, 50, 111,
738 176, 112, -1, 97, 111, 174, 112, -1, 23, -1,
739 -1, 111, 176, 112, -1, 23, -1, 60, -1, 29,
740 254, -1, 37, -1, 74, 255, -1, 179, -1, 180,
741 -1, 10, 99, 182, -1, 10, 99, 111, 181, 112,
742 183, -1, -1, 23, -1, 117, 185, -1, 117, 118,
743 184, 119, -1, 187, -1, 184, 109, 187, -1, 189,
744 -1, 225, -1, 235, -1, 189, -1, 225, -1, 236,
745 -1, 188, -1, 226, -1, 235, -1, 189, -1, 73,
746 213, -1, 73, 190, -1, 73, 192, -1, 73, 195,
747 -1, 73, 197, -1, 73, 203, -1, 73, 199, -1,
748 73, 206, -1, 73, 208, -1, 73, 210, -1, 73,
749 212, -1, 73, 224, -1, 47, 253, 191, -1, 201,
750 -1, 33, -1, 69, -1, 43, 111, 202, 112, 193,
751 -1, 201, -1, 60, -1, 26, -1, 72, 194, -1,
752 40, -1, 32, -1, 44, 196, -1, 25, -1, 253,
753 67, -1, 45, 111, 202, 112, 253, 198, -1, 201,
754 -1, 75, 257, 200, -1, 29, -1, 25, -1, 31,
755 -1, 71, -1, 23, -1, 76, 255, 204, 205, -1,
756 35, -1, 54, -1, 79, -1, 80, -1, 78, -1,
757 77, -1, 36, 207, -1, 29, -1, 56, -1, 28,
758 111, 209, 112, 57, -1, 23, -1, 58, 211, -1,
759 70, -1, 26, -1, 215, 66, 111, 218, 112, -1,
760 215, 214, -1, -1, 66, 111, 218, 106, 218, 112,
761 -1, 49, 219, 216, -1, -1, 217, -1, 41, -1,
762 82, -1, 42, -1, 23, -1, 51, 220, -1, 63,
763 -1, 52, -1, 81, 255, -1, 55, 111, 222, 112,
764 -1, 48, 111, 223, 112, -1, -1, 111, 221, 112,
765 -1, 23, -1, 23, -1, 23, -1, 30, 64, -1,
766 229, -1, 232, -1, 227, -1, 230, -1, 62, 34,
767 111, 228, 112, -1, 233, -1, 233, 106, 233, -1,
768 62, 34, 111, 233, 112, -1, 62, 46, 111, 231,
769 112, -1, 234, -1, 234, 106, 234, -1, 62, 46,
770 111, 234, 112, -1, 23, -1, 23, -1, 237, -1,
771 239, -1, 238, -1, 239, -1, 240, -1, 24, -1,
772 23, -1, 118, 240, 119, -1, 118, 240, 109, 240,
773 119, -1, 118, 240, 109, 240, 109, 240, 119, -1,
774 118, 240, 109, 240, 109, 240, 109, 240, 119, -1,
775 241, 24, -1, 241, 23, -1, 113, -1, 114, -1,
776 -1, -1, 244, 11, 243, 247, -1, 262, -1, -1,
777 -1, 5, 246, 247, -1, 247, 109, 99, -1, 99,
778 -1, 244, 9, 99, 117, 249, -1, 65, 60, -1,
779 65, 37, -1, 65, 250, -1, 65, 59, -1, 65,
780 74, 255, -1, 65, 30, -1, 29, 251, 252, -1,
781 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
782 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
783 -1, 111, 258, 112, -1, -1, 111, 259, 112, -1,
784 -1, 111, 260, 112, -1, 23, -1, 23, -1, 23,
785 -1, 6, 99, 117, 100, -1, 99, -1, 100, -1
788 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
789 static const yytype_uint16 yyrline
[] =
791 0, 274, 274, 277, 285, 297, 298, 301, 325, 326,
792 329, 344, 347, 352, 359, 360, 361, 362, 363, 364,
793 365, 368, 369, 370, 373, 379, 385, 391, 398, 404,
794 411, 455, 460, 470, 514, 520, 521, 522, 523, 524,
795 525, 526, 527, 528, 529, 530, 531, 534, 546, 554,
796 571, 578, 595, 606, 626, 651, 658, 691, 698, 713,
797 768, 809, 818, 839, 848, 852, 881, 900, 900, 902,
798 909, 921, 922, 923, 926, 940, 954, 974, 985, 997,
799 999, 1000, 1001, 1002, 1005, 1005, 1005, 1005, 1006, 1009,
800 1013, 1018, 1025, 1032, 1039, 1062, 1085, 1086, 1087, 1088,
801 1089, 1090, 1093, 1112, 1116, 1122, 1126, 1130, 1134, 1143,
802 1152, 1156, 1161, 1167, 1178, 1178, 1179, 1181, 1185, 1189,
803 1193, 1199, 1199, 1201, 1218, 1243, 1246, 1257, 1263, 1269,
804 1270, 1277, 1283, 1289, 1297, 1303, 1309, 1317, 1323, 1329,
805 1337, 1338, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348,
806 1349, 1350, 1351, 1354, 1363, 1367, 1371, 1377, 1386, 1390,
807 1394, 1403, 1407, 1413, 1419, 1426, 1431, 1439, 1449, 1451,
808 1459, 1465, 1469, 1473, 1479, 1490, 1499, 1503, 1508, 1512,
809 1516, 1520, 1526, 1533, 1537, 1543, 1551, 1562, 1569, 1573,
810 1579, 1589, 1600, 1604, 1622, 1631, 1634, 1640, 1644, 1648,
811 1654, 1665, 1670, 1675, 1680, 1685, 1690, 1698, 1701, 1706,
812 1719, 1727, 1738, 1746, 1746, 1748, 1748, 1750, 1760, 1765,
813 1772, 1782, 1791, 1796, 1803, 1813, 1823, 1835, 1835, 1836,
814 1836, 1838, 1848, 1856, 1866, 1874, 1882, 1891, 1902, 1906,
815 1912, 1913, 1914, 1917, 1917, 1920, 1955, 1959, 1959, 1962,
816 1969, 1978, 1992, 2001, 2010, 2014, 2023, 2032, 2043, 2050,
817 2055, 2064, 2076, 2079, 2088, 2099, 2100, 2101, 2104, 2105,
818 2106, 2109, 2110, 2113, 2114, 2117, 2118, 2121, 2132, 2143,
823 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
824 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
825 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
826 static const char *const yytname
[] =
828 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
829 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
830 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
831 "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION",
832 "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION",
833 "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
834 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
835 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
836 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE",
837 "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
838 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK", "SPECULAR", "SPOT",
839 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
840 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
841 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D",
842 "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D",
843 "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB",
844 "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2",
845 "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'",
846 "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program",
847 "language", "optionSequence", "option", "statementSequence", "statement",
848 "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction",
849 "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction",
850 "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction",
851 "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget",
852 "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg",
853 "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp",
854 "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem",
855 "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset",
856 "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent",
857 "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask",
858 "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2",
859 "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem",
860 "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem",
861 "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt",
862 "optArraySize", "paramSingleInit", "paramMultipleInit",
863 "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse",
864 "paramMultipleItem", "stateMultipleItem", "stateSingleItem",
865 "stateMaterialItem", "stateMatProperty", "stateLightItem",
866 "stateLightProperty", "stateSpotProperty", "stateLightModelItem",
867 "stateLModProperty", "stateLightProdItem", "stateLProdProperty",
868 "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty",
869 "stateLightNumber", "stateTexGenItem", "stateTexGenType",
870 "stateTexGenCoord", "stateFogItem", "stateFogProperty",
871 "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem",
872 "statePointProperty", "stateMatrixRow", "stateMatrixRows",
873 "optMatrixRows", "stateMatrixItem", "stateOptMatModifier",
874 "stateMatModifier", "stateMatrixRowNum", "stateMatrixName",
875 "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum",
876 "stateProgramMatNum", "stateDepthItem", "programSingleItem",
877 "programMultipleItem", "progEnvParams", "progEnvParamNums",
878 "progEnvParam", "progLocalParams", "progLocalParamNums",
879 "progLocalParam", "progEnvParamNum", "progLocalParamNum",
880 "paramConstDecl", "paramConstUse", "paramConstScalarDecl",
881 "paramConstScalarUse", "paramConstVector", "signedFloatConstant",
882 "optionalSign", "TEMP_statement", "@1", "optVarSize",
883 "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement",
884 "resultBinding", "resultColBinding", "optResultFaceType",
885 "optResultColorType", "optFaceType", "optColorType",
886 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
887 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
888 "ALIAS_statement", "string", 0
893 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
895 static const yytype_uint16 yytoknum
[] =
897 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
898 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
899 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
900 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
901 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
902 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
903 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
904 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
905 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
906 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
907 355, 356, 357, 358, 359, 360, 361, 362, 59, 44,
908 124, 91, 93, 43, 45, 40, 41, 61, 123, 125
912 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
913 static const yytype_uint16 yyr1
[] =
915 0, 120, 121, 122, 122, 123, 123, 124, 125, 125,
916 126, 126, 127, 127, 128, 128, 128, 128, 128, 128,
917 128, 129, 129, 129, 130, 131, 132, 133, 134, 135,
918 136, 137, 137, 138, 139, 140, 140, 140, 140, 140,
919 140, 140, 140, 140, 140, 140, 140, 141, 142, 142,
920 143, 143, 144, 144, 145, 146, 147, 148, 149, 149,
921 150, 150, 150, 150, 151, 151, 152, 153, 153, 154,
922 155, 156, 156, 156, 157, 158, 159, 160, 161, 162,
923 163, 163, 163, 163, 164, 164, 164, 164, 164, 165,
924 165, 165, 166, 167, 168, 169, 170, 170, 170, 170,
925 170, 170, 171, 172, 172, 173, 173, 173, 173, 173,
926 173, 173, 173, 174, 175, 175, 176, 177, 177, 177,
927 177, 178, 178, 179, 180, 181, 181, 182, 183, 184,
928 184, 185, 185, 185, 186, 186, 186, 187, 187, 187,
929 188, 188, 189, 189, 189, 189, 189, 189, 189, 189,
930 189, 189, 189, 190, 191, 191, 191, 192, 193, 193,
931 193, 193, 193, 194, 195, 196, 196, 197, 198, 199,
932 200, 201, 201, 201, 202, 203, 204, 204, 205, 205,
933 205, 205, 206, 207, 207, 208, 209, 210, 211, 211,
934 212, 213, 214, 214, 215, 216, 216, 217, 217, 217,
935 218, 219, 219, 219, 219, 219, 219, 220, 220, 221,
936 222, 223, 224, 225, 225, 226, 226, 227, 228, 228,
937 229, 230, 231, 231, 232, 233, 234, 235, 235, 236,
938 236, 237, 238, 238, 239, 239, 239, 239, 240, 240,
939 241, 241, 241, 243, 242, 244, 244, 246, 245, 247,
940 247, 248, 249, 249, 249, 249, 249, 249, 250, 251,
941 251, 251, 252, 252, 252, 253, 253, 253, 254, 254,
942 254, 255, 255, 256, 256, 257, 257, 258, 259, 260,
946 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
947 static const yytype_uint8 yyr2
[] =
949 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
950 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
951 1, 1, 1, 1, 4, 4, 4, 6, 6, 8,
952 8, 2, 2, 12, 2, 1, 1, 1, 1, 1,
953 1, 1, 1, 1, 1, 1, 1, 6, 2, 4,
954 2, 1, 3, 5, 3, 2, 7, 2, 1, 1,
955 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
956 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
957 1, 1, 1, 0, 1, 1, 1, 1, 0, 3,
958 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
959 1, 1, 4, 2, 2, 1, 2, 1, 2, 1,
960 2, 4, 4, 1, 0, 3, 1, 1, 2, 1,
961 2, 1, 1, 3, 6, 0, 1, 2, 4, 1,
962 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
963 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
964 2, 2, 2, 3, 1, 1, 1, 5, 1, 1,
965 1, 2, 1, 1, 2, 1, 2, 6, 1, 3,
966 1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
967 1, 1, 2, 1, 1, 5, 1, 2, 1, 1,
968 5, 2, 0, 6, 3, 0, 1, 1, 1, 1,
969 1, 2, 1, 1, 2, 4, 4, 0, 3, 1,
970 1, 1, 2, 1, 1, 1, 1, 5, 1, 3,
971 5, 5, 1, 3, 5, 1, 1, 1, 1, 1,
972 1, 1, 1, 1, 3, 5, 7, 9, 2, 2,
973 1, 1, 0, 0, 4, 1, 0, 0, 3, 3,
974 1, 5, 2, 2, 2, 2, 3, 2, 3, 0,
975 1, 1, 0, 1, 1, 0, 1, 1, 0, 1,
976 1, 0, 3, 0, 3, 0, 3, 1, 1, 1,
980 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
981 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
982 means the default is an error. */
983 static const yytype_uint16 yydefact
[] =
985 0, 3, 4, 0, 6, 1, 9, 0, 5, 246,
986 281, 282, 0, 247, 0, 0, 0, 2, 0, 0,
987 0, 0, 0, 0, 0, 242, 0, 0, 8, 0,
988 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
989 23, 20, 0, 96, 97, 121, 122, 98, 0, 99,
990 100, 101, 245, 7, 0, 0, 0, 0, 0, 65,
991 0, 88, 64, 0, 0, 0, 0, 0, 76, 0,
992 0, 94, 240, 241, 31, 32, 83, 0, 0, 0,
993 10, 11, 0, 243, 250, 248, 0, 0, 125, 242,
994 123, 259, 257, 253, 255, 252, 271, 254, 242, 84,
995 85, 86, 87, 91, 242, 242, 242, 242, 242, 242,
996 78, 55, 81, 80, 82, 92, 233, 232, 0, 0,
997 0, 0, 60, 0, 242, 83, 0, 61, 63, 134,
998 135, 213, 214, 136, 229, 230, 0, 242, 0, 0,
999 0, 280, 102, 126, 0, 127, 131, 132, 133, 227,
1000 228, 231, 0, 261, 260, 262, 0, 256, 0, 0,
1001 54, 0, 0, 0, 26, 0, 25, 24, 268, 119,
1002 117, 271, 104, 0, 0, 0, 0, 0, 0, 265,
1003 0, 265, 0, 0, 275, 271, 142, 143, 144, 145,
1004 147, 146, 148, 149, 150, 151, 0, 152, 268, 109,
1005 0, 107, 105, 271, 0, 114, 103, 83, 0, 52,
1006 0, 0, 0, 0, 244, 249, 0, 239, 238, 263,
1007 264, 258, 277, 0, 242, 95, 0, 0, 83, 242,
1008 0, 48, 0, 51, 0, 242, 269, 270, 118, 120,
1009 0, 0, 0, 212, 183, 184, 182, 0, 165, 267,
1010 266, 164, 0, 0, 0, 0, 207, 203, 0, 202,
1011 271, 195, 189, 188, 187, 0, 0, 0, 0, 108,
1012 0, 110, 0, 0, 106, 0, 242, 234, 69, 0,
1013 67, 68, 0, 242, 242, 251, 0, 124, 272, 28,
1014 89, 90, 93, 27, 0, 79, 50, 273, 0, 0,
1015 225, 0, 226, 0, 186, 0, 174, 0, 166, 0,
1016 171, 172, 155, 156, 173, 153, 154, 0, 0, 201,
1017 0, 204, 197, 199, 198, 194, 196, 279, 0, 170,
1018 169, 176, 177, 0, 0, 116, 0, 113, 0, 0,
1019 53, 0, 62, 77, 71, 47, 0, 0, 0, 242,
1020 49, 0, 34, 0, 242, 220, 224, 0, 0, 265,
1021 211, 0, 209, 0, 210, 0, 276, 181, 180, 178,
1022 179, 175, 200, 0, 111, 112, 115, 242, 235, 0,
1023 0, 70, 242, 58, 57, 59, 242, 0, 0, 0,
1024 129, 137, 140, 138, 215, 216, 139, 278, 0, 35,
1025 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
1026 46, 30, 29, 185, 160, 162, 159, 0, 157, 158,
1027 0, 206, 208, 205, 190, 0, 74, 72, 75, 73,
1028 0, 0, 0, 0, 141, 192, 242, 128, 274, 163,
1029 161, 167, 168, 242, 236, 242, 0, 0, 0, 0,
1030 191, 130, 0, 0, 0, 0, 218, 0, 222, 0,
1031 237, 242, 0, 217, 0, 221, 0, 0, 56, 33,
1035 /* YYDEFGOTO[NTERM-NUM]. */
1036 static const yytype_int16 yydefgoto
[] =
1038 -1, 3, 4, 6, 8, 9, 28, 29, 30, 31,
1039 32, 33, 34, 35, 36, 37, 38, 39, 40, 298,
1040 411, 41, 161, 231, 74, 60, 69, 345, 346, 384,
1041 232, 61, 126, 279, 280, 281, 381, 427, 429, 70,
1042 344, 111, 296, 115, 103, 160, 75, 227, 76, 228,
1043 42, 43, 127, 206, 338, 274, 336, 172, 44, 45,
1044 46, 144, 90, 287, 389, 145, 128, 390, 391, 129,
1045 186, 315, 187, 418, 440, 188, 251, 189, 441, 190,
1046 330, 316, 307, 191, 333, 371, 192, 246, 193, 305,
1047 194, 264, 195, 434, 450, 196, 325, 326, 373, 261,
1048 319, 363, 365, 361, 197, 130, 393, 394, 455, 131,
1049 395, 457, 132, 301, 303, 396, 133, 149, 134, 135,
1050 151, 77, 47, 139, 48, 49, 54, 85, 50, 62,
1051 97, 155, 221, 252, 238, 157, 352, 266, 223, 398,
1055 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1057 #define YYPACT_NINF -401
1058 static const yytype_int16 yypact
[] =
1060 193, -401, -401, 27, -401, -401, 62, 143, -401, 24,
1061 -401, -401, -30, -401, -18, 12, 83, -401, 15, 15,
1062 15, 15, 15, 15, 67, 61, 15, 15, -401, 127,
1063 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1064 -401, -401, 144, -401, -401, -401, -401, -401, 204, -401,
1065 -401, -401, -401, -401, 155, 136, 138, 34, 140, -401,
1066 147, 108, -401, 150, 156, 157, 158, 160, -401, 162,
1067 159, -401, -401, -401, -401, -401, 102, -13, 163, 164,
1068 -401, -401, 165, -401, -401, 166, 170, 10, 235, 0,
1069 -401, 141, -401, -401, -401, -401, 167, -401, 131, -401,
1070 -401, -401, -401, 168, 131, 131, 131, 131, 131, 131,
1071 -401, -401, -401, -401, -401, -401, -401, -401, 104, 97,
1072 114, 38, 169, 30, 131, 102, 171, -401, -401, -401,
1073 -401, -401, -401, -401, -401, -401, 30, 131, 172, 155,
1074 175, -401, -401, -401, 173, -401, -401, -401, -401, -401,
1075 -401, -401, 223, -401, -401, 123, 253, -401, 177, 149,
1076 -401, 178, -10, 181, -401, 182, -401, -401, 134, -401,
1077 -401, 167, -401, 183, 184, 185, 213, 99, 186, 154,
1078 187, 146, 153, 7, 188, 167, -401, -401, -401, -401,
1079 -401, -401, -401, -401, -401, -401, 215, -401, 134, -401,
1080 190, -401, -401, 167, 191, 192, -401, 102, -48, -401,
1081 1, 195, 196, 214, 166, -401, 189, -401, -401, -401,
1082 -401, -401, -401, 180, 131, -401, 194, 197, 102, 131,
1083 30, -401, 203, 205, 201, 131, -401, -401, -401, -401,
1084 285, 288, 289, -401, -401, -401, -401, 291, -401, -401,
1085 -401, -401, 248, 291, 33, 206, 207, -401, 208, -401,
1086 167, 14, -401, -401, -401, 293, 292, 92, 209, -401,
1087 299, -401, 301, 299, -401, 216, 131, -401, -401, 217,
1088 -401, -401, 221, 131, 131, -401, 212, -401, -401, -401,
1089 -401, -401, -401, -401, 218, -401, -401, 220, 224, 225,
1090 -401, 226, -401, 227, -401, 228, -401, 230, -401, 231,
1091 -401, -401, -401, -401, -401, -401, -401, 304, 309, -401,
1092 312, -401, -401, -401, -401, -401, -401, -401, 232, -401,
1093 -401, -401, -401, 161, 313, -401, 233, -401, 234, 238,
1094 -401, 13, -401, -401, 137, -401, 242, -15, 243, 3,
1095 -401, 314, -401, 133, 131, -401, -401, 296, 94, 146,
1096 -401, 245, -401, 246, -401, 247, -401, -401, -401, -401,
1097 -401, -401, -401, 249, -401, -401, -401, 131, -401, 332,
1098 337, -401, 131, -401, -401, -401, 131, 142, 114, 28,
1099 -401, -401, -401, -401, -401, -401, -401, -401, 250, -401,
1100 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1101 -401, -401, -401, -401, -401, -401, -401, 331, -401, -401,
1102 68, -401, -401, -401, -401, 43, -401, -401, -401, -401,
1103 255, 256, 257, 258, -401, 300, 3, -401, -401, -401,
1104 -401, -401, -401, 131, -401, 131, 201, 285, 288, 259,
1105 -401, -401, 252, 264, 265, 263, 261, 266, 270, 313,
1106 -401, 131, 133, -401, 285, -401, 288, 80, -401, -401,
1107 -401, -401, 313, 267, -401
1110 /* YYPGOTO[NTERM-NUM]. */
1111 static const yytype_int16 yypgoto
[] =
1113 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1114 -401, -401, -401, -401, -401, -401, -401, -401, -401, -69,
1115 -82, -401, -100, 151, -86, 210, -401, -401, -366, -401,
1116 -54, -401, -401, -401, -401, -401, -401, -401, -401, 174,
1117 -401, -401, -401, -118, -401, -401, 229, -401, -401, -401,
1118 -401, -401, 295, -401, -401, -401, 110, -401, -401, -401,
1119 -401, -401, -401, -401, -401, -401, -401, -51, -401, -88,
1120 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1121 -401, -311, 139, -401, -401, -401, -401, -401, -401, -401,
1122 -401, -401, -401, -401, -401, -2, -401, -401, -400, -401,
1123 -401, -401, -401, -401, -401, 298, -401, -401, -401, -401,
1124 -401, -401, -401, -390, -295, 302, -401, -401, -136, -87,
1125 -120, -89, -401, -401, -401, -401, -401, 251, -401, 176,
1126 -401, -401, -401, -176, 198, -153, -401, -401, -401, -401,
1130 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1131 positive, shift that token. If negative, reduce the rule which
1132 number is the opposite. If zero, do what YYDEFACT says.
1133 If YYTABLE_NINF, syntax error. */
1134 #define YYTABLE_NINF -230
1135 static const yytype_int16 yytable
[] =
1137 152, 146, 150, 52, 208, 254, 164, 209, 383, 167,
1138 116, 117, 158, 116, 117, 162, 430, 162, 239, 163,
1139 162, 165, 166, 125, 278, 118, 233, 5, 118, 13,
1140 14, 15, 267, 262, 16, 152, 17, 18, 19, 20,
1141 21, 22, 23, 24, 25, 26, 27, 419, 118, 119,
1142 271, 212, 119, 116, 117, 322, 323, 456, 310, 467,
1143 120, 276, 119, 120, 311, 387, 312, 198, 118, 207,
1144 7, 277, 473, 120, 470, 199, 388, 263, 53, 453,
1145 58, 55, 211, 121, 10, 11, 121, 122, 200, 275,
1146 122, 201, 119, 310, 233, 468, 324, 123, 202, 311,
1147 230, 68, 313, 120, 314, 124, 121, 321, 124, 442,
1148 292, 56, 203, 72, 73, 59, 72, 73, 124, 310,
1149 414, 124, 377, 10, 11, 311, 121, 331, 244, 293,
1150 122, 173, 378, 168, 415, 204, 205, 436, 289, 314,
1151 162, 169, 175, 174, 176, 88, 332, 437, 124, 299,
1152 177, 89, 443, 458, 416, 245, 341, 178, 179, 180,
1153 71, 181, 444, 182, 170, 314, 417, 68, 153, 91,
1154 92, 471, 183, 249, 72, 73, 432, 93, 171, 248,
1155 154, 249, 57, 420, 219, 250, 472, 152, 433, 184,
1156 185, 220, 424, 250, 347, 236, 1, 2, 348, 94,
1157 95, 255, 237, 112, 256, 257, 113, 114, 258, 99,
1158 100, 101, 102, 82, 96, 83, 259, 399, 400, 401,
1159 402, 403, 404, 405, 406, 407, 408, 409, 410, 63,
1160 64, 65, 66, 67, 260, 80, 78, 79, 367, 368,
1161 369, 370, 10, 11, 72, 73, 217, 218, 71, 225,
1162 379, 380, 81, 86, 84, 87, 98, 425, 143, 104,
1163 152, 392, 150, 110, 138, 105, 106, 107, 412, 108,
1164 141, 109, 136, 137, 215, 140, 222, 243, 156, 58,
1165 -66, 268, 210, 159, 297, 216, 224, 229, 152, 213,
1166 234, 235, 288, 347, 240, 241, 242, 247, 253, 265,
1167 431, 270, 272, 273, 283, 284, 286, 295, 300, -229,
1168 290, 302, 304, 291, 306, 308, 327, 317, 318, 320,
1169 334, 329, 335, 452, 337, 343, 340, 360, 350, 342,
1170 349, 351, 362, 353, 354, 364, 372, 397, 355, 356,
1171 357, 385, 358, 359, 366, 374, 375, 152, 392, 150,
1172 376, 382, 386, 413, 152, 426, 347, 421, 422, 423,
1173 428, 424, 438, 439, 445, 446, 449, 464, 447, 448,
1174 459, 460, 347, 461, 462, 463, 466, 454, 465, 474,
1175 469, 294, 142, 339, 282, 451, 435, 147, 226, 285,
1176 214, 148, 309, 0, 0, 0, 269
1179 static const yytype_int16 yycheck
[] =
1181 89, 89, 89, 9, 124, 181, 106, 125, 23, 109,
1182 23, 24, 98, 23, 24, 104, 382, 106, 171, 105,
1183 109, 107, 108, 77, 23, 38, 162, 0, 38, 5,
1184 6, 7, 185, 26, 10, 124, 12, 13, 14, 15,
1185 16, 17, 18, 19, 20, 21, 22, 358, 38, 62,
1186 203, 137, 62, 23, 24, 41, 42, 447, 25, 459,
1187 73, 109, 62, 73, 31, 62, 33, 29, 38, 123,
1188 8, 119, 472, 73, 464, 37, 73, 70, 108, 445,
1189 65, 99, 136, 96, 99, 100, 96, 100, 50, 207,
1190 100, 53, 62, 25, 230, 461, 82, 110, 60, 31,
1191 110, 100, 69, 73, 71, 118, 96, 260, 118, 420,
1192 228, 99, 74, 113, 114, 100, 113, 114, 118, 25,
1193 26, 118, 109, 99, 100, 31, 96, 35, 29, 229,
1194 100, 34, 119, 29, 40, 97, 98, 109, 224, 71,
1195 229, 37, 28, 46, 30, 111, 54, 119, 118, 235,
1196 36, 117, 109, 448, 60, 56, 276, 43, 44, 45,
1197 99, 47, 119, 49, 60, 71, 72, 100, 27, 29,
1198 30, 466, 58, 27, 113, 114, 34, 37, 74, 25,
1199 39, 27, 99, 359, 61, 39, 106, 276, 46, 75,
1200 76, 68, 112, 39, 283, 61, 3, 4, 284, 59,
1201 60, 48, 68, 101, 51, 52, 104, 105, 55, 101,
1202 102, 103, 104, 9, 74, 11, 63, 84, 85, 86,
1203 87, 88, 89, 90, 91, 92, 93, 94, 95, 19,
1204 20, 21, 22, 23, 81, 108, 26, 27, 77, 78,
1205 79, 80, 99, 100, 113, 114, 23, 24, 99, 100,
1206 113, 114, 108, 117, 99, 117, 109, 377, 23, 109,
1207 349, 349, 349, 104, 99, 109, 109, 109, 354, 109,
1208 100, 109, 109, 109, 99, 109, 23, 64, 111, 65,
1209 111, 66, 111, 115, 83, 112, 109, 109, 377, 117,
1210 109, 109, 112, 382, 111, 111, 111, 111, 111, 111,
1211 386, 111, 111, 111, 109, 109, 117, 104, 23, 104,
1212 116, 23, 23, 116, 23, 67, 23, 111, 111, 111,
1213 111, 29, 23, 443, 23, 104, 110, 23, 110, 112,
1214 118, 111, 23, 109, 109, 23, 23, 23, 112, 112,
1215 112, 347, 112, 112, 112, 112, 112, 436, 436, 436,
1216 112, 109, 109, 57, 443, 23, 445, 112, 112, 112,
1217 23, 112, 112, 32, 109, 109, 66, 106, 111, 111,
1218 111, 119, 461, 109, 109, 112, 106, 446, 112, 112,
1219 462, 230, 87, 273, 210, 436, 388, 89, 159, 213,
1220 139, 89, 253, -1, -1, -1, 198
1223 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1224 symbol of state STATE-NUM. */
1225 static const yytype_uint16 yystos
[] =
1227 0, 3, 4, 121, 122, 0, 123, 8, 124, 125,
1228 99, 100, 262, 5, 6, 7, 10, 12, 13, 14,
1229 15, 16, 17, 18, 19, 20, 21, 22, 126, 127,
1230 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1231 138, 141, 170, 171, 178, 179, 180, 242, 244, 245,
1232 248, 261, 262, 108, 246, 99, 99, 99, 65, 100,
1233 145, 151, 249, 145, 145, 145, 145, 145, 100, 146,
1234 159, 99, 113, 114, 144, 166, 168, 241, 145, 145,
1235 108, 108, 9, 11, 99, 247, 117, 117, 111, 117,
1236 182, 29, 30, 37, 59, 60, 74, 250, 109, 101,
1237 102, 103, 104, 164, 109, 109, 109, 109, 109, 109,
1238 104, 161, 101, 104, 105, 163, 23, 24, 38, 62,
1239 73, 96, 100, 110, 118, 150, 152, 172, 186, 189,
1240 225, 229, 232, 236, 238, 239, 109, 109, 99, 243,
1241 109, 100, 172, 23, 181, 185, 189, 225, 235, 237,
1242 239, 240, 241, 27, 39, 251, 111, 255, 144, 115,
1243 165, 142, 241, 144, 142, 144, 144, 142, 29, 37,
1244 60, 74, 177, 34, 46, 28, 30, 36, 43, 44,
1245 45, 47, 49, 58, 75, 76, 190, 192, 195, 197,
1246 199, 203, 206, 208, 210, 212, 215, 224, 29, 37,
1247 50, 53, 60, 74, 97, 98, 173, 150, 240, 163,
1248 111, 150, 144, 117, 247, 99, 112, 23, 24, 61,
1249 68, 252, 23, 258, 109, 100, 166, 167, 169, 109,
1250 110, 143, 150, 238, 109, 109, 61, 68, 254, 255,
1251 111, 111, 111, 64, 29, 56, 207, 111, 25, 27,
1252 39, 196, 253, 111, 253, 48, 51, 52, 55, 63,
1253 81, 219, 26, 70, 211, 111, 257, 255, 66, 254,
1254 111, 255, 111, 111, 175, 163, 109, 119, 23, 153,
1255 154, 155, 159, 109, 109, 249, 117, 183, 112, 144,
1256 116, 116, 163, 142, 143, 104, 162, 83, 139, 144,
1257 23, 233, 23, 234, 23, 209, 23, 202, 67, 202,
1258 25, 31, 33, 69, 71, 191, 201, 111, 111, 220,
1259 111, 255, 41, 42, 82, 216, 217, 23, 260, 29,
1260 200, 35, 54, 204, 111, 23, 176, 23, 174, 176,
1261 110, 240, 112, 104, 160, 147, 148, 241, 144, 118,
1262 110, 111, 256, 109, 109, 112, 112, 112, 112, 112,
1263 23, 223, 23, 221, 23, 222, 112, 77, 78, 79,
1264 80, 205, 23, 218, 112, 112, 112, 109, 119, 113,
1265 114, 156, 109, 23, 149, 262, 109, 62, 73, 184,
1266 187, 188, 189, 226, 227, 230, 235, 23, 259, 84,
1267 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1268 95, 140, 144, 57, 26, 40, 60, 72, 193, 201,
1269 253, 112, 112, 112, 112, 240, 23, 157, 23, 158,
1270 148, 144, 34, 46, 213, 215, 109, 119, 112, 32,
1271 194, 198, 201, 109, 119, 109, 109, 111, 111, 66,
1272 214, 187, 240, 148, 139, 228, 233, 231, 234, 111,
1273 119, 109, 109, 112, 106, 112, 106, 218, 148, 140,
1274 233, 234, 106, 218, 112
1277 #define yyerrok (yyerrstatus = 0)
1278 #define yyclearin (yychar = YYEMPTY)
1279 #define YYEMPTY (-2)
1282 #define YYACCEPT goto yyacceptlab
1283 #define YYABORT goto yyabortlab
1284 #define YYERROR goto yyerrorlab
1287 /* Like YYERROR except do call yyerror. This remains here temporarily
1288 to ease the transition to the new meaning of YYERROR, for GCC.
1289 Once GCC version 2 has supplanted version 1, this can go. */
1291 #define YYFAIL goto yyerrlab
1293 #define YYRECOVERING() (!!yyerrstatus)
1295 #define YYBACKUP(Token, Value) \
1297 if (yychar == YYEMPTY && yylen == 1) \
1301 yytoken = YYTRANSLATE (yychar); \
1307 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1314 #define YYERRCODE 256
1317 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1318 If N is 0, then set CURRENT to the empty location which ends
1319 the previous symbol: RHS[0] (always defined). */
1321 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1322 #ifndef YYLLOC_DEFAULT
1323 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1327 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1328 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1329 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1330 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1334 (Current).first_line = (Current).last_line = \
1335 YYRHSLOC (Rhs, 0).last_line; \
1336 (Current).first_column = (Current).last_column = \
1337 YYRHSLOC (Rhs, 0).last_column; \
1343 /* YY_LOCATION_PRINT -- Print the location on the stream.
1344 This macro was not mandated originally: define only if we know
1345 we won't break user code: when these are the locations we know. */
1347 #ifndef YY_LOCATION_PRINT
1348 # if YYLTYPE_IS_TRIVIAL
1349 # define YY_LOCATION_PRINT(File, Loc) \
1350 fprintf (File, "%d.%d-%d.%d", \
1351 (Loc).first_line, (Loc).first_column, \
1352 (Loc).last_line, (Loc).last_column)
1354 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1359 /* YYLEX -- calling `yylex' with the right arguments. */
1362 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1364 # define YYLEX yylex (&yylval, &yylloc, scanner)
1367 /* Enable debugging if requested. */
1371 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1372 # define YYFPRINTF fprintf
1375 # define YYDPRINTF(Args) \
1381 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1385 YYFPRINTF (stderr, "%s ", Title); \
1386 yy_symbol_print (stderr, \
1387 Type, Value, Location, state); \
1388 YYFPRINTF (stderr, "\n"); \
1393 /*--------------------------------.
1394 | Print this symbol on YYOUTPUT. |
1395 `--------------------------------*/
1398 #if (defined __STDC__ || defined __C99__FUNC__ \
1399 || defined __cplusplus || defined _MSC_VER)
1401 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1404 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1407 YYSTYPE
const * const yyvaluep
;
1408 YYLTYPE
const * const yylocationp
;
1409 struct asm_parser_state
*state
;
1414 YYUSE (yylocationp
);
1417 if (yytype
< YYNTOKENS
)
1418 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1430 /*--------------------------------.
1431 | Print this symbol on YYOUTPUT. |
1432 `--------------------------------*/
1434 #if (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
1437 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1440 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1443 YYSTYPE
const * const yyvaluep
;
1444 YYLTYPE
const * const yylocationp
;
1445 struct asm_parser_state
*state
;
1448 if (yytype
< YYNTOKENS
)
1449 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1451 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1453 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1454 YYFPRINTF (yyoutput
, ": ");
1455 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1456 YYFPRINTF (yyoutput
, ")");
1459 /*------------------------------------------------------------------.
1460 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1462 `------------------------------------------------------------------*/
1464 #if (defined __STDC__ || defined __C99__FUNC__ \
1465 || defined __cplusplus || defined _MSC_VER)
1467 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1470 yy_stack_print (yybottom
, yytop
)
1471 yytype_int16
*yybottom
;
1472 yytype_int16
*yytop
;
1475 YYFPRINTF (stderr
, "Stack now");
1476 for (; yybottom
<= yytop
; yybottom
++)
1478 int yybot
= *yybottom
;
1479 YYFPRINTF (stderr
, " %d", yybot
);
1481 YYFPRINTF (stderr
, "\n");
1484 # define YY_STACK_PRINT(Bottom, Top) \
1487 yy_stack_print ((Bottom), (Top)); \
1491 /*------------------------------------------------.
1492 | Report that the YYRULE is going to be reduced. |
1493 `------------------------------------------------*/
1495 #if (defined __STDC__ || defined __C99__FUNC__ \
1496 || defined __cplusplus || defined _MSC_VER)
1498 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1501 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1505 struct asm_parser_state
*state
;
1508 int yynrhs
= yyr2
[yyrule
];
1510 unsigned long int yylno
= yyrline
[yyrule
];
1511 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1513 /* The symbols being reduced. */
1514 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1516 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1517 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1518 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1519 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1520 YYFPRINTF (stderr
, "\n");
1524 # define YY_REDUCE_PRINT(Rule) \
1527 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1530 /* Nonzero means print parse trace. It is left uninitialized so that
1531 multiple parsers can coexist. */
1533 #else /* !YYDEBUG */
1534 # define YYDPRINTF(Args)
1535 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1536 # define YY_STACK_PRINT(Bottom, Top)
1537 # define YY_REDUCE_PRINT(Rule)
1538 #endif /* !YYDEBUG */
1541 /* YYINITDEPTH -- initial size of the parser's stacks. */
1543 # define YYINITDEPTH 200
1546 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1547 if the built-in stack extension method is used).
1549 Do not make this value too large; the results are undefined if
1550 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1551 evaluated with infinite-precision integer arithmetic. */
1554 # define YYMAXDEPTH 10000
1562 # if defined __GLIBC__ && defined _STRING_H
1563 # define yystrlen strlen
1565 /* Return the length of YYSTR. */
1566 #if (defined __STDC__ || defined __C99__FUNC__ \
1567 || defined __cplusplus || defined _MSC_VER)
1569 yystrlen (const char *yystr
)
1577 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1585 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1586 # define yystpcpy stpcpy
1588 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1590 #if (defined __STDC__ || defined __C99__FUNC__ \
1591 || defined __cplusplus || defined _MSC_VER)
1593 yystpcpy (char *yydest
, const char *yysrc
)
1596 yystpcpy (yydest
, yysrc
)
1602 const char *yys
= yysrc
;
1604 while ((*yyd
++ = *yys
++) != '\0')
1613 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1614 quotes and backslashes, so that it's suitable for yyerror. The
1615 heuristic is that double-quoting is unnecessary unless the string
1616 contains an apostrophe, a comma, or backslash (other than
1617 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1618 null, do not copy; instead, return the length of what the result
1621 yytnamerr (char *yyres
, const char *yystr
)
1626 char const *yyp
= yystr
;
1633 goto do_not_strip_quotes
;
1637 goto do_not_strip_quotes
;
1650 do_not_strip_quotes
: ;
1654 return yystrlen (yystr
);
1656 return yystpcpy (yyres
, yystr
) - yyres
;
1660 /* Copy into YYRESULT an error message about the unexpected token
1661 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1662 including the terminating null byte. If YYRESULT is null, do not
1663 copy anything; just return the number of bytes that would be
1664 copied. As a special case, return 0 if an ordinary "syntax error"
1665 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1666 size calculation. */
1668 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1670 int yyn
= yypact
[yystate
];
1672 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1676 int yytype
= YYTRANSLATE (yychar
);
1677 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1678 YYSIZE_T yysize
= yysize0
;
1680 int yysize_overflow
= 0;
1681 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1682 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1686 /* This is so xgettext sees the translatable formats that are
1687 constructed on the fly. */
1688 YY_("syntax error, unexpected %s");
1689 YY_("syntax error, unexpected %s, expecting %s");
1690 YY_("syntax error, unexpected %s, expecting %s or %s");
1691 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1692 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1696 static char const yyunexpected
[] = "syntax error, unexpected %s";
1697 static char const yyexpecting
[] = ", expecting %s";
1698 static char const yyor
[] = " or %s";
1699 char yyformat
[sizeof yyunexpected
1700 + sizeof yyexpecting
- 1
1701 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1702 * (sizeof yyor
- 1))];
1703 char const *yyprefix
= yyexpecting
;
1705 /* Start YYX at -YYN if negative to avoid negative indexes in
1707 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1709 /* Stay within bounds of both yycheck and yytname. */
1710 int yychecklim
= YYLAST
- yyn
+ 1;
1711 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1714 yyarg
[0] = yytname
[yytype
];
1715 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1717 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1718 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1720 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1724 yyformat
[sizeof yyunexpected
- 1] = '\0';
1727 yyarg
[yycount
++] = yytname
[yyx
];
1728 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1729 yysize_overflow
|= (yysize1
< yysize
);
1731 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1735 yyf
= YY_(yyformat
);
1736 yysize1
= yysize
+ yystrlen (yyf
);
1737 yysize_overflow
|= (yysize1
< yysize
);
1740 if (yysize_overflow
)
1741 return YYSIZE_MAXIMUM
;
1745 /* Avoid sprintf, as that infringes on the user's name space.
1746 Don't have undefined behavior even if the translation
1747 produced a string with the wrong number of "%s"s. */
1748 char *yyp
= yyresult
;
1750 while ((*yyp
= *yyf
) != '\0')
1752 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1754 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1767 #endif /* YYERROR_VERBOSE */
1770 /*-----------------------------------------------.
1771 | Release the memory associated to this symbol. |
1772 `-----------------------------------------------*/
1775 #if (defined __STDC__ || defined __C99__FUNC__ \
1776 || defined __cplusplus || defined _MSC_VER)
1778 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1781 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1785 YYLTYPE
*yylocationp
;
1786 struct asm_parser_state
*state
;
1790 YYUSE (yylocationp
);
1795 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1805 /* Prevent warnings from -Wmissing-prototypes. */
1806 #ifdef YYPARSE_PARAM
1807 #if defined __STDC__ || defined __cplusplus
1808 int yyparse (void *YYPARSE_PARAM
);
1812 #else /* ! YYPARSE_PARAM */
1813 #if defined __STDC__ || defined __cplusplus
1814 int yyparse (struct asm_parser_state
*state
);
1818 #endif /* ! YYPARSE_PARAM */
1824 /*-------------------------.
1825 | yyparse or yypush_parse. |
1826 `-------------------------*/
1828 #ifdef YYPARSE_PARAM
1829 #if (defined __STDC__ || defined __C99__FUNC__ \
1830 || defined __cplusplus || defined _MSC_VER)
1832 yyparse (void *YYPARSE_PARAM
)
1835 yyparse (YYPARSE_PARAM
)
1836 void *YYPARSE_PARAM
;
1838 #else /* ! YYPARSE_PARAM */
1839 #if (defined __STDC__ || defined __C99__FUNC__ \
1840 || defined __cplusplus || defined _MSC_VER)
1842 yyparse (struct asm_parser_state
*state
)
1846 struct asm_parser_state
*state
;
1850 /* The lookahead symbol. */
1853 /* The semantic value of the lookahead symbol. */
1856 /* Location data for the lookahead symbol. */
1859 /* Number of syntax errors so far. */
1863 /* Number of tokens to shift before error messages enabled. */
1866 /* The stacks and their tools:
1867 `yyss': related to states.
1868 `yyvs': related to semantic values.
1869 `yyls': related to locations.
1871 Refer to the stacks thru separate pointers, to allow yyoverflow
1872 to reallocate them elsewhere. */
1874 /* The state stack. */
1875 yytype_int16 yyssa
[YYINITDEPTH
];
1877 yytype_int16
*yyssp
;
1879 /* The semantic value stack. */
1880 YYSTYPE yyvsa
[YYINITDEPTH
];
1884 /* The location stack. */
1885 YYLTYPE yylsa
[YYINITDEPTH
];
1889 /* The locations where the error started and ended. */
1890 YYLTYPE yyerror_range
[2];
1892 YYSIZE_T yystacksize
;
1896 /* Lookahead token as an internal (translated) token number. */
1898 /* The variables used to return semantic value and location from the
1904 /* Buffer for error messages, and its allocated size. */
1906 char *yymsg
= yymsgbuf
;
1907 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1910 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1912 /* The number of symbols on the RHS of the reduced rule.
1913 Keep to zero when no symbol should be popped. */
1920 yystacksize
= YYINITDEPTH
;
1922 YYDPRINTF ((stderr
, "Starting parse\n"));
1927 yychar
= YYEMPTY
; /* Cause a token to be read. */
1929 /* Initialize stack pointers.
1930 Waste one element of value and location stack
1931 so that they stay on the same level as the state stack.
1932 The wasted elements are never initialized. */
1937 #if YYLTYPE_IS_TRIVIAL
1938 /* Initialize the default location before parsing starts. */
1939 yylloc
.first_line
= yylloc
.last_line
= 1;
1940 yylloc
.first_column
= yylloc
.last_column
= 1;
1945 /*------------------------------------------------------------.
1946 | yynewstate -- Push a new state, which is found in yystate. |
1947 `------------------------------------------------------------*/
1949 /* In all cases, when you get here, the value and location stacks
1950 have just been pushed. So pushing a state here evens the stacks. */
1956 if (yyss
+ yystacksize
- 1 <= yyssp
)
1958 /* Get the current used size of the three stacks, in elements. */
1959 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1963 /* Give user a chance to reallocate the stack. Use copies of
1964 these so that the &'s don't force the real ones into
1966 YYSTYPE
*yyvs1
= yyvs
;
1967 yytype_int16
*yyss1
= yyss
;
1968 YYLTYPE
*yyls1
= yyls
;
1970 /* Each stack pointer address is followed by the size of the
1971 data in use in that stack, in bytes. This used to be a
1972 conditional around just the two extra args, but that might
1973 be undefined if yyoverflow is a macro. */
1974 yyoverflow (YY_("memory exhausted"),
1975 &yyss1
, yysize
* sizeof (*yyssp
),
1976 &yyvs1
, yysize
* sizeof (*yyvsp
),
1977 &yyls1
, yysize
* sizeof (*yylsp
),
1984 #else /* no yyoverflow */
1985 # ifndef YYSTACK_RELOCATE
1986 goto yyexhaustedlab
;
1988 /* Extend the stack our own way. */
1989 if (YYMAXDEPTH
<= yystacksize
)
1990 goto yyexhaustedlab
;
1992 if (YYMAXDEPTH
< yystacksize
)
1993 yystacksize
= YYMAXDEPTH
;
1996 yytype_int16
*yyss1
= yyss
;
1997 union yyalloc
*yyptr
=
1998 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2000 goto yyexhaustedlab
;
2001 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2002 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2003 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
2004 # undef YYSTACK_RELOCATE
2006 YYSTACK_FREE (yyss1
);
2009 #endif /* no yyoverflow */
2011 yyssp
= yyss
+ yysize
- 1;
2012 yyvsp
= yyvs
+ yysize
- 1;
2013 yylsp
= yyls
+ yysize
- 1;
2015 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2016 (unsigned long int) yystacksize
));
2018 if (yyss
+ yystacksize
- 1 <= yyssp
)
2022 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2024 if (yystate
== YYFINAL
)
2034 /* Do appropriate processing given the current state. Read a
2035 lookahead token if we need one and don't already have one. */
2037 /* First try to decide what to do without reference to lookahead token. */
2038 yyn
= yypact
[yystate
];
2039 if (yyn
== YYPACT_NINF
)
2042 /* Not known => get a lookahead token if don't already have one. */
2044 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2045 if (yychar
== YYEMPTY
)
2047 YYDPRINTF ((stderr
, "Reading a token: "));
2051 if (yychar
<= YYEOF
)
2053 yychar
= yytoken
= YYEOF
;
2054 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2058 yytoken
= YYTRANSLATE (yychar
);
2059 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2062 /* If the proper action on seeing token YYTOKEN is to reduce or to
2063 detect an error, take that action. */
2065 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2070 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2076 /* Count tokens shifted since error; after three, turn off error
2081 /* Shift the lookahead token. */
2082 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2084 /* Discard the shifted token. */
2093 /*-----------------------------------------------------------.
2094 | yydefault -- do the default action for the current state. |
2095 `-----------------------------------------------------------*/
2097 yyn
= yydefact
[yystate
];
2103 /*-----------------------------.
2104 | yyreduce -- Do a reduction. |
2105 `-----------------------------*/
2107 /* yyn is the number of a rule to reduce with. */
2110 /* If YYLEN is nonzero, implement the default value of the action:
2113 Otherwise, the following line sets YYVAL to garbage.
2114 This behavior is undocumented and Bison
2115 users should not rely upon it. Assigning to YYVAL
2116 unconditionally makes the parser a bit smaller, and it avoids a
2117 GCC warning that YYVAL may be used uninitialized. */
2118 yyval
= yyvsp
[1-yylen
];
2120 /* Default location. */
2121 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2122 YY_REDUCE_PRINT (yyn
);
2127 /* Line 1455 of yacc.c */
2128 #line 278 "program_parse.y"
2130 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2131 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2134 state
->mode
= ARB_vertex
;
2140 /* Line 1455 of yacc.c */
2141 #line 286 "program_parse.y"
2143 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2144 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2146 state
->mode
= ARB_fragment
;
2148 state
->option
.TexRect
=
2149 (state
->ctx
->Extensions
.NV_texture_rectangle
!= GL_FALSE
);
2155 /* Line 1455 of yacc.c */
2156 #line 302 "program_parse.y"
2160 if (state
->mode
== ARB_vertex
) {
2161 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2162 } else if (state
->mode
== ARB_fragment
) {
2163 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2167 free((yyvsp
[(2) - (3)].string
));
2170 const char *const err_str
= (state
->mode
== ARB_vertex
)
2171 ? "invalid ARB vertex program option"
2172 : "invalid ARB fragment program option";
2174 yyerror(& (yylsp
[(2) - (3)]), state
, err_str
);
2182 /* Line 1455 of yacc.c */
2183 #line 330 "program_parse.y"
2185 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2186 if (state
->inst_tail
== NULL
) {
2187 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2189 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2192 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2193 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2195 state
->prog
->NumInstructions
++;
2202 /* Line 1455 of yacc.c */
2203 #line 348 "program_parse.y"
2205 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2206 state
->prog
->NumAluInstructions
++;
2212 /* Line 1455 of yacc.c */
2213 #line 353 "program_parse.y"
2215 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2216 state
->prog
->NumTexInstructions
++;
2222 /* Line 1455 of yacc.c */
2223 #line 374 "program_parse.y"
2225 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2231 /* Line 1455 of yacc.c */
2232 #line 380 "program_parse.y"
2234 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2240 /* Line 1455 of yacc.c */
2241 #line 386 "program_parse.y"
2243 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2249 /* Line 1455 of yacc.c */
2250 #line 392 "program_parse.y"
2252 (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
);
2258 /* Line 1455 of yacc.c */
2259 #line 399 "program_parse.y"
2261 (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
);
2267 /* Line 1455 of yacc.c */
2268 #line 406 "program_parse.y"
2270 (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
));
2276 /* Line 1455 of yacc.c */
2277 #line 412 "program_parse.y"
2279 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (8)].temp_inst
), & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2280 if ((yyval
.inst
) != NULL
) {
2281 const GLbitfield tex_mask
= (1U << (yyvsp
[(6) - (8)].integer
));
2282 GLbitfield shadow_tex
= 0;
2283 GLbitfield target_mask
= 0;
2286 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2288 if ((yyvsp
[(8) - (8)].integer
) < 0) {
2289 shadow_tex
= tex_mask
;
2291 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(8) - (8)].integer
);
2292 (yyval
.inst
)->Base
.TexShadow
= 1;
2294 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2297 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2299 /* If this texture unit was previously accessed and that access
2300 * had a different texture target, generate an error.
2302 * If this texture unit was previously accessed and that access
2303 * had a different shadow mode, generate an error.
2305 if ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != 0)
2306 && ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != target_mask
)
2307 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2309 yyerror(& (yylsp
[(8) - (8)]), state
,
2310 "multiple targets used on one texture image unit");
2315 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= target_mask
;
2316 state
->prog
->ShadowSamplers
|= shadow_tex
;
2323 /* Line 1455 of yacc.c */
2324 #line 456 "program_parse.y"
2326 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2327 state
->fragment
.UsesKill
= 1;
2333 /* Line 1455 of yacc.c */
2334 #line 461 "program_parse.y"
2336 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL_NV
, NULL
, NULL
, NULL
, NULL
);
2337 (yyval
.inst
)->Base
.DstReg
.CondMask
= (yyvsp
[(2) - (2)].dst_reg
).CondMask
;
2338 (yyval
.inst
)->Base
.DstReg
.CondSwizzle
= (yyvsp
[(2) - (2)].dst_reg
).CondSwizzle
;
2339 (yyval
.inst
)->Base
.DstReg
.CondSrc
= (yyvsp
[(2) - (2)].dst_reg
).CondSrc
;
2340 state
->fragment
.UsesKill
= 1;
2346 /* Line 1455 of yacc.c */
2347 #line 471 "program_parse.y"
2349 (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
));
2350 if ((yyval
.inst
) != NULL
) {
2351 const GLbitfield tex_mask
= (1U << (yyvsp
[(10) - (12)].integer
));
2352 GLbitfield shadow_tex
= 0;
2353 GLbitfield target_mask
= 0;
2356 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(10) - (12)].integer
);
2358 if ((yyvsp
[(12) - (12)].integer
) < 0) {
2359 shadow_tex
= tex_mask
;
2361 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(12) - (12)].integer
);
2362 (yyval
.inst
)->Base
.TexShadow
= 1;
2364 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(12) - (12)].integer
);
2367 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2369 /* If this texture unit was previously accessed and that access
2370 * had a different texture target, generate an error.
2372 * If this texture unit was previously accessed and that access
2373 * had a different shadow mode, generate an error.
2375 if ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != 0)
2376 && ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != target_mask
)
2377 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2379 yyerror(& (yylsp
[(12) - (12)]), state
,
2380 "multiple targets used on one texture image unit");
2385 state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] |= target_mask
;
2386 state
->prog
->ShadowSamplers
|= shadow_tex
;
2393 /* Line 1455 of yacc.c */
2394 #line 515 "program_parse.y"
2396 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2402 /* Line 1455 of yacc.c */
2403 #line 520 "program_parse.y"
2404 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2409 /* Line 1455 of yacc.c */
2410 #line 521 "program_parse.y"
2411 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2416 /* Line 1455 of yacc.c */
2417 #line 522 "program_parse.y"
2418 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2423 /* Line 1455 of yacc.c */
2424 #line 523 "program_parse.y"
2425 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2430 /* Line 1455 of yacc.c */
2431 #line 524 "program_parse.y"
2432 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2437 /* Line 1455 of yacc.c */
2438 #line 525 "program_parse.y"
2439 { (yyval
.integer
) = -TEXTURE_1D_INDEX
; ;}
2444 /* Line 1455 of yacc.c */
2445 #line 526 "program_parse.y"
2446 { (yyval
.integer
) = -TEXTURE_2D_INDEX
; ;}
2451 /* Line 1455 of yacc.c */
2452 #line 527 "program_parse.y"
2453 { (yyval
.integer
) = -TEXTURE_RECT_INDEX
; ;}
2458 /* Line 1455 of yacc.c */
2459 #line 528 "program_parse.y"
2460 { (yyval
.integer
) = TEXTURE_1D_ARRAY_INDEX
; ;}
2465 /* Line 1455 of yacc.c */
2466 #line 529 "program_parse.y"
2467 { (yyval
.integer
) = TEXTURE_2D_ARRAY_INDEX
; ;}
2472 /* Line 1455 of yacc.c */
2473 #line 530 "program_parse.y"
2474 { (yyval
.integer
) = -TEXTURE_1D_ARRAY_INDEX
; ;}
2479 /* Line 1455 of yacc.c */
2480 #line 531 "program_parse.y"
2481 { (yyval
.integer
) = -TEXTURE_2D_ARRAY_INDEX
; ;}
2486 /* Line 1455 of yacc.c */
2487 #line 535 "program_parse.y"
2489 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2490 * FIXME: to the existing swizzle?
2492 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2493 (yyvsp
[(4) - (6)].src_reg
).Base
.Negate
= (yyvsp
[(6) - (6)].swiz_mask
).mask
;
2495 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2501 /* Line 1455 of yacc.c */
2502 #line 547 "program_parse.y"
2504 (yyval
.src_reg
) = (yyvsp
[(2) - (2)].src_reg
);
2506 if ((yyvsp
[(1) - (2)].negate
)) {
2507 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2514 /* Line 1455 of yacc.c */
2515 #line 555 "program_parse.y"
2517 (yyval
.src_reg
) = (yyvsp
[(3) - (4)].src_reg
);
2519 if (!state
->option
.NV_fragment
) {
2520 yyerror(& (yylsp
[(2) - (4)]), state
, "unexpected character '|'");
2524 if ((yyvsp
[(1) - (4)].negate
)) {
2525 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2528 (yyval
.src_reg
).Base
.Abs
= 1;
2534 /* Line 1455 of yacc.c */
2535 #line 572 "program_parse.y"
2537 (yyval
.src_reg
) = (yyvsp
[(1) - (2)].src_reg
);
2539 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2540 (yyvsp
[(2) - (2)].swiz_mask
).swizzle
);
2546 /* Line 1455 of yacc.c */
2547 #line 579 "program_parse.y"
2549 struct asm_symbol temp_sym
;
2551 if (!state
->option
.NV_fragment
) {
2552 yyerror(& (yylsp
[(1) - (1)]), state
, "expected scalar suffix");
2556 memset(& temp_sym
, 0, sizeof(temp_sym
));
2557 temp_sym
.param_binding_begin
= ~0;
2558 initialize_symbol_from_const(state
->prog
, & temp_sym
, & (yyvsp
[(1) - (1)].vector
));
2560 set_src_reg(& (yyval
.src_reg
), PROGRAM_CONSTANT
, temp_sym
.param_binding_begin
);
2566 /* Line 1455 of yacc.c */
2567 #line 596 "program_parse.y"
2569 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2571 if ((yyvsp
[(1) - (3)].negate
)) {
2572 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2575 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2576 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2582 /* Line 1455 of yacc.c */
2583 #line 607 "program_parse.y"
2585 (yyval
.src_reg
) = (yyvsp
[(3) - (5)].src_reg
);
2587 if (!state
->option
.NV_fragment
) {
2588 yyerror(& (yylsp
[(2) - (5)]), state
, "unexpected character '|'");
2592 if ((yyvsp
[(1) - (5)].negate
)) {
2593 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2596 (yyval
.src_reg
).Base
.Abs
= 1;
2597 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2598 (yyvsp
[(4) - (5)].swiz_mask
).swizzle
);
2604 /* Line 1455 of yacc.c */
2605 #line 627 "program_parse.y"
2607 (yyval
.dst_reg
) = (yyvsp
[(1) - (3)].dst_reg
);
2608 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (3)].swiz_mask
).mask
;
2609 (yyval
.dst_reg
).CondMask
= (yyvsp
[(3) - (3)].dst_reg
).CondMask
;
2610 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(3) - (3)].dst_reg
).CondSwizzle
;
2611 (yyval
.dst_reg
).CondSrc
= (yyvsp
[(3) - (3)].dst_reg
).CondSrc
;
2613 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2614 /* Technically speaking, this should check that it is in
2615 * vertex program mode. However, PositionInvariant can never be
2616 * set in fragment program mode, so it is somewhat irrelevant.
2618 if (state
->option
.PositionInvariant
2619 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2620 yyerror(& (yylsp
[(1) - (3)]), state
, "position-invariant programs cannot "
2625 state
->prog
->OutputsWritten
|= BITFIELD64_BIT((yyval
.dst_reg
).Index
);
2632 /* Line 1455 of yacc.c */
2633 #line 652 "program_parse.y"
2635 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_ADDRESS
, 0);
2636 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2642 /* Line 1455 of yacc.c */
2643 #line 659 "program_parse.y"
2645 const unsigned xyzw_valid
=
2646 ((yyvsp
[(1) - (7)].ext_swizzle
).xyzw_valid
<< 0)
2647 | ((yyvsp
[(3) - (7)].ext_swizzle
).xyzw_valid
<< 1)
2648 | ((yyvsp
[(5) - (7)].ext_swizzle
).xyzw_valid
<< 2)
2649 | ((yyvsp
[(7) - (7)].ext_swizzle
).xyzw_valid
<< 3);
2650 const unsigned rgba_valid
=
2651 ((yyvsp
[(1) - (7)].ext_swizzle
).rgba_valid
<< 0)
2652 | ((yyvsp
[(3) - (7)].ext_swizzle
).rgba_valid
<< 1)
2653 | ((yyvsp
[(5) - (7)].ext_swizzle
).rgba_valid
<< 2)
2654 | ((yyvsp
[(7) - (7)].ext_swizzle
).rgba_valid
<< 3);
2656 /* All of the swizzle components have to be valid in either RGBA
2657 * or XYZW. Note that 0 and 1 are valid in both, so both masks
2658 * can have some bits set.
2660 * We somewhat deviate from the spec here. It would be really hard
2661 * to figure out which component is the error, and there probably
2662 * isn't a lot of benefit.
2664 if ((rgba_valid
!= 0x0f) && (xyzw_valid
!= 0x0f)) {
2665 yyerror(& (yylsp
[(1) - (7)]), state
, "cannot combine RGBA and XYZW swizzle "
2670 (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
);
2671 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].ext_swizzle
).negate
) | ((yyvsp
[(3) - (7)].ext_swizzle
).negate
<< 1) | ((yyvsp
[(5) - (7)].ext_swizzle
).negate
<< 2)
2672 | ((yyvsp
[(7) - (7)].ext_swizzle
).negate
<< 3);
2678 /* Line 1455 of yacc.c */
2679 #line 692 "program_parse.y"
2681 (yyval
.ext_swizzle
) = (yyvsp
[(2) - (2)].ext_swizzle
);
2682 (yyval
.ext_swizzle
).negate
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2688 /* Line 1455 of yacc.c */
2689 #line 699 "program_parse.y"
2691 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2692 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2696 (yyval
.ext_swizzle
).swz
= ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2698 /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2701 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2702 (yyval
.ext_swizzle
).rgba_valid
= 1;
2708 /* Line 1455 of yacc.c */
2709 #line 714 "program_parse.y"
2713 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2714 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2718 s
= (yyvsp
[(1) - (1)].string
)[0];
2719 free((yyvsp
[(1) - (1)].string
));
2723 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2724 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2727 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2728 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2731 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2732 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2735 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2736 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2740 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2741 (yyval
.ext_swizzle
).rgba_valid
= 1;
2744 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2745 (yyval
.ext_swizzle
).rgba_valid
= 1;
2748 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2749 (yyval
.ext_swizzle
).rgba_valid
= 1;
2752 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2753 (yyval
.ext_swizzle
).rgba_valid
= 1;
2757 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2766 /* Line 1455 of yacc.c */
2767 #line 769 "program_parse.y"
2769 struct asm_symbol
*const s
= (struct asm_symbol
*)
2770 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2772 free((yyvsp
[(1) - (1)].string
));
2775 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2777 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2778 && (s
->type
!= at_attrib
)) {
2779 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2781 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2782 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2786 init_src_reg(& (yyval
.src_reg
));
2789 set_src_reg(& (yyval
.src_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2792 set_src_reg(& (yyval
.src_reg
), s
->param_binding_type
, s
->param_binding_begin
);
2795 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, s
->attrib_binding
);
2796 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2798 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2812 /* Line 1455 of yacc.c */
2813 #line 810 "program_parse.y"
2815 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, (yyvsp
[(1) - (1)].attrib
));
2816 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2818 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2826 /* Line 1455 of yacc.c */
2827 #line 819 "program_parse.y"
2829 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2830 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2831 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2835 init_src_reg(& (yyval
.src_reg
));
2836 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2838 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2839 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2841 (yyval
.src_reg
).Base
.RelAddr
= 1;
2842 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2843 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2845 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2852 /* Line 1455 of yacc.c */
2853 #line 840 "program_parse.y"
2855 gl_register_file file
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2856 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2858 set_src_reg(& (yyval
.src_reg
), file
, (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
);
2864 /* Line 1455 of yacc.c */
2865 #line 849 "program_parse.y"
2867 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, (yyvsp
[(1) - (1)].result
));
2873 /* Line 1455 of yacc.c */
2874 #line 853 "program_parse.y"
2876 struct asm_symbol
*const s
= (struct asm_symbol
*)
2877 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2879 free((yyvsp
[(1) - (1)].string
));
2882 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2884 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2885 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2891 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2894 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, s
->output_binding
);
2897 set_dst_reg(& (yyval
.dst_reg
), s
->param_binding_type
, s
->param_binding_begin
);
2905 /* Line 1455 of yacc.c */
2906 #line 882 "program_parse.y"
2908 struct asm_symbol
*const s
= (struct asm_symbol
*)
2909 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2911 free((yyvsp
[(1) - (1)].string
));
2914 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2916 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2917 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2927 /* Line 1455 of yacc.c */
2928 #line 903 "program_parse.y"
2930 init_src_reg(& (yyval
.src_reg
));
2931 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2937 /* Line 1455 of yacc.c */
2938 #line 910 "program_parse.y"
2940 /* FINISHME: Add support for multiple address registers.
2942 /* FINISHME: Add support for 4-component address registers.
2944 init_src_reg(& (yyval
.src_reg
));
2945 (yyval
.src_reg
).Base
.RelAddr
= 1;
2946 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2952 /* Line 1455 of yacc.c */
2953 #line 921 "program_parse.y"
2954 { (yyval
.integer
) = 0; ;}
2959 /* Line 1455 of yacc.c */
2960 #line 922 "program_parse.y"
2961 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2966 /* Line 1455 of yacc.c */
2967 #line 923 "program_parse.y"
2968 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2973 /* Line 1455 of yacc.c */
2974 #line 927 "program_parse.y"
2976 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2978 _mesa_snprintf(s
, sizeof(s
),
2979 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2980 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2983 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2990 /* Line 1455 of yacc.c */
2991 #line 941 "program_parse.y"
2993 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2995 _mesa_snprintf(s
, sizeof(s
),
2996 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2997 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
3000 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3007 /* Line 1455 of yacc.c */
3008 #line 955 "program_parse.y"
3010 struct asm_symbol
*const s
= (struct asm_symbol
*)
3011 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
3013 free((yyvsp
[(1) - (1)].string
));
3016 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
3018 } else if (s
->type
!= at_address
) {
3019 yyerror(& (yylsp
[(1) - (1)]), state
,
3020 "invalid variable for indexed array access");
3030 /* Line 1455 of yacc.c */
3031 #line 975 "program_parse.y"
3033 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3034 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
3037 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3044 /* Line 1455 of yacc.c */
3045 #line 986 "program_parse.y"
3047 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3048 yyerror(& (yylsp
[(1) - (1)]), state
,
3049 "address register write mask must be \".x\"");
3052 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3059 /* Line 1455 of yacc.c */
3060 #line 1002 "program_parse.y"
3061 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3066 /* Line 1455 of yacc.c */
3067 #line 1006 "program_parse.y"
3068 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3073 /* Line 1455 of yacc.c */
3074 #line 1010 "program_parse.y"
3076 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3082 /* Line 1455 of yacc.c */
3083 #line 1014 "program_parse.y"
3085 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3091 /* Line 1455 of yacc.c */
3092 #line 1018 "program_parse.y"
3094 (yyval
.dst_reg
).CondMask
= COND_TR
;
3095 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3096 (yyval
.dst_reg
).CondSrc
= 0;
3102 /* Line 1455 of yacc.c */
3103 #line 1026 "program_parse.y"
3105 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3106 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3112 /* Line 1455 of yacc.c */
3113 #line 1033 "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 1040 "program_parse.y"
3125 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3126 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3127 char *const err_str
=
3128 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3130 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3131 ? err_str
: "invalid condition code");
3133 if (err_str
!= NULL
) {
3134 _mesa_free(err_str
);
3140 (yyval
.dst_reg
).CondMask
= cond
;
3141 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3142 (yyval
.dst_reg
).CondSrc
= 0;
3148 /* Line 1455 of yacc.c */
3149 #line 1063 "program_parse.y"
3151 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3152 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3153 char *const err_str
=
3154 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3156 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3157 ? err_str
: "invalid condition code");
3159 if (err_str
!= NULL
) {
3160 _mesa_free(err_str
);
3166 (yyval
.dst_reg
).CondMask
= cond
;
3167 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3168 (yyval
.dst_reg
).CondSrc
= 0;
3174 /* Line 1455 of yacc.c */
3175 #line 1094 "program_parse.y"
3177 struct asm_symbol
*const s
=
3178 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
3181 free((yyvsp
[(2) - (4)].string
));
3184 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
3185 state
->InputsBound
|= (1U << s
->attrib_binding
);
3187 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
3196 /* Line 1455 of yacc.c */
3197 #line 1113 "program_parse.y"
3199 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3205 /* Line 1455 of yacc.c */
3206 #line 1117 "program_parse.y"
3208 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3214 /* Line 1455 of yacc.c */
3215 #line 1123 "program_parse.y"
3217 (yyval
.attrib
) = VERT_ATTRIB_POS
;
3223 /* Line 1455 of yacc.c */
3224 #line 1127 "program_parse.y"
3226 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
3232 /* Line 1455 of yacc.c */
3233 #line 1131 "program_parse.y"
3235 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
3241 /* Line 1455 of yacc.c */
3242 #line 1135 "program_parse.y"
3244 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
3245 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
3249 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
3255 /* Line 1455 of yacc.c */
3256 #line 1144 "program_parse.y"
3258 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
3259 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
3263 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
3269 /* Line 1455 of yacc.c */
3270 #line 1153 "program_parse.y"
3272 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3278 /* Line 1455 of yacc.c */
3279 #line 1157 "program_parse.y"
3281 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3288 /* Line 1455 of yacc.c */
3289 #line 1162 "program_parse.y"
3291 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
3297 /* Line 1455 of yacc.c */
3298 #line 1168 "program_parse.y"
3300 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
3301 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
3305 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3311 /* Line 1455 of yacc.c */
3312 #line 1182 "program_parse.y"
3314 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
3320 /* Line 1455 of yacc.c */
3321 #line 1186 "program_parse.y"
3323 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
3329 /* Line 1455 of yacc.c */
3330 #line 1190 "program_parse.y"
3332 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
3338 /* Line 1455 of yacc.c */
3339 #line 1194 "program_parse.y"
3341 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3347 /* Line 1455 of yacc.c */
3348 #line 1202 "program_parse.y"
3350 struct asm_symbol
*const s
=
3351 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
3354 free((yyvsp
[(2) - (3)].string
));
3357 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
3358 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
3359 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3360 s
->param_is_array
= 0;
3367 /* Line 1455 of yacc.c */
3368 #line 1219 "program_parse.y"
3370 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
3371 free((yyvsp
[(2) - (6)].string
));
3372 yyerror(& (yylsp
[(4) - (6)]), state
,
3373 "parameter array size and number of bindings must match");
3376 struct asm_symbol
*const s
=
3377 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
3380 free((yyvsp
[(2) - (6)].string
));
3383 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
3384 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
3385 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
3386 s
->param_is_array
= 1;
3394 /* Line 1455 of yacc.c */
3395 #line 1243 "program_parse.y"
3397 (yyval
.integer
) = 0;
3403 /* Line 1455 of yacc.c */
3404 #line 1247 "program_parse.y"
3406 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) > state
->limits
->MaxParameters
)) {
3407 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
3410 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3417 /* Line 1455 of yacc.c */
3418 #line 1258 "program_parse.y"
3420 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
3426 /* Line 1455 of yacc.c */
3427 #line 1264 "program_parse.y"
3429 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
3435 /* Line 1455 of yacc.c */
3436 #line 1271 "program_parse.y"
3438 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3439 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
3445 /* Line 1455 of yacc.c */
3446 #line 1278 "program_parse.y"
3448 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3449 (yyval
.temp_sym
).param_binding_begin
= ~0;
3450 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3456 /* Line 1455 of yacc.c */
3457 #line 1284 "program_parse.y"
3459 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3460 (yyval
.temp_sym
).param_binding_begin
= ~0;
3461 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3467 /* Line 1455 of yacc.c */
3468 #line 1290 "program_parse.y"
3470 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3471 (yyval
.temp_sym
).param_binding_begin
= ~0;
3472 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3478 /* Line 1455 of yacc.c */
3479 #line 1298 "program_parse.y"
3481 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3482 (yyval
.temp_sym
).param_binding_begin
= ~0;
3483 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3489 /* Line 1455 of yacc.c */
3490 #line 1304 "program_parse.y"
3492 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3493 (yyval
.temp_sym
).param_binding_begin
= ~0;
3494 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3500 /* Line 1455 of yacc.c */
3501 #line 1310 "program_parse.y"
3503 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3504 (yyval
.temp_sym
).param_binding_begin
= ~0;
3505 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3511 /* Line 1455 of yacc.c */
3512 #line 1318 "program_parse.y"
3514 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3515 (yyval
.temp_sym
).param_binding_begin
= ~0;
3516 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3522 /* Line 1455 of yacc.c */
3523 #line 1324 "program_parse.y"
3525 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3526 (yyval
.temp_sym
).param_binding_begin
= ~0;
3527 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3533 /* Line 1455 of yacc.c */
3534 #line 1330 "program_parse.y"
3536 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3537 (yyval
.temp_sym
).param_binding_begin
= ~0;
3538 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3544 /* Line 1455 of yacc.c */
3545 #line 1337 "program_parse.y"
3546 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3551 /* Line 1455 of yacc.c */
3552 #line 1338 "program_parse.y"
3553 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3558 /* Line 1455 of yacc.c */
3559 #line 1341 "program_parse.y"
3560 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3565 /* Line 1455 of yacc.c */
3566 #line 1342 "program_parse.y"
3567 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3572 /* Line 1455 of yacc.c */
3573 #line 1343 "program_parse.y"
3574 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3579 /* Line 1455 of yacc.c */
3580 #line 1344 "program_parse.y"
3581 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3586 /* Line 1455 of yacc.c */
3587 #line 1345 "program_parse.y"
3588 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3593 /* Line 1455 of yacc.c */
3594 #line 1346 "program_parse.y"
3595 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3600 /* Line 1455 of yacc.c */
3601 #line 1347 "program_parse.y"
3602 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3607 /* Line 1455 of yacc.c */
3608 #line 1348 "program_parse.y"
3609 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3614 /* Line 1455 of yacc.c */
3615 #line 1349 "program_parse.y"
3616 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3621 /* Line 1455 of yacc.c */
3622 #line 1350 "program_parse.y"
3623 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3628 /* Line 1455 of yacc.c */
3629 #line 1351 "program_parse.y"
3630 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3635 /* Line 1455 of yacc.c */
3636 #line 1355 "program_parse.y"
3638 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3639 (yyval
.state
)[0] = STATE_MATERIAL
;
3640 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3641 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3647 /* Line 1455 of yacc.c */
3648 #line 1364 "program_parse.y"
3650 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3656 /* Line 1455 of yacc.c */
3657 #line 1368 "program_parse.y"
3659 (yyval
.integer
) = STATE_EMISSION
;
3665 /* Line 1455 of yacc.c */
3666 #line 1372 "program_parse.y"
3668 (yyval
.integer
) = STATE_SHININESS
;
3674 /* Line 1455 of yacc.c */
3675 #line 1378 "program_parse.y"
3677 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3678 (yyval
.state
)[0] = STATE_LIGHT
;
3679 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3680 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3686 /* Line 1455 of yacc.c */
3687 #line 1387 "program_parse.y"
3689 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3695 /* Line 1455 of yacc.c */
3696 #line 1391 "program_parse.y"
3698 (yyval
.integer
) = STATE_POSITION
;
3704 /* Line 1455 of yacc.c */
3705 #line 1395 "program_parse.y"
3707 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3708 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3712 (yyval
.integer
) = STATE_ATTENUATION
;
3718 /* Line 1455 of yacc.c */
3719 #line 1404 "program_parse.y"
3721 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3727 /* Line 1455 of yacc.c */
3728 #line 1408 "program_parse.y"
3730 (yyval
.integer
) = STATE_HALF_VECTOR
;
3736 /* Line 1455 of yacc.c */
3737 #line 1414 "program_parse.y"
3739 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3745 /* Line 1455 of yacc.c */
3746 #line 1420 "program_parse.y"
3748 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3749 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3755 /* Line 1455 of yacc.c */
3756 #line 1427 "program_parse.y"
3758 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3759 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3765 /* Line 1455 of yacc.c */
3766 #line 1432 "program_parse.y"
3768 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3769 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3770 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3776 /* Line 1455 of yacc.c */
3777 #line 1440 "program_parse.y"
3779 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3780 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3781 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3782 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3783 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3789 /* Line 1455 of yacc.c */
3790 #line 1452 "program_parse.y"
3792 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3793 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3794 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3800 /* Line 1455 of yacc.c */
3801 #line 1460 "program_parse.y"
3803 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3809 /* Line 1455 of yacc.c */
3810 #line 1466 "program_parse.y"
3812 (yyval
.integer
) = STATE_AMBIENT
;
3818 /* Line 1455 of yacc.c */
3819 #line 1470 "program_parse.y"
3821 (yyval
.integer
) = STATE_DIFFUSE
;
3827 /* Line 1455 of yacc.c */
3828 #line 1474 "program_parse.y"
3830 (yyval
.integer
) = STATE_SPECULAR
;
3836 /* Line 1455 of yacc.c */
3837 #line 1480 "program_parse.y"
3839 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3840 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3844 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3850 /* Line 1455 of yacc.c */
3851 #line 1491 "program_parse.y"
3853 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3854 (yyval
.state
)[0] = STATE_TEXGEN
;
3855 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3856 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3862 /* Line 1455 of yacc.c */
3863 #line 1500 "program_parse.y"
3865 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3871 /* Line 1455 of yacc.c */
3872 #line 1504 "program_parse.y"
3874 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3880 /* Line 1455 of yacc.c */
3881 #line 1509 "program_parse.y"
3883 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3889 /* Line 1455 of yacc.c */
3890 #line 1513 "program_parse.y"
3892 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3898 /* Line 1455 of yacc.c */
3899 #line 1517 "program_parse.y"
3901 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3907 /* Line 1455 of yacc.c */
3908 #line 1521 "program_parse.y"
3910 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3916 /* Line 1455 of yacc.c */
3917 #line 1527 "program_parse.y"
3919 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3920 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3926 /* Line 1455 of yacc.c */
3927 #line 1534 "program_parse.y"
3929 (yyval
.integer
) = STATE_FOG_COLOR
;
3935 /* Line 1455 of yacc.c */
3936 #line 1538 "program_parse.y"
3938 (yyval
.integer
) = STATE_FOG_PARAMS
;
3944 /* Line 1455 of yacc.c */
3945 #line 1544 "program_parse.y"
3947 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3948 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3949 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3955 /* Line 1455 of yacc.c */
3956 #line 1552 "program_parse.y"
3958 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3959 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3963 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3969 /* Line 1455 of yacc.c */
3970 #line 1563 "program_parse.y"
3972 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3973 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3979 /* Line 1455 of yacc.c */
3980 #line 1570 "program_parse.y"
3982 (yyval
.integer
) = STATE_POINT_SIZE
;
3988 /* Line 1455 of yacc.c */
3989 #line 1574 "program_parse.y"
3991 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3997 /* Line 1455 of yacc.c */
3998 #line 1580 "program_parse.y"
4000 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
4001 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
4002 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4003 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4004 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
4010 /* Line 1455 of yacc.c */
4011 #line 1590 "program_parse.y"
4013 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
4014 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
4015 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
4016 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
4017 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
4023 /* Line 1455 of yacc.c */
4024 #line 1600 "program_parse.y"
4026 (yyval
.state
)[2] = 0;
4027 (yyval
.state
)[3] = 3;
4033 /* Line 1455 of yacc.c */
4034 #line 1605 "program_parse.y"
4036 /* It seems logical that the matrix row range specifier would have
4037 * to specify a range or more than one row (i.e., $5 > $3).
4038 * However, the ARB_vertex_program spec says "a program will fail
4039 * to load if <a> is greater than <b>." This means that $3 == $5
4042 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
4043 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
4047 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
4048 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
4054 /* Line 1455 of yacc.c */
4055 #line 1623 "program_parse.y"
4057 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
4058 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
4059 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
4065 /* Line 1455 of yacc.c */
4066 #line 1631 "program_parse.y"
4068 (yyval
.integer
) = 0;
4074 /* Line 1455 of yacc.c */
4075 #line 1635 "program_parse.y"
4077 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4083 /* Line 1455 of yacc.c */
4084 #line 1641 "program_parse.y"
4086 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
4092 /* Line 1455 of yacc.c */
4093 #line 1645 "program_parse.y"
4095 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
4101 /* Line 1455 of yacc.c */
4102 #line 1649 "program_parse.y"
4104 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
4110 /* Line 1455 of yacc.c */
4111 #line 1655 "program_parse.y"
4113 if ((yyvsp
[(1) - (1)].integer
) > 3) {
4114 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
4118 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4124 /* Line 1455 of yacc.c */
4125 #line 1666 "program_parse.y"
4127 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
4128 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4134 /* Line 1455 of yacc.c */
4135 #line 1671 "program_parse.y"
4137 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
4138 (yyval
.state
)[1] = 0;
4144 /* Line 1455 of yacc.c */
4145 #line 1676 "program_parse.y"
4147 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
4148 (yyval
.state
)[1] = 0;
4154 /* Line 1455 of yacc.c */
4155 #line 1681 "program_parse.y"
4157 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
4158 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4164 /* Line 1455 of yacc.c */
4165 #line 1686 "program_parse.y"
4167 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
4174 /* Line 1455 of yacc.c */
4175 #line 1691 "program_parse.y"
4177 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
4178 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
4184 /* Line 1455 of yacc.c */
4185 #line 1698 "program_parse.y"
4187 (yyval
.integer
) = 0;
4193 /* Line 1455 of yacc.c */
4194 #line 1702 "program_parse.y"
4196 (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
);
4202 /* Line 1455 of yacc.c */
4203 #line 1707 "program_parse.y"
4205 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
4208 if ((yyvsp
[(1) - (1)].integer
) != 0) {
4209 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
4213 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4219 /* Line 1455 of yacc.c */
4220 #line 1720 "program_parse.y"
4222 /* Since GL_ARB_matrix_palette isn't supported, just let any value
4223 * through here. The error will be generated later.
4225 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4231 /* Line 1455 of yacc.c */
4232 #line 1728 "program_parse.y"
4234 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
4235 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
4239 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4245 /* Line 1455 of yacc.c */
4246 #line 1739 "program_parse.y"
4248 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4249 (yyval
.state
)[0] = STATE_DEPTH_RANGE
;
4255 /* Line 1455 of yacc.c */
4256 #line 1751 "program_parse.y"
4258 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4259 (yyval
.state
)[0] = state
->state_param_enum
;
4260 (yyval
.state
)[1] = STATE_ENV
;
4261 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4262 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4268 /* Line 1455 of yacc.c */
4269 #line 1761 "program_parse.y"
4271 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4272 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4278 /* Line 1455 of yacc.c */
4279 #line 1766 "program_parse.y"
4281 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4282 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4288 /* Line 1455 of yacc.c */
4289 #line 1773 "program_parse.y"
4291 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4292 (yyval
.state
)[0] = state
->state_param_enum
;
4293 (yyval
.state
)[1] = STATE_ENV
;
4294 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4295 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4301 /* Line 1455 of yacc.c */
4302 #line 1783 "program_parse.y"
4304 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4305 (yyval
.state
)[0] = state
->state_param_enum
;
4306 (yyval
.state
)[1] = STATE_LOCAL
;
4307 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4308 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4314 /* Line 1455 of yacc.c */
4315 #line 1792 "program_parse.y"
4317 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4318 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4324 /* Line 1455 of yacc.c */
4325 #line 1797 "program_parse.y"
4327 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4328 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4334 /* Line 1455 of yacc.c */
4335 #line 1804 "program_parse.y"
4337 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4338 (yyval
.state
)[0] = state
->state_param_enum
;
4339 (yyval
.state
)[1] = STATE_LOCAL
;
4340 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4341 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4347 /* Line 1455 of yacc.c */
4348 #line 1814 "program_parse.y"
4350 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
4351 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
4354 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4360 /* Line 1455 of yacc.c */
4361 #line 1824 "program_parse.y"
4363 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
4364 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
4367 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4373 /* Line 1455 of yacc.c */
4374 #line 1839 "program_parse.y"
4376 (yyval
.vector
).count
= 4;
4377 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4378 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4379 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4380 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4386 /* Line 1455 of yacc.c */
4387 #line 1849 "program_parse.y"
4389 (yyval
.vector
).count
= 1;
4390 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4391 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4392 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4393 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4399 /* Line 1455 of yacc.c */
4400 #line 1857 "program_parse.y"
4402 (yyval
.vector
).count
= 1;
4403 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
4404 (yyval
.vector
).data
[1] = (float) (yyvsp
[(1) - (1)].integer
);
4405 (yyval
.vector
).data
[2] = (float) (yyvsp
[(1) - (1)].integer
);
4406 (yyval
.vector
).data
[3] = (float) (yyvsp
[(1) - (1)].integer
);
4412 /* Line 1455 of yacc.c */
4413 #line 1867 "program_parse.y"
4415 (yyval
.vector
).count
= 4;
4416 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
4417 (yyval
.vector
).data
[1] = 0.0f
;
4418 (yyval
.vector
).data
[2] = 0.0f
;
4419 (yyval
.vector
).data
[3] = 1.0f
;
4425 /* Line 1455 of yacc.c */
4426 #line 1875 "program_parse.y"
4428 (yyval
.vector
).count
= 4;
4429 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
4430 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
4431 (yyval
.vector
).data
[2] = 0.0f
;
4432 (yyval
.vector
).data
[3] = 1.0f
;
4438 /* Line 1455 of yacc.c */
4439 #line 1884 "program_parse.y"
4441 (yyval
.vector
).count
= 4;
4442 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
4443 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
4444 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
4445 (yyval
.vector
).data
[3] = 1.0f
;
4451 /* Line 1455 of yacc.c */
4452 #line 1893 "program_parse.y"
4454 (yyval
.vector
).count
= 4;
4455 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
4456 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
4457 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
4458 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
4464 /* Line 1455 of yacc.c */
4465 #line 1903 "program_parse.y"
4467 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
4473 /* Line 1455 of yacc.c */
4474 #line 1907 "program_parse.y"
4476 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
4482 /* Line 1455 of yacc.c */
4483 #line 1912 "program_parse.y"
4484 { (yyval
.negate
) = FALSE
; ;}
4489 /* Line 1455 of yacc.c */
4490 #line 1913 "program_parse.y"
4491 { (yyval
.negate
) = TRUE
; ;}
4496 /* Line 1455 of yacc.c */
4497 #line 1914 "program_parse.y"
4498 { (yyval
.negate
) = FALSE
; ;}
4503 /* Line 1455 of yacc.c */
4504 #line 1917 "program_parse.y"
4505 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
4510 /* Line 1455 of yacc.c */
4511 #line 1921 "program_parse.y"
4513 /* NV_fragment_program_option defines the size qualifiers in a
4514 * fairly broken way. "SHORT" or "LONG" can optionally be used
4515 * before TEMP or OUTPUT. However, neither is a reserved word!
4516 * This means that we have to parse it as an identifier, then check
4517 * to make sure it's one of the valid values. *sigh*
4519 * In addition, the grammar in the extension spec does *not* allow
4520 * the size specifier to be optional, but all known implementations
4523 if (!state
->option
.NV_fragment
) {
4524 yyerror(& (yylsp
[(1) - (1)]), state
, "unexpected IDENTIFIER");
4528 if (strcmp("SHORT", (yyvsp
[(1) - (1)].string
)) == 0) {
4529 } else if (strcmp("LONG", (yyvsp
[(1) - (1)].string
)) == 0) {
4531 char *const err_str
=
4532 make_error_string("invalid storage size specifier \"%s\"",
4533 (yyvsp
[(1) - (1)].string
));
4535 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
4536 ? err_str
: "invalid storage size specifier");
4538 if (err_str
!= NULL
) {
4539 _mesa_free(err_str
);
4549 /* Line 1455 of yacc.c */
4550 #line 1955 "program_parse.y"
4557 /* Line 1455 of yacc.c */
4558 #line 1959 "program_parse.y"
4559 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4564 /* Line 1455 of yacc.c */
4565 #line 1963 "program_parse.y"
4567 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4568 free((yyvsp
[(3) - (3)].string
));
4576 /* Line 1455 of yacc.c */
4577 #line 1970 "program_parse.y"
4579 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4580 free((yyvsp
[(1) - (1)].string
));
4588 /* Line 1455 of yacc.c */
4589 #line 1979 "program_parse.y"
4591 struct asm_symbol
*const s
=
4592 declare_variable(state
, (yyvsp
[(3) - (5)].string
), at_output
, & (yylsp
[(3) - (5)]));
4595 free((yyvsp
[(3) - (5)].string
));
4598 s
->output_binding
= (yyvsp
[(5) - (5)].result
);
4605 /* Line 1455 of yacc.c */
4606 #line 1993 "program_parse.y"
4608 if (state
->mode
== ARB_vertex
) {
4609 (yyval
.result
) = VERT_RESULT_HPOS
;
4611 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4619 /* Line 1455 of yacc.c */
4620 #line 2002 "program_parse.y"
4622 if (state
->mode
== ARB_vertex
) {
4623 (yyval
.result
) = VERT_RESULT_FOGC
;
4625 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4633 /* Line 1455 of yacc.c */
4634 #line 2011 "program_parse.y"
4636 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4642 /* Line 1455 of yacc.c */
4643 #line 2015 "program_parse.y"
4645 if (state
->mode
== ARB_vertex
) {
4646 (yyval
.result
) = VERT_RESULT_PSIZ
;
4648 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4656 /* Line 1455 of yacc.c */
4657 #line 2024 "program_parse.y"
4659 if (state
->mode
== ARB_vertex
) {
4660 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4662 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4670 /* Line 1455 of yacc.c */
4671 #line 2033 "program_parse.y"
4673 if (state
->mode
== ARB_fragment
) {
4674 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4676 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4684 /* Line 1455 of yacc.c */
4685 #line 2044 "program_parse.y"
4687 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4693 /* Line 1455 of yacc.c */
4694 #line 2050 "program_parse.y"
4696 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4698 : FRAG_RESULT_COLOR
;
4704 /* Line 1455 of yacc.c */
4705 #line 2056 "program_parse.y"
4707 if (state
->mode
== ARB_vertex
) {
4708 (yyval
.integer
) = VERT_RESULT_COL0
;
4710 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4718 /* Line 1455 of yacc.c */
4719 #line 2065 "program_parse.y"
4721 if (state
->mode
== ARB_vertex
) {
4722 (yyval
.integer
) = VERT_RESULT_BFC0
;
4724 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4732 /* Line 1455 of yacc.c */
4733 #line 2076 "program_parse.y"
4735 (yyval
.integer
) = 0;
4741 /* Line 1455 of yacc.c */
4742 #line 2080 "program_parse.y"
4744 if (state
->mode
== ARB_vertex
) {
4745 (yyval
.integer
) = 0;
4747 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4755 /* Line 1455 of yacc.c */
4756 #line 2089 "program_parse.y"
4758 if (state
->mode
== ARB_vertex
) {
4759 (yyval
.integer
) = 1;
4761 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4769 /* Line 1455 of yacc.c */
4770 #line 2099 "program_parse.y"
4771 { (yyval
.integer
) = 0; ;}
4776 /* Line 1455 of yacc.c */
4777 #line 2100 "program_parse.y"
4778 { (yyval
.integer
) = 0; ;}
4783 /* Line 1455 of yacc.c */
4784 #line 2101 "program_parse.y"
4785 { (yyval
.integer
) = 1; ;}
4790 /* Line 1455 of yacc.c */
4791 #line 2104 "program_parse.y"
4792 { (yyval
.integer
) = 0; ;}
4797 /* Line 1455 of yacc.c */
4798 #line 2105 "program_parse.y"
4799 { (yyval
.integer
) = 0; ;}
4804 /* Line 1455 of yacc.c */
4805 #line 2106 "program_parse.y"
4806 { (yyval
.integer
) = 1; ;}
4811 /* Line 1455 of yacc.c */
4812 #line 2109 "program_parse.y"
4813 { (yyval
.integer
) = 0; ;}
4818 /* Line 1455 of yacc.c */
4819 #line 2110 "program_parse.y"
4820 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4825 /* Line 1455 of yacc.c */
4826 #line 2113 "program_parse.y"
4827 { (yyval
.integer
) = 0; ;}
4832 /* Line 1455 of yacc.c */
4833 #line 2114 "program_parse.y"
4834 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4839 /* Line 1455 of yacc.c */
4840 #line 2117 "program_parse.y"
4841 { (yyval
.integer
) = 0; ;}
4846 /* Line 1455 of yacc.c */
4847 #line 2118 "program_parse.y"
4848 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4853 /* Line 1455 of yacc.c */
4854 #line 2122 "program_parse.y"
4856 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4857 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4861 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4867 /* Line 1455 of yacc.c */
4868 #line 2133 "program_parse.y"
4870 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4871 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4875 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4881 /* Line 1455 of yacc.c */
4882 #line 2144 "program_parse.y"
4884 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4885 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4889 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4895 /* Line 1455 of yacc.c */
4896 #line 2155 "program_parse.y"
4898 struct asm_symbol
*exist
= (struct asm_symbol
*)
4899 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4900 struct asm_symbol
*target
= (struct asm_symbol
*)
4901 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4903 free((yyvsp
[(4) - (4)].string
));
4905 if (exist
!= NULL
) {
4907 _mesa_snprintf(m
, sizeof(m
), "redeclared identifier: %s", (yyvsp
[(2) - (4)].string
));
4908 free((yyvsp
[(2) - (4)].string
));
4909 yyerror(& (yylsp
[(2) - (4)]), state
, m
);
4911 } else if (target
== NULL
) {
4912 free((yyvsp
[(2) - (4)].string
));
4913 yyerror(& (yylsp
[(4) - (4)]), state
,
4914 "undefined variable binding in ALIAS statement");
4917 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4924 /* Line 1455 of yacc.c */
4925 #line 4926 "program_parse.tab.c"
4928 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4932 YY_STACK_PRINT (yyss
, yyssp
);
4937 /* Now `shift' the result of the reduction. Determine what state
4938 that goes to, based on the state we popped back to and the rule
4939 number reduced by. */
4943 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4944 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4945 yystate
= yytable
[yystate
];
4947 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4952 /*------------------------------------.
4953 | yyerrlab -- here on detecting error |
4954 `------------------------------------*/
4956 /* If not already recovering from an error, report this error. */
4960 #if ! YYERROR_VERBOSE
4961 yyerror (&yylloc
, state
, YY_("syntax error"));
4964 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4965 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4967 YYSIZE_T yyalloc
= 2 * yysize
;
4968 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4969 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4970 if (yymsg
!= yymsgbuf
)
4971 YYSTACK_FREE (yymsg
);
4972 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4974 yymsg_alloc
= yyalloc
;
4978 yymsg_alloc
= sizeof yymsgbuf
;
4982 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4984 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4985 yyerror (&yylloc
, state
, yymsg
);
4989 yyerror (&yylloc
, state
, YY_("syntax error"));
4991 goto yyexhaustedlab
;
4997 yyerror_range
[0] = yylloc
;
4999 if (yyerrstatus
== 3)
5001 /* If just tried and failed to reuse lookahead token after an
5002 error, discard it. */
5004 if (yychar
<= YYEOF
)
5006 /* Return failure if at end of input. */
5007 if (yychar
== YYEOF
)
5012 yydestruct ("Error: discarding",
5013 yytoken
, &yylval
, &yylloc
, state
);
5018 /* Else will try to reuse lookahead token after shifting the error
5023 /*---------------------------------------------------.
5024 | yyerrorlab -- error raised explicitly by YYERROR. |
5025 `---------------------------------------------------*/
5028 /* Pacify compilers like GCC when the user code never invokes
5029 YYERROR and the label yyerrorlab therefore never appears in user
5031 if (/*CONSTCOND*/ 0)
5034 yyerror_range
[0] = yylsp
[1-yylen
];
5035 /* Do not reclaim the symbols of the rule which action triggered
5039 YY_STACK_PRINT (yyss
, yyssp
);
5044 /*-------------------------------------------------------------.
5045 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5046 `-------------------------------------------------------------*/
5048 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5052 yyn
= yypact
[yystate
];
5053 if (yyn
!= YYPACT_NINF
)
5056 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5064 /* Pop the current state because it cannot handle the error token. */
5068 yyerror_range
[0] = *yylsp
;
5069 yydestruct ("Error: popping",
5070 yystos
[yystate
], yyvsp
, yylsp
, state
);
5073 YY_STACK_PRINT (yyss
, yyssp
);
5078 yyerror_range
[1] = yylloc
;
5079 /* Using YYLLOC is tempting, but would change the location of
5080 the lookahead. YYLOC is available though. */
5081 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
5084 /* Shift the error token. */
5085 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5091 /*-------------------------------------.
5092 | yyacceptlab -- YYACCEPT comes here. |
5093 `-------------------------------------*/
5098 /*-----------------------------------.
5099 | yyabortlab -- YYABORT comes here. |
5100 `-----------------------------------*/
5105 #if !defined(yyoverflow) || YYERROR_VERBOSE
5106 /*-------------------------------------------------.
5107 | yyexhaustedlab -- memory exhaustion comes here. |
5108 `-------------------------------------------------*/
5110 yyerror (&yylloc
, state
, YY_("memory exhausted"));
5116 if (yychar
!= YYEMPTY
)
5117 yydestruct ("Cleanup: discarding lookahead",
5118 yytoken
, &yylval
, &yylloc
, state
);
5119 /* Do not reclaim the symbols of the rule which action triggered
5120 this YYABORT or YYACCEPT. */
5122 YY_STACK_PRINT (yyss
, yyssp
);
5123 while (yyssp
!= yyss
)
5125 yydestruct ("Cleanup: popping",
5126 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
5131 YYSTACK_FREE (yyss
);
5134 if (yymsg
!= yymsgbuf
)
5135 YYSTACK_FREE (yymsg
);
5137 /* Make sure YYID is used. */
5138 return YYID (yyresult
);
5143 /* Line 1675 of yacc.c */
5144 #line 2184 "program_parse.y"
5148 asm_instruction_set_operands(struct asm_instruction
*inst
,
5149 const struct prog_dst_register
*dst
,
5150 const struct asm_src_register
*src0
,
5151 const struct asm_src_register
*src1
,
5152 const struct asm_src_register
*src2
)
5154 /* In the core ARB extensions only the KIL instruction doesn't have a
5155 * destination register.
5158 init_dst_reg(& inst
->Base
.DstReg
);
5160 inst
->Base
.DstReg
= *dst
;
5163 /* The only instruction that doesn't have any source registers is the
5164 * condition-code based KIL instruction added by NV_fragment_program_option.
5167 inst
->Base
.SrcReg
[0] = src0
->Base
;
5168 inst
->SrcReg
[0] = *src0
;
5170 init_src_reg(& inst
->SrcReg
[0]);
5174 inst
->Base
.SrcReg
[1] = src1
->Base
;
5175 inst
->SrcReg
[1] = *src1
;
5177 init_src_reg(& inst
->SrcReg
[1]);
5181 inst
->Base
.SrcReg
[2] = src2
->Base
;
5182 inst
->SrcReg
[2] = *src2
;
5184 init_src_reg(& inst
->SrcReg
[2]);
5189 struct asm_instruction
*
5190 asm_instruction_ctor(gl_inst_opcode op
,
5191 const struct prog_dst_register
*dst
,
5192 const struct asm_src_register
*src0
,
5193 const struct asm_src_register
*src1
,
5194 const struct asm_src_register
*src2
)
5196 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5199 _mesa_init_instructions(& inst
->Base
, 1);
5200 inst
->Base
.Opcode
= op
;
5202 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5209 struct asm_instruction
*
5210 asm_instruction_copy_ctor(const struct prog_instruction
*base
,
5211 const struct prog_dst_register
*dst
,
5212 const struct asm_src_register
*src0
,
5213 const struct asm_src_register
*src1
,
5214 const struct asm_src_register
*src2
)
5216 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5219 _mesa_init_instructions(& inst
->Base
, 1);
5220 inst
->Base
.Opcode
= base
->Opcode
;
5221 inst
->Base
.CondUpdate
= base
->CondUpdate
;
5222 inst
->Base
.CondDst
= base
->CondDst
;
5223 inst
->Base
.SaturateMode
= base
->SaturateMode
;
5224 inst
->Base
.Precision
= base
->Precision
;
5226 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5234 init_dst_reg(struct prog_dst_register
*r
)
5236 memset(r
, 0, sizeof(*r
));
5237 r
->File
= PROGRAM_UNDEFINED
;
5238 r
->WriteMask
= WRITEMASK_XYZW
;
5239 r
->CondMask
= COND_TR
;
5240 r
->CondSwizzle
= SWIZZLE_NOOP
;
5244 /** Like init_dst_reg() but set the File and Index fields. */
5246 set_dst_reg(struct prog_dst_register
*r
, gl_register_file file
, GLint index
)
5248 const GLint maxIndex
= 1 << INST_INDEX_BITS
;
5249 const GLint minIndex
= 0;
5250 ASSERT(index
>= minIndex
);
5251 ASSERT(index
<= maxIndex
);
5252 ASSERT(file
== PROGRAM_TEMPORARY
||
5253 file
== PROGRAM_ADDRESS
||
5254 file
== PROGRAM_OUTPUT
);
5255 memset(r
, 0, sizeof(*r
));
5258 r
->WriteMask
= WRITEMASK_XYZW
;
5259 r
->CondMask
= COND_TR
;
5260 r
->CondSwizzle
= SWIZZLE_NOOP
;
5265 init_src_reg(struct asm_src_register
*r
)
5267 memset(r
, 0, sizeof(*r
));
5268 r
->Base
.File
= PROGRAM_UNDEFINED
;
5269 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5274 /** Like init_src_reg() but set the File and Index fields. */
5276 set_src_reg(struct asm_src_register
*r
, gl_register_file file
, GLint index
)
5278 const GLint maxIndex
= (1 << INST_INDEX_BITS
) - 1;
5279 const GLint minIndex
= -(1 << INST_INDEX_BITS
);
5280 ASSERT(index
>= minIndex
);
5281 ASSERT(index
<= maxIndex
);
5282 ASSERT(file
< PROGRAM_FILE_MAX
);
5283 memset(r
, 0, sizeof(*r
));
5284 r
->Base
.File
= file
;
5285 r
->Base
.Index
= index
;
5286 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5292 * Validate the set of inputs used by a program
5294 * Validates that legal sets of inputs are used by the program. In this case
5295 * "used" included both reading the input or binding the input to a name using
5296 * the \c ATTRIB command.
5299 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
5302 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
5304 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
5306 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
5307 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
5316 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
5317 struct YYLTYPE
*locp
)
5319 struct asm_symbol
*s
= NULL
;
5320 struct asm_symbol
*exist
= (struct asm_symbol
*)
5321 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
5324 if (exist
!= NULL
) {
5325 yyerror(locp
, state
, "redeclared identifier");
5327 s
= calloc(1, sizeof(struct asm_symbol
));
5333 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
5334 yyerror(locp
, state
, "too many temporaries declared");
5339 s
->temp_binding
= state
->prog
->NumTemporaries
;
5340 state
->prog
->NumTemporaries
++;
5344 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
5345 yyerror(locp
, state
, "too many address registers declared");
5350 /* FINISHME: Add support for multiple address registers.
5352 state
->prog
->NumAddressRegs
++;
5359 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
5360 s
->next
= state
->sym
;
5368 int add_state_reference(struct gl_program_parameter_list
*param_list
,
5369 const gl_state_index tokens
[STATE_LENGTH
])
5371 const GLuint size
= 4; /* XXX fix */
5375 name
= _mesa_program_state_string(tokens
);
5376 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
5377 size
, GL_NONE
, NULL
, tokens
, 0x0);
5378 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
5380 /* free name string here since we duplicated it in add_parameter() */
5388 initialize_symbol_from_state(struct gl_program
*prog
,
5389 struct asm_symbol
*param_var
,
5390 const gl_state_index tokens
[STATE_LENGTH
])
5393 gl_state_index state_tokens
[STATE_LENGTH
];
5396 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5398 param_var
->type
= at_param
;
5399 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
5401 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
5402 * unroll it and call add_state_reference() for each row
5404 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
5405 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
5406 state_tokens
[0] == STATE_MVP_MATRIX
||
5407 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
5408 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
5409 && (state_tokens
[2] != state_tokens
[3])) {
5411 const int first_row
= state_tokens
[2];
5412 const int last_row
= state_tokens
[3];
5414 for (row
= first_row
; row
<= last_row
; row
++) {
5415 state_tokens
[2] = state_tokens
[3] = row
;
5417 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5418 if (param_var
->param_binding_begin
== ~0U)
5419 param_var
->param_binding_begin
= idx
;
5420 param_var
->param_binding_length
++;
5424 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5425 if (param_var
->param_binding_begin
== ~0U)
5426 param_var
->param_binding_begin
= idx
;
5427 param_var
->param_binding_length
++;
5435 initialize_symbol_from_param(struct gl_program
*prog
,
5436 struct asm_symbol
*param_var
,
5437 const gl_state_index tokens
[STATE_LENGTH
])
5440 gl_state_index state_tokens
[STATE_LENGTH
];
5443 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5445 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
5446 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
5447 assert((state_tokens
[1] == STATE_ENV
)
5448 || (state_tokens
[1] == STATE_LOCAL
));
5450 param_var
->type
= at_param
;
5451 param_var
->param_binding_type
= (state_tokens
[1] == STATE_ENV
)
5452 ? PROGRAM_ENV_PARAM
: PROGRAM_LOCAL_PARAM
;
5454 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5455 * we need to unroll it and call add_state_reference() for each row
5457 if (state_tokens
[2] != state_tokens
[3]) {
5459 const int first_row
= state_tokens
[2];
5460 const int last_row
= state_tokens
[3];
5462 for (row
= first_row
; row
<= last_row
; row
++) {
5463 state_tokens
[2] = state_tokens
[3] = row
;
5465 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5466 if (param_var
->param_binding_begin
== ~0U)
5467 param_var
->param_binding_begin
= idx
;
5468 param_var
->param_binding_length
++;
5472 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5473 if (param_var
->param_binding_begin
== ~0U)
5474 param_var
->param_binding_begin
= idx
;
5475 param_var
->param_binding_length
++;
5483 initialize_symbol_from_const(struct gl_program
*prog
,
5484 struct asm_symbol
*param_var
,
5485 const struct asm_vector
*vec
)
5487 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
5488 NULL
, vec
->count
, GL_NONE
, vec
->data
,
5491 param_var
->type
= at_param
;
5492 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
5494 if (param_var
->param_binding_begin
== ~0U)
5495 param_var
->param_binding_begin
= idx
;
5496 param_var
->param_binding_length
++;
5503 make_error_string(const char *fmt
, ...)
5509 va_start(args
, fmt
);
5511 /* Call vsnprintf once to determine how large the final string is. Call it
5512 * again to do the actual formatting. from the vsnprintf manual page:
5514 * Upon successful return, these functions return the number of
5515 * characters printed (not including the trailing '\0' used to end
5516 * output to strings).
5518 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
5520 str
= _mesa_malloc(length
);
5522 vsnprintf(str
, length
, fmt
, args
);
5532 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
5537 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
5539 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
5540 _mesa_free(err_str
);
5543 err_str
= make_error_string("line %u, char %u: error: %s\n",
5544 locp
->first_line
, locp
->first_column
, s
);
5545 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
5548 _mesa_free(err_str
);
5554 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
5555 GLsizei len
, struct asm_parser_state
*state
)
5557 struct asm_instruction
*inst
;
5560 GLboolean result
= GL_FALSE
;
5562 struct asm_symbol
*sym
;
5565 state
->prog
->Target
= target
;
5566 state
->prog
->Parameters
= _mesa_new_parameter_list();
5568 /* Make a copy of the program string and force it to be NUL-terminated.
5570 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
5572 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5575 _mesa_memcpy (strz
, str
, len
);
5578 state
->prog
->String
= strz
;
5580 state
->st
= _mesa_symbol_table_ctor();
5582 state
->limits
= (target
== GL_VERTEX_PROGRAM_ARB
)
5583 ? & ctx
->Const
.VertexProgram
5584 : & ctx
->Const
.FragmentProgram
;
5586 state
->MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
5587 state
->MaxTextureCoordUnits
= ctx
->Const
.MaxTextureCoordUnits
;
5588 state
->MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
5589 state
->MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
5590 state
->MaxLights
= ctx
->Const
.MaxLights
;
5591 state
->MaxProgramMatrices
= ctx
->Const
.MaxProgramMatrices
;
5593 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
5594 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
5596 _mesa_set_program_error(ctx
, -1, NULL
);
5598 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
5600 _mesa_program_lexer_dtor(state
->scanner
);
5603 if (ctx
->Program
.ErrorPos
!= -1) {
5607 if (! _mesa_layout_parameters(state
)) {
5611 loc
.first_column
= 0;
5614 yyerror(& loc
, state
, "invalid PARAM usage");
5620 /* Add one instruction to store the "END" instruction.
5622 state
->prog
->Instructions
=
5623 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5624 inst
= state
->inst_head
;
5625 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5626 struct asm_instruction
*const temp
= inst
->next
;
5628 state
->prog
->Instructions
[i
] = inst
->Base
;
5632 /* Finally, tag on an OPCODE_END instruction */
5634 const GLuint numInst
= state
->prog
->NumInstructions
;
5635 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5636 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5638 state
->prog
->NumInstructions
++;
5640 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5641 state
->prog
->NumAttributes
= _mesa_bitcount(state
->prog
->InputsRead
);
5644 * Initialize native counts to logical counts. The device driver may
5645 * change them if program is translated into a hardware program.
5647 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5648 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5649 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5650 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5651 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5656 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5661 state
->inst_head
= NULL
;
5662 state
->inst_tail
= NULL
;
5664 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5667 _mesa_free((void *) sym
->name
);
5672 _mesa_symbol_table_dtor(state
->st
);