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, 323, 324,
792 327, 342, 345, 350, 357, 358, 359, 360, 361, 362,
793 363, 366, 367, 368, 371, 377, 383, 389, 396, 402,
794 409, 453, 458, 468, 512, 518, 519, 520, 521, 522,
795 523, 524, 525, 526, 527, 528, 529, 532, 544, 552,
796 569, 576, 593, 604, 624, 649, 656, 689, 696, 711,
797 761, 800, 809, 830, 839, 843, 870, 887, 887, 889,
798 896, 908, 909, 910, 913, 927, 941, 959, 970, 982,
799 984, 985, 986, 987, 990, 990, 990, 990, 991, 994,
800 998, 1003, 1010, 1017, 1024, 1047, 1070, 1071, 1072, 1073,
801 1074, 1075, 1078, 1096, 1100, 1106, 1110, 1114, 1118, 1127,
802 1136, 1140, 1145, 1151, 1162, 1162, 1163, 1165, 1169, 1173,
803 1177, 1183, 1183, 1185, 1201, 1224, 1227, 1238, 1244, 1250,
804 1251, 1258, 1264, 1270, 1278, 1284, 1290, 1298, 1304, 1310,
805 1318, 1319, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329,
806 1330, 1331, 1332, 1335, 1344, 1348, 1352, 1358, 1367, 1371,
807 1375, 1384, 1388, 1394, 1400, 1407, 1412, 1420, 1430, 1432,
808 1440, 1446, 1450, 1454, 1460, 1471, 1480, 1484, 1489, 1493,
809 1497, 1501, 1507, 1514, 1518, 1524, 1532, 1543, 1550, 1554,
810 1560, 1570, 1581, 1585, 1603, 1612, 1615, 1621, 1625, 1629,
811 1635, 1646, 1651, 1656, 1661, 1666, 1671, 1679, 1682, 1687,
812 1700, 1708, 1719, 1727, 1727, 1729, 1729, 1731, 1741, 1746,
813 1753, 1763, 1772, 1777, 1784, 1794, 1804, 1816, 1816, 1817,
814 1817, 1819, 1829, 1837, 1847, 1855, 1863, 1872, 1883, 1887,
815 1893, 1894, 1895, 1898, 1898, 1901, 1936, 1940, 1940, 1943,
816 1949, 1957, 1970, 1979, 1988, 1992, 2001, 2010, 2021, 2028,
817 2033, 2042, 2054, 2057, 2066, 2077, 2078, 2079, 2082, 2083,
818 2084, 2087, 2088, 2091, 2092, 2095, 2096, 2099, 2110, 2121,
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
));
2168 const char *const err_str
= (state
->mode
== ARB_vertex
)
2169 ? "invalid ARB vertex program option"
2170 : "invalid ARB fragment program option";
2172 yyerror(& (yylsp
[(2) - (3)]), state
, err_str
);
2180 /* Line 1455 of yacc.c */
2181 #line 328 "program_parse.y"
2183 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2184 if (state
->inst_tail
== NULL
) {
2185 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2187 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2190 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2191 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2193 state
->prog
->NumInstructions
++;
2200 /* Line 1455 of yacc.c */
2201 #line 346 "program_parse.y"
2203 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2204 state
->prog
->NumAluInstructions
++;
2210 /* Line 1455 of yacc.c */
2211 #line 351 "program_parse.y"
2213 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2214 state
->prog
->NumTexInstructions
++;
2220 /* Line 1455 of yacc.c */
2221 #line 372 "program_parse.y"
2223 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2229 /* Line 1455 of yacc.c */
2230 #line 378 "program_parse.y"
2232 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2238 /* Line 1455 of yacc.c */
2239 #line 384 "program_parse.y"
2241 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2247 /* Line 1455 of yacc.c */
2248 #line 390 "program_parse.y"
2250 (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
);
2256 /* Line 1455 of yacc.c */
2257 #line 397 "program_parse.y"
2259 (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
);
2265 /* Line 1455 of yacc.c */
2266 #line 404 "program_parse.y"
2268 (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
));
2274 /* Line 1455 of yacc.c */
2275 #line 410 "program_parse.y"
2277 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (8)].temp_inst
), & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2278 if ((yyval
.inst
) != NULL
) {
2279 const GLbitfield tex_mask
= (1U << (yyvsp
[(6) - (8)].integer
));
2280 GLbitfield shadow_tex
= 0;
2281 GLbitfield target_mask
= 0;
2284 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2286 if ((yyvsp
[(8) - (8)].integer
) < 0) {
2287 shadow_tex
= tex_mask
;
2289 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(8) - (8)].integer
);
2290 (yyval
.inst
)->Base
.TexShadow
= 1;
2292 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2295 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2297 /* If this texture unit was previously accessed and that access
2298 * had a different texture target, generate an error.
2300 * If this texture unit was previously accessed and that access
2301 * had a different shadow mode, generate an error.
2303 if ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != 0)
2304 && ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != target_mask
)
2305 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2307 yyerror(& (yylsp
[(8) - (8)]), state
,
2308 "multiple targets used on one texture image unit");
2313 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= target_mask
;
2314 state
->prog
->ShadowSamplers
|= shadow_tex
;
2321 /* Line 1455 of yacc.c */
2322 #line 454 "program_parse.y"
2324 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2325 state
->fragment
.UsesKill
= 1;
2331 /* Line 1455 of yacc.c */
2332 #line 459 "program_parse.y"
2334 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL_NV
, NULL
, NULL
, NULL
, NULL
);
2335 (yyval
.inst
)->Base
.DstReg
.CondMask
= (yyvsp
[(2) - (2)].dst_reg
).CondMask
;
2336 (yyval
.inst
)->Base
.DstReg
.CondSwizzle
= (yyvsp
[(2) - (2)].dst_reg
).CondSwizzle
;
2337 (yyval
.inst
)->Base
.DstReg
.CondSrc
= (yyvsp
[(2) - (2)].dst_reg
).CondSrc
;
2338 state
->fragment
.UsesKill
= 1;
2344 /* Line 1455 of yacc.c */
2345 #line 469 "program_parse.y"
2347 (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
));
2348 if ((yyval
.inst
) != NULL
) {
2349 const GLbitfield tex_mask
= (1U << (yyvsp
[(10) - (12)].integer
));
2350 GLbitfield shadow_tex
= 0;
2351 GLbitfield target_mask
= 0;
2354 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(10) - (12)].integer
);
2356 if ((yyvsp
[(12) - (12)].integer
) < 0) {
2357 shadow_tex
= tex_mask
;
2359 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(12) - (12)].integer
);
2360 (yyval
.inst
)->Base
.TexShadow
= 1;
2362 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(12) - (12)].integer
);
2365 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2367 /* If this texture unit was previously accessed and that access
2368 * had a different texture target, generate an error.
2370 * If this texture unit was previously accessed and that access
2371 * had a different shadow mode, generate an error.
2373 if ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != 0)
2374 && ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != target_mask
)
2375 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2377 yyerror(& (yylsp
[(12) - (12)]), state
,
2378 "multiple targets used on one texture image unit");
2383 state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] |= target_mask
;
2384 state
->prog
->ShadowSamplers
|= shadow_tex
;
2391 /* Line 1455 of yacc.c */
2392 #line 513 "program_parse.y"
2394 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2400 /* Line 1455 of yacc.c */
2401 #line 518 "program_parse.y"
2402 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2407 /* Line 1455 of yacc.c */
2408 #line 519 "program_parse.y"
2409 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2414 /* Line 1455 of yacc.c */
2415 #line 520 "program_parse.y"
2416 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2421 /* Line 1455 of yacc.c */
2422 #line 521 "program_parse.y"
2423 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2428 /* Line 1455 of yacc.c */
2429 #line 522 "program_parse.y"
2430 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2435 /* Line 1455 of yacc.c */
2436 #line 523 "program_parse.y"
2437 { (yyval
.integer
) = -TEXTURE_1D_INDEX
; ;}
2442 /* Line 1455 of yacc.c */
2443 #line 524 "program_parse.y"
2444 { (yyval
.integer
) = -TEXTURE_2D_INDEX
; ;}
2449 /* Line 1455 of yacc.c */
2450 #line 525 "program_parse.y"
2451 { (yyval
.integer
) = -TEXTURE_RECT_INDEX
; ;}
2456 /* Line 1455 of yacc.c */
2457 #line 526 "program_parse.y"
2458 { (yyval
.integer
) = TEXTURE_1D_ARRAY_INDEX
; ;}
2463 /* Line 1455 of yacc.c */
2464 #line 527 "program_parse.y"
2465 { (yyval
.integer
) = TEXTURE_2D_ARRAY_INDEX
; ;}
2470 /* Line 1455 of yacc.c */
2471 #line 528 "program_parse.y"
2472 { (yyval
.integer
) = -TEXTURE_1D_ARRAY_INDEX
; ;}
2477 /* Line 1455 of yacc.c */
2478 #line 529 "program_parse.y"
2479 { (yyval
.integer
) = -TEXTURE_2D_ARRAY_INDEX
; ;}
2484 /* Line 1455 of yacc.c */
2485 #line 533 "program_parse.y"
2487 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2488 * FIXME: to the existing swizzle?
2490 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2491 (yyvsp
[(4) - (6)].src_reg
).Base
.Negate
= (yyvsp
[(6) - (6)].swiz_mask
).mask
;
2493 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2499 /* Line 1455 of yacc.c */
2500 #line 545 "program_parse.y"
2502 (yyval
.src_reg
) = (yyvsp
[(2) - (2)].src_reg
);
2504 if ((yyvsp
[(1) - (2)].negate
)) {
2505 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2512 /* Line 1455 of yacc.c */
2513 #line 553 "program_parse.y"
2515 (yyval
.src_reg
) = (yyvsp
[(3) - (4)].src_reg
);
2517 if (!state
->option
.NV_fragment
) {
2518 yyerror(& (yylsp
[(2) - (4)]), state
, "unexpected character '|'");
2522 if ((yyvsp
[(1) - (4)].negate
)) {
2523 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2526 (yyval
.src_reg
).Base
.Abs
= 1;
2532 /* Line 1455 of yacc.c */
2533 #line 570 "program_parse.y"
2535 (yyval
.src_reg
) = (yyvsp
[(1) - (2)].src_reg
);
2537 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2538 (yyvsp
[(2) - (2)].swiz_mask
).swizzle
);
2544 /* Line 1455 of yacc.c */
2545 #line 577 "program_parse.y"
2547 struct asm_symbol temp_sym
;
2549 if (!state
->option
.NV_fragment
) {
2550 yyerror(& (yylsp
[(1) - (1)]), state
, "expected scalar suffix");
2554 memset(& temp_sym
, 0, sizeof(temp_sym
));
2555 temp_sym
.param_binding_begin
= ~0;
2556 initialize_symbol_from_const(state
->prog
, & temp_sym
, & (yyvsp
[(1) - (1)].vector
));
2558 set_src_reg(& (yyval
.src_reg
), PROGRAM_CONSTANT
, temp_sym
.param_binding_begin
);
2564 /* Line 1455 of yacc.c */
2565 #line 594 "program_parse.y"
2567 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2569 if ((yyvsp
[(1) - (3)].negate
)) {
2570 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2573 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2574 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2580 /* Line 1455 of yacc.c */
2581 #line 605 "program_parse.y"
2583 (yyval
.src_reg
) = (yyvsp
[(3) - (5)].src_reg
);
2585 if (!state
->option
.NV_fragment
) {
2586 yyerror(& (yylsp
[(2) - (5)]), state
, "unexpected character '|'");
2590 if ((yyvsp
[(1) - (5)].negate
)) {
2591 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2594 (yyval
.src_reg
).Base
.Abs
= 1;
2595 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2596 (yyvsp
[(4) - (5)].swiz_mask
).swizzle
);
2602 /* Line 1455 of yacc.c */
2603 #line 625 "program_parse.y"
2605 (yyval
.dst_reg
) = (yyvsp
[(1) - (3)].dst_reg
);
2606 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (3)].swiz_mask
).mask
;
2607 (yyval
.dst_reg
).CondMask
= (yyvsp
[(3) - (3)].dst_reg
).CondMask
;
2608 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(3) - (3)].dst_reg
).CondSwizzle
;
2609 (yyval
.dst_reg
).CondSrc
= (yyvsp
[(3) - (3)].dst_reg
).CondSrc
;
2611 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2612 /* Technically speaking, this should check that it is in
2613 * vertex program mode. However, PositionInvariant can never be
2614 * set in fragment program mode, so it is somewhat irrelevant.
2616 if (state
->option
.PositionInvariant
2617 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2618 yyerror(& (yylsp
[(1) - (3)]), state
, "position-invariant programs cannot "
2623 state
->prog
->OutputsWritten
|= (1U << (yyval
.dst_reg
).Index
);
2630 /* Line 1455 of yacc.c */
2631 #line 650 "program_parse.y"
2633 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_ADDRESS
, 0);
2634 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2640 /* Line 1455 of yacc.c */
2641 #line 657 "program_parse.y"
2643 const unsigned xyzw_valid
=
2644 ((yyvsp
[(1) - (7)].ext_swizzle
).xyzw_valid
<< 0)
2645 | ((yyvsp
[(3) - (7)].ext_swizzle
).xyzw_valid
<< 1)
2646 | ((yyvsp
[(5) - (7)].ext_swizzle
).xyzw_valid
<< 2)
2647 | ((yyvsp
[(7) - (7)].ext_swizzle
).xyzw_valid
<< 3);
2648 const unsigned rgba_valid
=
2649 ((yyvsp
[(1) - (7)].ext_swizzle
).rgba_valid
<< 0)
2650 | ((yyvsp
[(3) - (7)].ext_swizzle
).rgba_valid
<< 1)
2651 | ((yyvsp
[(5) - (7)].ext_swizzle
).rgba_valid
<< 2)
2652 | ((yyvsp
[(7) - (7)].ext_swizzle
).rgba_valid
<< 3);
2654 /* All of the swizzle components have to be valid in either RGBA
2655 * or XYZW. Note that 0 and 1 are valid in both, so both masks
2656 * can have some bits set.
2658 * We somewhat deviate from the spec here. It would be really hard
2659 * to figure out which component is the error, and there probably
2660 * isn't a lot of benefit.
2662 if ((rgba_valid
!= 0x0f) && (xyzw_valid
!= 0x0f)) {
2663 yyerror(& (yylsp
[(1) - (7)]), state
, "cannot combine RGBA and XYZW swizzle "
2668 (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
);
2669 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].ext_swizzle
).negate
) | ((yyvsp
[(3) - (7)].ext_swizzle
).negate
<< 1) | ((yyvsp
[(5) - (7)].ext_swizzle
).negate
<< 2)
2670 | ((yyvsp
[(7) - (7)].ext_swizzle
).negate
<< 3);
2676 /* Line 1455 of yacc.c */
2677 #line 690 "program_parse.y"
2679 (yyval
.ext_swizzle
) = (yyvsp
[(2) - (2)].ext_swizzle
);
2680 (yyval
.ext_swizzle
).negate
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2686 /* Line 1455 of yacc.c */
2687 #line 697 "program_parse.y"
2689 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2690 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2694 (yyval
.ext_swizzle
).swz
= ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2696 /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2699 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2700 (yyval
.ext_swizzle
).rgba_valid
= 1;
2706 /* Line 1455 of yacc.c */
2707 #line 712 "program_parse.y"
2709 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2710 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2714 switch ((yyvsp
[(1) - (1)].string
)[0]) {
2716 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2717 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2720 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2721 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2724 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2725 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2728 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2729 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2733 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2734 (yyval
.ext_swizzle
).rgba_valid
= 1;
2737 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2738 (yyval
.ext_swizzle
).rgba_valid
= 1;
2741 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2742 (yyval
.ext_swizzle
).rgba_valid
= 1;
2745 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2746 (yyval
.ext_swizzle
).rgba_valid
= 1;
2750 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2759 /* Line 1455 of yacc.c */
2760 #line 762 "program_parse.y"
2762 struct asm_symbol
*const s
= (struct asm_symbol
*)
2763 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2766 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2768 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2769 && (s
->type
!= at_attrib
)) {
2770 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2772 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2773 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2777 init_src_reg(& (yyval
.src_reg
));
2780 set_src_reg(& (yyval
.src_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2783 set_src_reg(& (yyval
.src_reg
), s
->param_binding_type
, s
->param_binding_begin
);
2786 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, s
->attrib_binding
);
2787 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2789 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2803 /* Line 1455 of yacc.c */
2804 #line 801 "program_parse.y"
2806 set_src_reg(& (yyval
.src_reg
), PROGRAM_INPUT
, (yyvsp
[(1) - (1)].attrib
));
2807 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2809 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2817 /* Line 1455 of yacc.c */
2818 #line 810 "program_parse.y"
2820 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2821 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2822 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2826 init_src_reg(& (yyval
.src_reg
));
2827 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2829 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2830 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2832 (yyval
.src_reg
).Base
.RelAddr
= 1;
2833 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2834 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2836 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2843 /* Line 1455 of yacc.c */
2844 #line 831 "program_parse.y"
2846 gl_register_file file
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2847 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2849 set_src_reg(& (yyval
.src_reg
), file
, (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
);
2855 /* Line 1455 of yacc.c */
2856 #line 840 "program_parse.y"
2858 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, (yyvsp
[(1) - (1)].result
));
2864 /* Line 1455 of yacc.c */
2865 #line 844 "program_parse.y"
2867 struct asm_symbol
*const s
= (struct asm_symbol
*)
2868 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2871 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2873 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2874 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2880 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_TEMPORARY
, s
->temp_binding
);
2883 set_dst_reg(& (yyval
.dst_reg
), PROGRAM_OUTPUT
, s
->output_binding
);
2886 set_dst_reg(& (yyval
.dst_reg
), s
->param_binding_type
, s
->param_binding_begin
);
2894 /* Line 1455 of yacc.c */
2895 #line 871 "program_parse.y"
2897 struct asm_symbol
*const s
= (struct asm_symbol
*)
2898 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2901 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2903 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2904 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2914 /* Line 1455 of yacc.c */
2915 #line 890 "program_parse.y"
2917 init_src_reg(& (yyval
.src_reg
));
2918 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2924 /* Line 1455 of yacc.c */
2925 #line 897 "program_parse.y"
2927 /* FINISHME: Add support for multiple address registers.
2929 /* FINISHME: Add support for 4-component address registers.
2931 init_src_reg(& (yyval
.src_reg
));
2932 (yyval
.src_reg
).Base
.RelAddr
= 1;
2933 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2939 /* Line 1455 of yacc.c */
2940 #line 908 "program_parse.y"
2941 { (yyval
.integer
) = 0; ;}
2946 /* Line 1455 of yacc.c */
2947 #line 909 "program_parse.y"
2948 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2953 /* Line 1455 of yacc.c */
2954 #line 910 "program_parse.y"
2955 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2960 /* Line 1455 of yacc.c */
2961 #line 914 "program_parse.y"
2963 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2965 _mesa_snprintf(s
, sizeof(s
),
2966 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2967 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2970 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2977 /* Line 1455 of yacc.c */
2978 #line 928 "program_parse.y"
2980 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2982 _mesa_snprintf(s
, sizeof(s
),
2983 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2984 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2987 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2994 /* Line 1455 of yacc.c */
2995 #line 942 "program_parse.y"
2997 struct asm_symbol
*const s
= (struct asm_symbol
*)
2998 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
3001 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
3003 } else if (s
->type
!= at_address
) {
3004 yyerror(& (yylsp
[(1) - (1)]), state
,
3005 "invalid variable for indexed array access");
3015 /* Line 1455 of yacc.c */
3016 #line 960 "program_parse.y"
3018 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3019 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
3022 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3029 /* Line 1455 of yacc.c */
3030 #line 971 "program_parse.y"
3032 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3033 yyerror(& (yylsp
[(1) - (1)]), state
,
3034 "address register write mask must be \".x\"");
3037 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3044 /* Line 1455 of yacc.c */
3045 #line 987 "program_parse.y"
3046 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3051 /* Line 1455 of yacc.c */
3052 #line 991 "program_parse.y"
3053 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3058 /* Line 1455 of yacc.c */
3059 #line 995 "program_parse.y"
3061 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3067 /* Line 1455 of yacc.c */
3068 #line 999 "program_parse.y"
3070 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3076 /* Line 1455 of yacc.c */
3077 #line 1003 "program_parse.y"
3079 (yyval
.dst_reg
).CondMask
= COND_TR
;
3080 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3081 (yyval
.dst_reg
).CondSrc
= 0;
3087 /* Line 1455 of yacc.c */
3088 #line 1011 "program_parse.y"
3090 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3091 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3097 /* Line 1455 of yacc.c */
3098 #line 1018 "program_parse.y"
3100 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3101 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3107 /* Line 1455 of yacc.c */
3108 #line 1025 "program_parse.y"
3110 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3111 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3112 char *const err_str
=
3113 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3115 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3116 ? err_str
: "invalid condition code");
3118 if (err_str
!= NULL
) {
3119 _mesa_free(err_str
);
3125 (yyval
.dst_reg
).CondMask
= cond
;
3126 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3127 (yyval
.dst_reg
).CondSrc
= 0;
3133 /* Line 1455 of yacc.c */
3134 #line 1048 "program_parse.y"
3136 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3137 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3138 char *const err_str
=
3139 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3141 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3142 ? err_str
: "invalid condition code");
3144 if (err_str
!= NULL
) {
3145 _mesa_free(err_str
);
3151 (yyval
.dst_reg
).CondMask
= cond
;
3152 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3153 (yyval
.dst_reg
).CondSrc
= 0;
3159 /* Line 1455 of yacc.c */
3160 #line 1079 "program_parse.y"
3162 struct asm_symbol
*const s
=
3163 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
3168 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
3169 state
->InputsBound
|= (1U << s
->attrib_binding
);
3171 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
3180 /* Line 1455 of yacc.c */
3181 #line 1097 "program_parse.y"
3183 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3189 /* Line 1455 of yacc.c */
3190 #line 1101 "program_parse.y"
3192 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3198 /* Line 1455 of yacc.c */
3199 #line 1107 "program_parse.y"
3201 (yyval
.attrib
) = VERT_ATTRIB_POS
;
3207 /* Line 1455 of yacc.c */
3208 #line 1111 "program_parse.y"
3210 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
3216 /* Line 1455 of yacc.c */
3217 #line 1115 "program_parse.y"
3219 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
3225 /* Line 1455 of yacc.c */
3226 #line 1119 "program_parse.y"
3228 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
3229 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
3233 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
3239 /* Line 1455 of yacc.c */
3240 #line 1128 "program_parse.y"
3242 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
3243 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
3247 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
3253 /* Line 1455 of yacc.c */
3254 #line 1137 "program_parse.y"
3256 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3262 /* Line 1455 of yacc.c */
3263 #line 1141 "program_parse.y"
3265 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3272 /* Line 1455 of yacc.c */
3273 #line 1146 "program_parse.y"
3275 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
3281 /* Line 1455 of yacc.c */
3282 #line 1152 "program_parse.y"
3284 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
3285 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
3289 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3295 /* Line 1455 of yacc.c */
3296 #line 1166 "program_parse.y"
3298 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
3304 /* Line 1455 of yacc.c */
3305 #line 1170 "program_parse.y"
3307 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
3313 /* Line 1455 of yacc.c */
3314 #line 1174 "program_parse.y"
3316 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
3322 /* Line 1455 of yacc.c */
3323 #line 1178 "program_parse.y"
3325 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3331 /* Line 1455 of yacc.c */
3332 #line 1186 "program_parse.y"
3334 struct asm_symbol
*const s
=
3335 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
3340 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
3341 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
3342 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3343 s
->param_is_array
= 0;
3350 /* Line 1455 of yacc.c */
3351 #line 1202 "program_parse.y"
3353 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
3354 yyerror(& (yylsp
[(4) - (6)]), state
,
3355 "parameter array size and number of bindings must match");
3358 struct asm_symbol
*const s
=
3359 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
3364 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
3365 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
3366 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
3367 s
->param_is_array
= 1;
3375 /* Line 1455 of yacc.c */
3376 #line 1224 "program_parse.y"
3378 (yyval
.integer
) = 0;
3384 /* Line 1455 of yacc.c */
3385 #line 1228 "program_parse.y"
3387 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) > state
->limits
->MaxParameters
)) {
3388 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
3391 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3398 /* Line 1455 of yacc.c */
3399 #line 1239 "program_parse.y"
3401 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
3407 /* Line 1455 of yacc.c */
3408 #line 1245 "program_parse.y"
3410 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
3416 /* Line 1455 of yacc.c */
3417 #line 1252 "program_parse.y"
3419 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3420 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
3426 /* Line 1455 of yacc.c */
3427 #line 1259 "program_parse.y"
3429 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3430 (yyval
.temp_sym
).param_binding_begin
= ~0;
3431 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3437 /* Line 1455 of yacc.c */
3438 #line 1265 "program_parse.y"
3440 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3441 (yyval
.temp_sym
).param_binding_begin
= ~0;
3442 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3448 /* Line 1455 of yacc.c */
3449 #line 1271 "program_parse.y"
3451 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3452 (yyval
.temp_sym
).param_binding_begin
= ~0;
3453 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3459 /* Line 1455 of yacc.c */
3460 #line 1279 "program_parse.y"
3462 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3463 (yyval
.temp_sym
).param_binding_begin
= ~0;
3464 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3470 /* Line 1455 of yacc.c */
3471 #line 1285 "program_parse.y"
3473 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3474 (yyval
.temp_sym
).param_binding_begin
= ~0;
3475 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3481 /* Line 1455 of yacc.c */
3482 #line 1291 "program_parse.y"
3484 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3485 (yyval
.temp_sym
).param_binding_begin
= ~0;
3486 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3492 /* Line 1455 of yacc.c */
3493 #line 1299 "program_parse.y"
3495 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3496 (yyval
.temp_sym
).param_binding_begin
= ~0;
3497 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3503 /* Line 1455 of yacc.c */
3504 #line 1305 "program_parse.y"
3506 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3507 (yyval
.temp_sym
).param_binding_begin
= ~0;
3508 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3514 /* Line 1455 of yacc.c */
3515 #line 1311 "program_parse.y"
3517 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3518 (yyval
.temp_sym
).param_binding_begin
= ~0;
3519 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3525 /* Line 1455 of yacc.c */
3526 #line 1318 "program_parse.y"
3527 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3532 /* Line 1455 of yacc.c */
3533 #line 1319 "program_parse.y"
3534 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3539 /* Line 1455 of yacc.c */
3540 #line 1322 "program_parse.y"
3541 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3546 /* Line 1455 of yacc.c */
3547 #line 1323 "program_parse.y"
3548 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3553 /* Line 1455 of yacc.c */
3554 #line 1324 "program_parse.y"
3555 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3560 /* Line 1455 of yacc.c */
3561 #line 1325 "program_parse.y"
3562 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3567 /* Line 1455 of yacc.c */
3568 #line 1326 "program_parse.y"
3569 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3574 /* Line 1455 of yacc.c */
3575 #line 1327 "program_parse.y"
3576 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3581 /* Line 1455 of yacc.c */
3582 #line 1328 "program_parse.y"
3583 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3588 /* Line 1455 of yacc.c */
3589 #line 1329 "program_parse.y"
3590 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3595 /* Line 1455 of yacc.c */
3596 #line 1330 "program_parse.y"
3597 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3602 /* Line 1455 of yacc.c */
3603 #line 1331 "program_parse.y"
3604 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3609 /* Line 1455 of yacc.c */
3610 #line 1332 "program_parse.y"
3611 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3616 /* Line 1455 of yacc.c */
3617 #line 1336 "program_parse.y"
3619 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3620 (yyval
.state
)[0] = STATE_MATERIAL
;
3621 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3622 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3628 /* Line 1455 of yacc.c */
3629 #line 1345 "program_parse.y"
3631 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3637 /* Line 1455 of yacc.c */
3638 #line 1349 "program_parse.y"
3640 (yyval
.integer
) = STATE_EMISSION
;
3646 /* Line 1455 of yacc.c */
3647 #line 1353 "program_parse.y"
3649 (yyval
.integer
) = STATE_SHININESS
;
3655 /* Line 1455 of yacc.c */
3656 #line 1359 "program_parse.y"
3658 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3659 (yyval
.state
)[0] = STATE_LIGHT
;
3660 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3661 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3667 /* Line 1455 of yacc.c */
3668 #line 1368 "program_parse.y"
3670 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3676 /* Line 1455 of yacc.c */
3677 #line 1372 "program_parse.y"
3679 (yyval
.integer
) = STATE_POSITION
;
3685 /* Line 1455 of yacc.c */
3686 #line 1376 "program_parse.y"
3688 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3689 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3693 (yyval
.integer
) = STATE_ATTENUATION
;
3699 /* Line 1455 of yacc.c */
3700 #line 1385 "program_parse.y"
3702 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3708 /* Line 1455 of yacc.c */
3709 #line 1389 "program_parse.y"
3711 (yyval
.integer
) = STATE_HALF_VECTOR
;
3717 /* Line 1455 of yacc.c */
3718 #line 1395 "program_parse.y"
3720 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3726 /* Line 1455 of yacc.c */
3727 #line 1401 "program_parse.y"
3729 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3730 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3736 /* Line 1455 of yacc.c */
3737 #line 1408 "program_parse.y"
3739 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3740 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3746 /* Line 1455 of yacc.c */
3747 #line 1413 "program_parse.y"
3749 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3750 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3751 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3757 /* Line 1455 of yacc.c */
3758 #line 1421 "program_parse.y"
3760 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3761 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3762 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3763 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3764 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3770 /* Line 1455 of yacc.c */
3771 #line 1433 "program_parse.y"
3773 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3774 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3775 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3781 /* Line 1455 of yacc.c */
3782 #line 1441 "program_parse.y"
3784 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3790 /* Line 1455 of yacc.c */
3791 #line 1447 "program_parse.y"
3793 (yyval
.integer
) = STATE_AMBIENT
;
3799 /* Line 1455 of yacc.c */
3800 #line 1451 "program_parse.y"
3802 (yyval
.integer
) = STATE_DIFFUSE
;
3808 /* Line 1455 of yacc.c */
3809 #line 1455 "program_parse.y"
3811 (yyval
.integer
) = STATE_SPECULAR
;
3817 /* Line 1455 of yacc.c */
3818 #line 1461 "program_parse.y"
3820 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3821 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3825 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3831 /* Line 1455 of yacc.c */
3832 #line 1472 "program_parse.y"
3834 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3835 (yyval
.state
)[0] = STATE_TEXGEN
;
3836 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3837 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3843 /* Line 1455 of yacc.c */
3844 #line 1481 "program_parse.y"
3846 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3852 /* Line 1455 of yacc.c */
3853 #line 1485 "program_parse.y"
3855 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3861 /* Line 1455 of yacc.c */
3862 #line 1490 "program_parse.y"
3864 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3870 /* Line 1455 of yacc.c */
3871 #line 1494 "program_parse.y"
3873 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3879 /* Line 1455 of yacc.c */
3880 #line 1498 "program_parse.y"
3882 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3888 /* Line 1455 of yacc.c */
3889 #line 1502 "program_parse.y"
3891 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3897 /* Line 1455 of yacc.c */
3898 #line 1508 "program_parse.y"
3900 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3901 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3907 /* Line 1455 of yacc.c */
3908 #line 1515 "program_parse.y"
3910 (yyval
.integer
) = STATE_FOG_COLOR
;
3916 /* Line 1455 of yacc.c */
3917 #line 1519 "program_parse.y"
3919 (yyval
.integer
) = STATE_FOG_PARAMS
;
3925 /* Line 1455 of yacc.c */
3926 #line 1525 "program_parse.y"
3928 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3929 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3930 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3936 /* Line 1455 of yacc.c */
3937 #line 1533 "program_parse.y"
3939 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3940 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3944 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3950 /* Line 1455 of yacc.c */
3951 #line 1544 "program_parse.y"
3953 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3954 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3960 /* Line 1455 of yacc.c */
3961 #line 1551 "program_parse.y"
3963 (yyval
.integer
) = STATE_POINT_SIZE
;
3969 /* Line 1455 of yacc.c */
3970 #line 1555 "program_parse.y"
3972 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3978 /* Line 1455 of yacc.c */
3979 #line 1561 "program_parse.y"
3981 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
3982 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
3983 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3984 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3985 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
3991 /* Line 1455 of yacc.c */
3992 #line 1571 "program_parse.y"
3994 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
3995 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
3996 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
3997 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
3998 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
4004 /* Line 1455 of yacc.c */
4005 #line 1581 "program_parse.y"
4007 (yyval
.state
)[2] = 0;
4008 (yyval
.state
)[3] = 3;
4014 /* Line 1455 of yacc.c */
4015 #line 1586 "program_parse.y"
4017 /* It seems logical that the matrix row range specifier would have
4018 * to specify a range or more than one row (i.e., $5 > $3).
4019 * However, the ARB_vertex_program spec says "a program will fail
4020 * to load if <a> is greater than <b>." This means that $3 == $5
4023 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
4024 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
4028 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
4029 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
4035 /* Line 1455 of yacc.c */
4036 #line 1604 "program_parse.y"
4038 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
4039 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
4040 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
4046 /* Line 1455 of yacc.c */
4047 #line 1612 "program_parse.y"
4049 (yyval
.integer
) = 0;
4055 /* Line 1455 of yacc.c */
4056 #line 1616 "program_parse.y"
4058 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4064 /* Line 1455 of yacc.c */
4065 #line 1622 "program_parse.y"
4067 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
4073 /* Line 1455 of yacc.c */
4074 #line 1626 "program_parse.y"
4076 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
4082 /* Line 1455 of yacc.c */
4083 #line 1630 "program_parse.y"
4085 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
4091 /* Line 1455 of yacc.c */
4092 #line 1636 "program_parse.y"
4094 if ((yyvsp
[(1) - (1)].integer
) > 3) {
4095 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
4099 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4105 /* Line 1455 of yacc.c */
4106 #line 1647 "program_parse.y"
4108 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
4109 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4115 /* Line 1455 of yacc.c */
4116 #line 1652 "program_parse.y"
4118 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
4119 (yyval
.state
)[1] = 0;
4125 /* Line 1455 of yacc.c */
4126 #line 1657 "program_parse.y"
4128 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
4129 (yyval
.state
)[1] = 0;
4135 /* Line 1455 of yacc.c */
4136 #line 1662 "program_parse.y"
4138 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
4139 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4145 /* Line 1455 of yacc.c */
4146 #line 1667 "program_parse.y"
4148 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
4155 /* Line 1455 of yacc.c */
4156 #line 1672 "program_parse.y"
4158 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
4159 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
4165 /* Line 1455 of yacc.c */
4166 #line 1679 "program_parse.y"
4168 (yyval
.integer
) = 0;
4174 /* Line 1455 of yacc.c */
4175 #line 1683 "program_parse.y"
4177 (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
);
4183 /* Line 1455 of yacc.c */
4184 #line 1688 "program_parse.y"
4186 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
4189 if ((yyvsp
[(1) - (1)].integer
) != 0) {
4190 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
4194 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4200 /* Line 1455 of yacc.c */
4201 #line 1701 "program_parse.y"
4203 /* Since GL_ARB_matrix_palette isn't supported, just let any value
4204 * through here. The error will be generated later.
4206 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4212 /* Line 1455 of yacc.c */
4213 #line 1709 "program_parse.y"
4215 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
4216 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
4220 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4226 /* Line 1455 of yacc.c */
4227 #line 1720 "program_parse.y"
4229 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4230 (yyval
.state
)[0] = STATE_DEPTH_RANGE
;
4236 /* Line 1455 of yacc.c */
4237 #line 1732 "program_parse.y"
4239 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4240 (yyval
.state
)[0] = state
->state_param_enum
;
4241 (yyval
.state
)[1] = STATE_ENV
;
4242 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4243 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4249 /* Line 1455 of yacc.c */
4250 #line 1742 "program_parse.y"
4252 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4253 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4259 /* Line 1455 of yacc.c */
4260 #line 1747 "program_parse.y"
4262 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4263 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4269 /* Line 1455 of yacc.c */
4270 #line 1754 "program_parse.y"
4272 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4273 (yyval
.state
)[0] = state
->state_param_enum
;
4274 (yyval
.state
)[1] = STATE_ENV
;
4275 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4276 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4282 /* Line 1455 of yacc.c */
4283 #line 1764 "program_parse.y"
4285 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4286 (yyval
.state
)[0] = state
->state_param_enum
;
4287 (yyval
.state
)[1] = STATE_LOCAL
;
4288 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4289 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4295 /* Line 1455 of yacc.c */
4296 #line 1773 "program_parse.y"
4298 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4299 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4305 /* Line 1455 of yacc.c */
4306 #line 1778 "program_parse.y"
4308 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4309 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4315 /* Line 1455 of yacc.c */
4316 #line 1785 "program_parse.y"
4318 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4319 (yyval
.state
)[0] = state
->state_param_enum
;
4320 (yyval
.state
)[1] = STATE_LOCAL
;
4321 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4322 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4328 /* Line 1455 of yacc.c */
4329 #line 1795 "program_parse.y"
4331 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
4332 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
4335 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4341 /* Line 1455 of yacc.c */
4342 #line 1805 "program_parse.y"
4344 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
4345 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
4348 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4354 /* Line 1455 of yacc.c */
4355 #line 1820 "program_parse.y"
4357 (yyval
.vector
).count
= 4;
4358 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4359 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4360 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4361 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4367 /* Line 1455 of yacc.c */
4368 #line 1830 "program_parse.y"
4370 (yyval
.vector
).count
= 1;
4371 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4372 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4373 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4374 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4380 /* Line 1455 of yacc.c */
4381 #line 1838 "program_parse.y"
4383 (yyval
.vector
).count
= 1;
4384 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
4385 (yyval
.vector
).data
[1] = (float) (yyvsp
[(1) - (1)].integer
);
4386 (yyval
.vector
).data
[2] = (float) (yyvsp
[(1) - (1)].integer
);
4387 (yyval
.vector
).data
[3] = (float) (yyvsp
[(1) - (1)].integer
);
4393 /* Line 1455 of yacc.c */
4394 #line 1848 "program_parse.y"
4396 (yyval
.vector
).count
= 4;
4397 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
4398 (yyval
.vector
).data
[1] = 0.0f
;
4399 (yyval
.vector
).data
[2] = 0.0f
;
4400 (yyval
.vector
).data
[3] = 1.0f
;
4406 /* Line 1455 of yacc.c */
4407 #line 1856 "program_parse.y"
4409 (yyval
.vector
).count
= 4;
4410 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
4411 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
4412 (yyval
.vector
).data
[2] = 0.0f
;
4413 (yyval
.vector
).data
[3] = 1.0f
;
4419 /* Line 1455 of yacc.c */
4420 #line 1865 "program_parse.y"
4422 (yyval
.vector
).count
= 4;
4423 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
4424 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
4425 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
4426 (yyval
.vector
).data
[3] = 1.0f
;
4432 /* Line 1455 of yacc.c */
4433 #line 1874 "program_parse.y"
4435 (yyval
.vector
).count
= 4;
4436 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
4437 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
4438 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
4439 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
4445 /* Line 1455 of yacc.c */
4446 #line 1884 "program_parse.y"
4448 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
4454 /* Line 1455 of yacc.c */
4455 #line 1888 "program_parse.y"
4457 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
4463 /* Line 1455 of yacc.c */
4464 #line 1893 "program_parse.y"
4465 { (yyval
.negate
) = FALSE
; ;}
4470 /* Line 1455 of yacc.c */
4471 #line 1894 "program_parse.y"
4472 { (yyval
.negate
) = TRUE
; ;}
4477 /* Line 1455 of yacc.c */
4478 #line 1895 "program_parse.y"
4479 { (yyval
.negate
) = FALSE
; ;}
4484 /* Line 1455 of yacc.c */
4485 #line 1898 "program_parse.y"
4486 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
4491 /* Line 1455 of yacc.c */
4492 #line 1902 "program_parse.y"
4494 /* NV_fragment_program_option defines the size qualifiers in a
4495 * fairly broken way. "SHORT" or "LONG" can optionally be used
4496 * before TEMP or OUTPUT. However, neither is a reserved word!
4497 * This means that we have to parse it as an identifier, then check
4498 * to make sure it's one of the valid values. *sigh*
4500 * In addition, the grammar in the extension spec does *not* allow
4501 * the size specifier to be optional, but all known implementations
4504 if (!state
->option
.NV_fragment
) {
4505 yyerror(& (yylsp
[(1) - (1)]), state
, "unexpected IDENTIFIER");
4509 if (strcmp("SHORT", (yyvsp
[(1) - (1)].string
)) == 0) {
4510 } else if (strcmp("LONG", (yyvsp
[(1) - (1)].string
)) == 0) {
4512 char *const err_str
=
4513 make_error_string("invalid storage size specifier \"%s\"",
4514 (yyvsp
[(1) - (1)].string
));
4516 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
4517 ? err_str
: "invalid storage size specifier");
4519 if (err_str
!= NULL
) {
4520 _mesa_free(err_str
);
4530 /* Line 1455 of yacc.c */
4531 #line 1936 "program_parse.y"
4538 /* Line 1455 of yacc.c */
4539 #line 1940 "program_parse.y"
4540 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4545 /* Line 1455 of yacc.c */
4546 #line 1944 "program_parse.y"
4548 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4556 /* Line 1455 of yacc.c */
4557 #line 1950 "program_parse.y"
4559 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4567 /* Line 1455 of yacc.c */
4568 #line 1958 "program_parse.y"
4570 struct asm_symbol
*const s
=
4571 declare_variable(state
, (yyvsp
[(3) - (5)].string
), at_output
, & (yylsp
[(3) - (5)]));
4576 s
->output_binding
= (yyvsp
[(5) - (5)].result
);
4583 /* Line 1455 of yacc.c */
4584 #line 1971 "program_parse.y"
4586 if (state
->mode
== ARB_vertex
) {
4587 (yyval
.result
) = VERT_RESULT_HPOS
;
4589 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4597 /* Line 1455 of yacc.c */
4598 #line 1980 "program_parse.y"
4600 if (state
->mode
== ARB_vertex
) {
4601 (yyval
.result
) = VERT_RESULT_FOGC
;
4603 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4611 /* Line 1455 of yacc.c */
4612 #line 1989 "program_parse.y"
4614 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4620 /* Line 1455 of yacc.c */
4621 #line 1993 "program_parse.y"
4623 if (state
->mode
== ARB_vertex
) {
4624 (yyval
.result
) = VERT_RESULT_PSIZ
;
4626 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4634 /* Line 1455 of yacc.c */
4635 #line 2002 "program_parse.y"
4637 if (state
->mode
== ARB_vertex
) {
4638 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4640 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4648 /* Line 1455 of yacc.c */
4649 #line 2011 "program_parse.y"
4651 if (state
->mode
== ARB_fragment
) {
4652 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4654 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4662 /* Line 1455 of yacc.c */
4663 #line 2022 "program_parse.y"
4665 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4671 /* Line 1455 of yacc.c */
4672 #line 2028 "program_parse.y"
4674 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4676 : FRAG_RESULT_COLOR
;
4682 /* Line 1455 of yacc.c */
4683 #line 2034 "program_parse.y"
4685 if (state
->mode
== ARB_vertex
) {
4686 (yyval
.integer
) = VERT_RESULT_COL0
;
4688 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4696 /* Line 1455 of yacc.c */
4697 #line 2043 "program_parse.y"
4699 if (state
->mode
== ARB_vertex
) {
4700 (yyval
.integer
) = VERT_RESULT_BFC0
;
4702 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4710 /* Line 1455 of yacc.c */
4711 #line 2054 "program_parse.y"
4713 (yyval
.integer
) = 0;
4719 /* Line 1455 of yacc.c */
4720 #line 2058 "program_parse.y"
4722 if (state
->mode
== ARB_vertex
) {
4723 (yyval
.integer
) = 0;
4725 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4733 /* Line 1455 of yacc.c */
4734 #line 2067 "program_parse.y"
4736 if (state
->mode
== ARB_vertex
) {
4737 (yyval
.integer
) = 1;
4739 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4747 /* Line 1455 of yacc.c */
4748 #line 2077 "program_parse.y"
4749 { (yyval
.integer
) = 0; ;}
4754 /* Line 1455 of yacc.c */
4755 #line 2078 "program_parse.y"
4756 { (yyval
.integer
) = 0; ;}
4761 /* Line 1455 of yacc.c */
4762 #line 2079 "program_parse.y"
4763 { (yyval
.integer
) = 1; ;}
4768 /* Line 1455 of yacc.c */
4769 #line 2082 "program_parse.y"
4770 { (yyval
.integer
) = 0; ;}
4775 /* Line 1455 of yacc.c */
4776 #line 2083 "program_parse.y"
4777 { (yyval
.integer
) = 0; ;}
4782 /* Line 1455 of yacc.c */
4783 #line 2084 "program_parse.y"
4784 { (yyval
.integer
) = 1; ;}
4789 /* Line 1455 of yacc.c */
4790 #line 2087 "program_parse.y"
4791 { (yyval
.integer
) = 0; ;}
4796 /* Line 1455 of yacc.c */
4797 #line 2088 "program_parse.y"
4798 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4803 /* Line 1455 of yacc.c */
4804 #line 2091 "program_parse.y"
4805 { (yyval
.integer
) = 0; ;}
4810 /* Line 1455 of yacc.c */
4811 #line 2092 "program_parse.y"
4812 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4817 /* Line 1455 of yacc.c */
4818 #line 2095 "program_parse.y"
4819 { (yyval
.integer
) = 0; ;}
4824 /* Line 1455 of yacc.c */
4825 #line 2096 "program_parse.y"
4826 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4831 /* Line 1455 of yacc.c */
4832 #line 2100 "program_parse.y"
4834 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4835 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4839 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4845 /* Line 1455 of yacc.c */
4846 #line 2111 "program_parse.y"
4848 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4849 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4853 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4859 /* Line 1455 of yacc.c */
4860 #line 2122 "program_parse.y"
4862 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4863 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4867 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4873 /* Line 1455 of yacc.c */
4874 #line 2133 "program_parse.y"
4876 struct asm_symbol
*exist
= (struct asm_symbol
*)
4877 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4878 struct asm_symbol
*target
= (struct asm_symbol
*)
4879 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4881 if (exist
!= NULL
) {
4883 _mesa_snprintf(m
, sizeof(m
), "redeclared identifier: %s", (yyvsp
[(2) - (4)].string
));
4884 yyerror(& (yylsp
[(2) - (4)]), state
, m
);
4886 } else if (target
== NULL
) {
4887 yyerror(& (yylsp
[(4) - (4)]), state
,
4888 "undefined variable binding in ALIAS statement");
4891 _mesa_symbol_table_add_symbol(state
->st
, 0, strdup((yyvsp
[(2) - (4)].string
)), target
);
4898 /* Line 1455 of yacc.c */
4899 #line 4900 "program_parse.tab.c"
4902 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4906 YY_STACK_PRINT (yyss
, yyssp
);
4911 /* Now `shift' the result of the reduction. Determine what state
4912 that goes to, based on the state we popped back to and the rule
4913 number reduced by. */
4917 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4918 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4919 yystate
= yytable
[yystate
];
4921 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4926 /*------------------------------------.
4927 | yyerrlab -- here on detecting error |
4928 `------------------------------------*/
4930 /* If not already recovering from an error, report this error. */
4934 #if ! YYERROR_VERBOSE
4935 yyerror (&yylloc
, state
, YY_("syntax error"));
4938 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4939 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4941 YYSIZE_T yyalloc
= 2 * yysize
;
4942 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4943 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4944 if (yymsg
!= yymsgbuf
)
4945 YYSTACK_FREE (yymsg
);
4946 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4948 yymsg_alloc
= yyalloc
;
4952 yymsg_alloc
= sizeof yymsgbuf
;
4956 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4958 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4959 yyerror (&yylloc
, state
, yymsg
);
4963 yyerror (&yylloc
, state
, YY_("syntax error"));
4965 goto yyexhaustedlab
;
4971 yyerror_range
[0] = yylloc
;
4973 if (yyerrstatus
== 3)
4975 /* If just tried and failed to reuse lookahead token after an
4976 error, discard it. */
4978 if (yychar
<= YYEOF
)
4980 /* Return failure if at end of input. */
4981 if (yychar
== YYEOF
)
4986 yydestruct ("Error: discarding",
4987 yytoken
, &yylval
, &yylloc
, state
);
4992 /* Else will try to reuse lookahead token after shifting the error
4997 /*---------------------------------------------------.
4998 | yyerrorlab -- error raised explicitly by YYERROR. |
4999 `---------------------------------------------------*/
5002 /* Pacify compilers like GCC when the user code never invokes
5003 YYERROR and the label yyerrorlab therefore never appears in user
5005 if (/*CONSTCOND*/ 0)
5008 yyerror_range
[0] = yylsp
[1-yylen
];
5009 /* Do not reclaim the symbols of the rule which action triggered
5013 YY_STACK_PRINT (yyss
, yyssp
);
5018 /*-------------------------------------------------------------.
5019 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5020 `-------------------------------------------------------------*/
5022 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5026 yyn
= yypact
[yystate
];
5027 if (yyn
!= YYPACT_NINF
)
5030 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5038 /* Pop the current state because it cannot handle the error token. */
5042 yyerror_range
[0] = *yylsp
;
5043 yydestruct ("Error: popping",
5044 yystos
[yystate
], yyvsp
, yylsp
, state
);
5047 YY_STACK_PRINT (yyss
, yyssp
);
5052 yyerror_range
[1] = yylloc
;
5053 /* Using YYLLOC is tempting, but would change the location of
5054 the lookahead. YYLOC is available though. */
5055 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
5058 /* Shift the error token. */
5059 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5065 /*-------------------------------------.
5066 | yyacceptlab -- YYACCEPT comes here. |
5067 `-------------------------------------*/
5072 /*-----------------------------------.
5073 | yyabortlab -- YYABORT comes here. |
5074 `-----------------------------------*/
5079 #if !defined(yyoverflow) || YYERROR_VERBOSE
5080 /*-------------------------------------------------.
5081 | yyexhaustedlab -- memory exhaustion comes here. |
5082 `-------------------------------------------------*/
5084 yyerror (&yylloc
, state
, YY_("memory exhausted"));
5090 if (yychar
!= YYEMPTY
)
5091 yydestruct ("Cleanup: discarding lookahead",
5092 yytoken
, &yylval
, &yylloc
, state
);
5093 /* Do not reclaim the symbols of the rule which action triggered
5094 this YYABORT or YYACCEPT. */
5096 YY_STACK_PRINT (yyss
, yyssp
);
5097 while (yyssp
!= yyss
)
5099 yydestruct ("Cleanup: popping",
5100 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
5105 YYSTACK_FREE (yyss
);
5108 if (yymsg
!= yymsgbuf
)
5109 YYSTACK_FREE (yymsg
);
5111 /* Make sure YYID is used. */
5112 return YYID (yyresult
);
5117 /* Line 1675 of yacc.c */
5118 #line 2158 "program_parse.y"
5122 asm_instruction_set_operands(struct asm_instruction
*inst
,
5123 const struct prog_dst_register
*dst
,
5124 const struct asm_src_register
*src0
,
5125 const struct asm_src_register
*src1
,
5126 const struct asm_src_register
*src2
)
5128 /* In the core ARB extensions only the KIL instruction doesn't have a
5129 * destination register.
5132 init_dst_reg(& inst
->Base
.DstReg
);
5134 inst
->Base
.DstReg
= *dst
;
5137 /* The only instruction that doesn't have any source registers is the
5138 * condition-code based KIL instruction added by NV_fragment_program_option.
5141 inst
->Base
.SrcReg
[0] = src0
->Base
;
5142 inst
->SrcReg
[0] = *src0
;
5144 init_src_reg(& inst
->SrcReg
[0]);
5148 inst
->Base
.SrcReg
[1] = src1
->Base
;
5149 inst
->SrcReg
[1] = *src1
;
5151 init_src_reg(& inst
->SrcReg
[1]);
5155 inst
->Base
.SrcReg
[2] = src2
->Base
;
5156 inst
->SrcReg
[2] = *src2
;
5158 init_src_reg(& inst
->SrcReg
[2]);
5163 struct asm_instruction
*
5164 asm_instruction_ctor(gl_inst_opcode op
,
5165 const struct prog_dst_register
*dst
,
5166 const struct asm_src_register
*src0
,
5167 const struct asm_src_register
*src1
,
5168 const struct asm_src_register
*src2
)
5170 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5173 _mesa_init_instructions(& inst
->Base
, 1);
5174 inst
->Base
.Opcode
= op
;
5176 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5183 struct asm_instruction
*
5184 asm_instruction_copy_ctor(const struct prog_instruction
*base
,
5185 const struct prog_dst_register
*dst
,
5186 const struct asm_src_register
*src0
,
5187 const struct asm_src_register
*src1
,
5188 const struct asm_src_register
*src2
)
5190 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5193 _mesa_init_instructions(& inst
->Base
, 1);
5194 inst
->Base
.Opcode
= base
->Opcode
;
5195 inst
->Base
.CondUpdate
= base
->CondUpdate
;
5196 inst
->Base
.CondDst
= base
->CondDst
;
5197 inst
->Base
.SaturateMode
= base
->SaturateMode
;
5198 inst
->Base
.Precision
= base
->Precision
;
5200 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5208 init_dst_reg(struct prog_dst_register
*r
)
5210 memset(r
, 0, sizeof(*r
));
5211 r
->File
= PROGRAM_UNDEFINED
;
5212 r
->WriteMask
= WRITEMASK_XYZW
;
5213 r
->CondMask
= COND_TR
;
5214 r
->CondSwizzle
= SWIZZLE_NOOP
;
5218 /** Like init_dst_reg() but set the File and Index fields. */
5220 set_dst_reg(struct prog_dst_register
*r
, gl_register_file file
, GLint index
)
5222 const GLint maxIndex
= 1 << INST_INDEX_BITS
;
5223 const GLint minIndex
= 0;
5224 ASSERT(index
>= minIndex
);
5225 ASSERT(index
<= maxIndex
);
5226 ASSERT(file
== PROGRAM_TEMPORARY
||
5227 file
== PROGRAM_ADDRESS
||
5228 file
== PROGRAM_OUTPUT
);
5229 memset(r
, 0, sizeof(*r
));
5232 r
->WriteMask
= WRITEMASK_XYZW
;
5233 r
->CondMask
= COND_TR
;
5234 r
->CondSwizzle
= SWIZZLE_NOOP
;
5239 init_src_reg(struct asm_src_register
*r
)
5241 memset(r
, 0, sizeof(*r
));
5242 r
->Base
.File
= PROGRAM_UNDEFINED
;
5243 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5248 /** Like init_src_reg() but set the File and Index fields. */
5250 set_src_reg(struct asm_src_register
*r
, gl_register_file file
, GLint index
)
5252 const GLint maxIndex
= (1 << INST_INDEX_BITS
) - 1;
5253 const GLint minIndex
= -(1 << INST_INDEX_BITS
);
5254 ASSERT(index
>= minIndex
);
5255 ASSERT(index
<= maxIndex
);
5256 ASSERT(file
< PROGRAM_FILE_MAX
);
5257 memset(r
, 0, sizeof(*r
));
5258 r
->Base
.File
= file
;
5259 r
->Base
.Index
= index
;
5260 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5266 * Validate the set of inputs used by a program
5268 * Validates that legal sets of inputs are used by the program. In this case
5269 * "used" included both reading the input or binding the input to a name using
5270 * the \c ATTRIB command.
5273 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
5276 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
5278 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
5280 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
5281 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
5290 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
5291 struct YYLTYPE
*locp
)
5293 struct asm_symbol
*s
= NULL
;
5294 struct asm_symbol
*exist
= (struct asm_symbol
*)
5295 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
5298 if (exist
!= NULL
) {
5299 yyerror(locp
, state
, "redeclared identifier");
5301 const size_t name_len
= strlen(name
);
5303 s
= calloc(1, sizeof(struct asm_symbol
) + name_len
+ 1);
5304 s
->name
= (char *)(s
+ 1);
5307 memcpy((char *) s
->name
, name
, name_len
+ 1);
5311 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
5312 yyerror(locp
, state
, "too many temporaries declared");
5317 s
->temp_binding
= state
->prog
->NumTemporaries
;
5318 state
->prog
->NumTemporaries
++;
5322 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
5323 yyerror(locp
, state
, "too many address registers declared");
5328 /* FINISHME: Add support for multiple address registers.
5330 state
->prog
->NumAddressRegs
++;
5337 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
5338 s
->next
= state
->sym
;
5346 int add_state_reference(struct gl_program_parameter_list
*param_list
,
5347 const gl_state_index tokens
[STATE_LENGTH
])
5349 const GLuint size
= 4; /* XXX fix */
5353 name
= _mesa_program_state_string(tokens
);
5354 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
5355 size
, GL_NONE
, NULL
, tokens
, 0x0);
5356 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
5358 /* free name string here since we duplicated it in add_parameter() */
5366 initialize_symbol_from_state(struct gl_program
*prog
,
5367 struct asm_symbol
*param_var
,
5368 const gl_state_index tokens
[STATE_LENGTH
])
5371 gl_state_index state_tokens
[STATE_LENGTH
];
5374 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5376 param_var
->type
= at_param
;
5377 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
5379 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
5380 * unroll it and call add_state_reference() for each row
5382 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
5383 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
5384 state_tokens
[0] == STATE_MVP_MATRIX
||
5385 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
5386 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
5387 && (state_tokens
[2] != state_tokens
[3])) {
5389 const int first_row
= state_tokens
[2];
5390 const int last_row
= state_tokens
[3];
5392 for (row
= first_row
; row
<= last_row
; row
++) {
5393 state_tokens
[2] = state_tokens
[3] = row
;
5395 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5396 if (param_var
->param_binding_begin
== ~0U)
5397 param_var
->param_binding_begin
= idx
;
5398 param_var
->param_binding_length
++;
5402 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5403 if (param_var
->param_binding_begin
== ~0U)
5404 param_var
->param_binding_begin
= idx
;
5405 param_var
->param_binding_length
++;
5413 initialize_symbol_from_param(struct gl_program
*prog
,
5414 struct asm_symbol
*param_var
,
5415 const gl_state_index tokens
[STATE_LENGTH
])
5418 gl_state_index state_tokens
[STATE_LENGTH
];
5421 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5423 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
5424 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
5425 assert((state_tokens
[1] == STATE_ENV
)
5426 || (state_tokens
[1] == STATE_LOCAL
));
5428 param_var
->type
= at_param
;
5429 param_var
->param_binding_type
= (state_tokens
[1] == STATE_ENV
)
5430 ? PROGRAM_ENV_PARAM
: PROGRAM_LOCAL_PARAM
;
5432 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5433 * we need to unroll it and call add_state_reference() for each row
5435 if (state_tokens
[2] != state_tokens
[3]) {
5437 const int first_row
= state_tokens
[2];
5438 const int last_row
= state_tokens
[3];
5440 for (row
= first_row
; row
<= last_row
; row
++) {
5441 state_tokens
[2] = state_tokens
[3] = row
;
5443 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5444 if (param_var
->param_binding_begin
== ~0U)
5445 param_var
->param_binding_begin
= idx
;
5446 param_var
->param_binding_length
++;
5450 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5451 if (param_var
->param_binding_begin
== ~0U)
5452 param_var
->param_binding_begin
= idx
;
5453 param_var
->param_binding_length
++;
5461 initialize_symbol_from_const(struct gl_program
*prog
,
5462 struct asm_symbol
*param_var
,
5463 const struct asm_vector
*vec
)
5465 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
5466 NULL
, vec
->count
, GL_NONE
, vec
->data
,
5469 param_var
->type
= at_param
;
5470 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
5472 if (param_var
->param_binding_begin
== ~0U)
5473 param_var
->param_binding_begin
= idx
;
5474 param_var
->param_binding_length
++;
5481 make_error_string(const char *fmt
, ...)
5487 va_start(args
, fmt
);
5489 /* Call vsnprintf once to determine how large the final string is. Call it
5490 * again to do the actual formatting. from the vsnprintf manual page:
5492 * Upon successful return, these functions return the number of
5493 * characters printed (not including the trailing '\0' used to end
5494 * output to strings).
5496 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
5498 str
= _mesa_malloc(length
);
5500 vsnprintf(str
, length
, fmt
, args
);
5510 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
5515 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
5517 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
5518 _mesa_free(err_str
);
5521 err_str
= make_error_string("line %u, char %u: error: %s\n",
5522 locp
->first_line
, locp
->first_column
, s
);
5523 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
5526 _mesa_free(err_str
);
5532 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
5533 GLsizei len
, struct asm_parser_state
*state
)
5535 struct asm_instruction
*inst
;
5538 GLboolean result
= GL_FALSE
;
5540 struct asm_symbol
*sym
;
5543 state
->prog
->Target
= target
;
5544 state
->prog
->Parameters
= _mesa_new_parameter_list();
5546 /* Make a copy of the program string and force it to be NUL-terminated.
5548 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
5550 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5553 _mesa_memcpy (strz
, str
, len
);
5556 if (state
->prog
->String
!= NULL
) {
5557 _mesa_free(state
->prog
->String
);
5558 state
->prog
->String
= NULL
;
5561 state
->prog
->String
= strz
;
5563 state
->st
= _mesa_symbol_table_ctor();
5565 state
->limits
= (target
== GL_VERTEX_PROGRAM_ARB
)
5566 ? & ctx
->Const
.VertexProgram
5567 : & ctx
->Const
.FragmentProgram
;
5569 state
->MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
5570 state
->MaxTextureCoordUnits
= ctx
->Const
.MaxTextureCoordUnits
;
5571 state
->MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
5572 state
->MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
5573 state
->MaxLights
= ctx
->Const
.MaxLights
;
5574 state
->MaxProgramMatrices
= ctx
->Const
.MaxProgramMatrices
;
5576 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
5577 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
5579 _mesa_set_program_error(ctx
, -1, NULL
);
5581 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
5583 _mesa_program_lexer_dtor(state
->scanner
);
5586 if (ctx
->Program
.ErrorPos
!= -1) {
5590 if (! _mesa_layout_parameters(state
)) {
5594 loc
.first_column
= 0;
5597 yyerror(& loc
, state
, "invalid PARAM usage");
5603 /* Add one instruction to store the "END" instruction.
5605 state
->prog
->Instructions
=
5606 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5607 inst
= state
->inst_head
;
5608 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5609 struct asm_instruction
*const temp
= inst
->next
;
5611 state
->prog
->Instructions
[i
] = inst
->Base
;
5615 /* Finally, tag on an OPCODE_END instruction */
5617 const GLuint numInst
= state
->prog
->NumInstructions
;
5618 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5619 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5621 state
->prog
->NumInstructions
++;
5623 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5624 state
->prog
->NumAttributes
= _mesa_bitcount(state
->prog
->InputsRead
);
5627 * Initialize native counts to logical counts. The device driver may
5628 * change them if program is translated into a hardware program.
5630 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5631 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5632 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5633 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5634 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5639 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5644 state
->inst_head
= NULL
;
5645 state
->inst_tail
= NULL
;
5647 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5654 _mesa_symbol_table_dtor(state
->st
);
5657 if (state
->string_dumpster
!= NULL
) {
5658 _mesa_free(state
->string_dumpster
);
5659 state
->dumpster_size
= 0;