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 init_src_reg(struct asm_src_register
*r
);
142 static void asm_instruction_set_operands(struct asm_instruction
*inst
,
143 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
144 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
146 static struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
147 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
148 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
150 static struct asm_instruction
*asm_instruction_copy_ctor(
151 const struct prog_instruction
*base
, const struct prog_dst_register
*dst
,
152 const struct asm_src_register
*src0
, const struct asm_src_register
*src1
,
153 const struct asm_src_register
*src2
);
157 #define TRUE (!FALSE)
160 #define YYLLOC_DEFAULT(Current, Rhs, N) \
163 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
164 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
165 (Current).position = YYRHSLOC(Rhs, 1).position; \
166 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
167 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
169 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
170 (Current).last_line = (Current).first_line; \
171 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
172 (Current).last_column = (Current).first_column; \
173 (Current).position = YYRHSLOC(Rhs, 0).position \
174 + (Current).first_column; \
178 #define YYLEX_PARAM state->scanner
181 /* Line 189 of yacc.c */
182 #line 183 "program_parse.tab.c"
184 /* Enabling traces. */
189 /* Enabling verbose error messages. */
190 #ifdef YYERROR_VERBOSE
191 # undef YYERROR_VERBOSE
192 # define YYERROR_VERBOSE 1
194 # define YYERROR_VERBOSE 1
197 /* Enabling the token table. */
198 #ifndef YYTOKEN_TABLE
199 # define YYTOKEN_TABLE 0
206 /* Put the tokens into the symbol table, so that GDB and other debuggers
297 TEX_SHADOWRECT
= 346,
300 TEX_ARRAYSHADOW1D
= 349,
301 TEX_ARRAYSHADOW2D
= 350,
306 USED_IDENTIFIER
= 355,
319 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
320 typedef union YYSTYPE
323 /* Line 214 of yacc.c */
324 #line 116 "program_parse.y"
326 struct asm_instruction
*inst
;
327 struct asm_symbol
*sym
;
328 struct asm_symbol temp_sym
;
329 struct asm_swizzle_mask swiz_mask
;
330 struct asm_src_register src_reg
;
331 struct prog_dst_register dst_reg
;
332 struct prog_instruction temp_inst
;
338 gl_state_index state
[STATE_LENGTH
];
340 struct asm_vector vector
;
341 gl_inst_opcode opcode
;
345 unsigned rgba_valid
:1;
346 unsigned xyzw_valid
:1;
352 /* Line 214 of yacc.c */
353 #line 354 "program_parse.tab.c"
355 # define YYSTYPE_IS_TRIVIAL 1
356 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
357 # define YYSTYPE_IS_DECLARED 1
360 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
361 typedef struct YYLTYPE
368 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
369 # define YYLTYPE_IS_DECLARED 1
370 # define YYLTYPE_IS_TRIVIAL 1
374 /* Copy the second part of user declarations. */
376 /* Line 264 of yacc.c */
377 #line 261 "program_parse.y"
379 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
383 /* Line 264 of yacc.c */
384 #line 385 "program_parse.tab.c"
391 typedef YYTYPE_UINT8 yytype_uint8
;
393 typedef unsigned char yytype_uint8
;
397 typedef YYTYPE_INT8 yytype_int8
;
398 #elif (defined __STDC__ || defined __C99__FUNC__ \
399 || defined __cplusplus || defined _MSC_VER)
400 typedef signed char yytype_int8
;
402 typedef short int yytype_int8
;
406 typedef YYTYPE_UINT16 yytype_uint16
;
408 typedef unsigned short int yytype_uint16
;
412 typedef YYTYPE_INT16 yytype_int16
;
414 typedef short int yytype_int16
;
418 # ifdef __SIZE_TYPE__
419 # define YYSIZE_T __SIZE_TYPE__
420 # elif defined size_t
421 # define YYSIZE_T size_t
422 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
423 || defined __cplusplus || defined _MSC_VER)
424 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
425 # define YYSIZE_T size_t
427 # define YYSIZE_T unsigned int
431 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
436 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
437 # define YY_(msgid) dgettext ("bison-runtime", msgid)
441 # define YY_(msgid) msgid
445 /* Suppress unused-variable warnings by "using" E. */
446 #if ! defined lint || defined __GNUC__
447 # define YYUSE(e) ((void) (e))
449 # define YYUSE(e) /* empty */
452 /* Identity function, used to suppress warnings about constant conditions. */
456 #if (defined __STDC__ || defined __C99__FUNC__ \
457 || defined __cplusplus || defined _MSC_VER)
470 #if ! defined yyoverflow || YYERROR_VERBOSE
472 /* The parser invokes alloca or malloc; define the necessary symbols. */
474 # ifdef YYSTACK_USE_ALLOCA
475 # if YYSTACK_USE_ALLOCA
477 # define YYSTACK_ALLOC __builtin_alloca
478 # elif defined __BUILTIN_VA_ARG_INCR
479 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
481 # define YYSTACK_ALLOC __alloca
482 # elif defined _MSC_VER
483 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
484 # define alloca _alloca
486 # define YYSTACK_ALLOC alloca
487 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
488 || defined __cplusplus || defined _MSC_VER)
489 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
498 # ifdef YYSTACK_ALLOC
499 /* Pacify GCC's `empty if-body' warning. */
500 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
501 # ifndef YYSTACK_ALLOC_MAXIMUM
502 /* The OS might guarantee only one guard page at the bottom of the stack,
503 and a page size can be as small as 4096 bytes. So we cannot safely
504 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
505 to allow for a few compiler-allocated temporary stack slots. */
506 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
509 # define YYSTACK_ALLOC YYMALLOC
510 # define YYSTACK_FREE YYFREE
511 # ifndef YYSTACK_ALLOC_MAXIMUM
512 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
514 # if (defined __cplusplus && ! defined _STDLIB_H \
515 && ! ((defined YYMALLOC || defined malloc) \
516 && (defined YYFREE || defined free)))
517 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
523 # define YYMALLOC malloc
524 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
525 || defined __cplusplus || defined _MSC_VER)
526 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
531 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
532 || defined __cplusplus || defined _MSC_VER)
533 void free (void *); /* INFRINGES ON USER NAME SPACE */
537 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
540 #if (! defined yyoverflow \
541 && (! defined __cplusplus \
542 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
543 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
545 /* A type that is properly aligned for any stack member. */
548 yytype_int16 yyss_alloc
;
553 /* The size of the maximum gap between one aligned stack and the next. */
554 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
556 /* The size of an array large to enough to hold all stacks, each with
558 # define YYSTACK_BYTES(N) \
559 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
560 + 2 * YYSTACK_GAP_MAXIMUM)
562 /* Copy COUNT objects from FROM to TO. The source and destination do
565 # if defined __GNUC__ && 1 < __GNUC__
566 # define YYCOPY(To, From, Count) \
567 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
569 # define YYCOPY(To, From, Count) \
573 for (yyi = 0; yyi < (Count); yyi++) \
574 (To)[yyi] = (From)[yyi]; \
580 /* Relocate STACK from its old location to the new one. The
581 local variables YYSIZE and YYSTACKSIZE give the old and new number of
582 elements in the stack, and YYPTR gives the new location of the
583 stack. Advance YYPTR to a properly aligned location for the next
585 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
588 YYSIZE_T yynewbytes; \
589 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
590 Stack = &yyptr->Stack_alloc; \
591 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
592 yyptr += yynewbytes / sizeof (*yyptr); \
598 /* YYFINAL -- State number of the termination state. */
600 /* YYLAST -- Last index in YYTABLE. */
603 /* YYNTOKENS -- Number of terminals. */
604 #define YYNTOKENS 120
605 /* YYNNTS -- Number of nonterminals. */
607 /* YYNRULES -- Number of rules. */
609 /* YYNRULES -- Number of states. */
610 #define YYNSTATES 475
612 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
614 #define YYMAXUTOK 362
616 #define YYTRANSLATE(YYX) \
617 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
619 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
620 static const yytype_uint8 yytranslate
[] =
622 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 115, 116, 2, 113, 109, 114, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 108,
628 2, 117, 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, 111, 2, 112, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 118, 110, 119, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 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, 1, 2, 3, 4,
648 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
649 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
650 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
651 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
652 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
653 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
654 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
655 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
656 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
657 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
662 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
664 static const yytype_uint16 yyprhs
[] =
666 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
667 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
668 46, 48, 50, 52, 54, 59, 64, 69, 76, 83,
669 92, 101, 104, 107, 120, 123, 125, 127, 129, 131,
670 133, 135, 137, 139, 141, 143, 145, 147, 154, 157,
671 162, 165, 167, 171, 177, 181, 184, 192, 195, 197,
672 199, 201, 203, 208, 210, 212, 214, 216, 218, 220,
673 222, 226, 227, 230, 233, 235, 237, 239, 241, 243,
674 245, 247, 249, 251, 252, 254, 256, 258, 260, 261,
675 265, 269, 270, 273, 276, 278, 280, 282, 284, 286,
676 288, 290, 292, 297, 300, 303, 305, 308, 310, 313,
677 315, 318, 323, 328, 330, 331, 335, 337, 339, 342,
678 344, 347, 349, 351, 355, 362, 363, 365, 368, 373,
679 375, 379, 381, 383, 385, 387, 389, 391, 393, 395,
680 397, 399, 402, 405, 408, 411, 414, 417, 420, 423,
681 426, 429, 432, 435, 439, 441, 443, 445, 451, 453,
682 455, 457, 460, 462, 464, 467, 469, 472, 479, 481,
683 485, 487, 489, 491, 493, 495, 500, 502, 504, 506,
684 508, 510, 512, 515, 517, 519, 525, 527, 530, 532,
685 534, 540, 543, 544, 551, 555, 556, 558, 560, 562,
686 564, 566, 569, 571, 573, 576, 581, 586, 587, 591,
687 593, 595, 597, 600, 602, 604, 606, 608, 614, 616,
688 620, 626, 632, 634, 638, 644, 646, 648, 650, 652,
689 654, 656, 658, 660, 662, 666, 672, 680, 690, 693,
690 696, 698, 700, 701, 702, 707, 709, 710, 711, 715,
691 719, 721, 727, 730, 733, 736, 739, 743, 746, 750,
692 751, 753, 755, 756, 758, 760, 761, 763, 765, 766,
693 768, 770, 771, 775, 776, 780, 781, 785, 787, 789,
697 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
698 static const yytype_int16 yyrhs
[] =
700 121, 0, -1, 122, 123, 125, 12, -1, 3, -1,
701 4, -1, 123, 124, -1, -1, 8, 262, 108, -1,
702 125, 126, -1, -1, 127, 108, -1, 170, 108, -1,
703 128, -1, 129, -1, 130, -1, 131, -1, 132, -1,
704 133, -1, 134, -1, 135, -1, 141, -1, 136, -1,
705 137, -1, 138, -1, 19, 146, 109, 142, -1, 18,
706 145, 109, 144, -1, 16, 145, 109, 142, -1, 14,
707 145, 109, 142, 109, 142, -1, 13, 145, 109, 144,
708 109, 144, -1, 17, 145, 109, 144, 109, 144, 109,
709 144, -1, 15, 145, 109, 144, 109, 139, 109, 140,
710 -1, 20, 144, -1, 20, 166, -1, 22, 145, 109,
711 144, 109, 144, 109, 144, 109, 139, 109, 140, -1,
712 83, 256, -1, 84, -1, 85, -1, 86, -1, 87,
713 -1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
714 -1, 93, -1, 94, -1, 95, -1, 21, 145, 109,
715 150, 109, 147, -1, 241, 143, -1, 241, 110, 143,
716 110, -1, 150, 162, -1, 238, -1, 241, 150, 163,
717 -1, 241, 110, 150, 163, 110, -1, 151, 164, 165,
718 -1, 159, 161, -1, 148, 109, 148, 109, 148, 109,
719 148, -1, 241, 149, -1, 23, -1, 262, -1, 100,
720 -1, 172, -1, 152, 111, 153, 112, -1, 186, -1,
721 249, -1, 100, -1, 100, -1, 154, -1, 155, -1,
722 23, -1, 159, 160, 156, -1, -1, 113, 157, -1,
723 114, 158, -1, 23, -1, 23, -1, 100, -1, 104,
724 -1, 104, -1, 104, -1, 104, -1, 101, -1, 105,
725 -1, -1, 101, -1, 102, -1, 103, -1, 104, -1,
726 -1, 115, 166, 116, -1, 115, 167, 116, -1, -1,
727 168, 163, -1, 169, 163, -1, 99, -1, 100, -1,
728 171, -1, 178, -1, 242, -1, 245, -1, 248, -1,
729 261, -1, 7, 99, 117, 172, -1, 96, 173, -1,
730 38, 177, -1, 60, -1, 98, 175, -1, 53, -1,
731 29, 254, -1, 37, -1, 74, 255, -1, 50, 111,
732 176, 112, -1, 97, 111, 174, 112, -1, 23, -1,
733 -1, 111, 176, 112, -1, 23, -1, 60, -1, 29,
734 254, -1, 37, -1, 74, 255, -1, 179, -1, 180,
735 -1, 10, 99, 182, -1, 10, 99, 111, 181, 112,
736 183, -1, -1, 23, -1, 117, 185, -1, 117, 118,
737 184, 119, -1, 187, -1, 184, 109, 187, -1, 189,
738 -1, 225, -1, 235, -1, 189, -1, 225, -1, 236,
739 -1, 188, -1, 226, -1, 235, -1, 189, -1, 73,
740 213, -1, 73, 190, -1, 73, 192, -1, 73, 195,
741 -1, 73, 197, -1, 73, 203, -1, 73, 199, -1,
742 73, 206, -1, 73, 208, -1, 73, 210, -1, 73,
743 212, -1, 73, 224, -1, 47, 253, 191, -1, 201,
744 -1, 33, -1, 69, -1, 43, 111, 202, 112, 193,
745 -1, 201, -1, 60, -1, 26, -1, 72, 194, -1,
746 40, -1, 32, -1, 44, 196, -1, 25, -1, 253,
747 67, -1, 45, 111, 202, 112, 253, 198, -1, 201,
748 -1, 75, 257, 200, -1, 29, -1, 25, -1, 31,
749 -1, 71, -1, 23, -1, 76, 255, 204, 205, -1,
750 35, -1, 54, -1, 79, -1, 80, -1, 78, -1,
751 77, -1, 36, 207, -1, 29, -1, 56, -1, 28,
752 111, 209, 112, 57, -1, 23, -1, 58, 211, -1,
753 70, -1, 26, -1, 215, 66, 111, 218, 112, -1,
754 215, 214, -1, -1, 66, 111, 218, 106, 218, 112,
755 -1, 49, 219, 216, -1, -1, 217, -1, 41, -1,
756 82, -1, 42, -1, 23, -1, 51, 220, -1, 63,
757 -1, 52, -1, 81, 255, -1, 55, 111, 222, 112,
758 -1, 48, 111, 223, 112, -1, -1, 111, 221, 112,
759 -1, 23, -1, 23, -1, 23, -1, 30, 64, -1,
760 229, -1, 232, -1, 227, -1, 230, -1, 62, 34,
761 111, 228, 112, -1, 233, -1, 233, 106, 233, -1,
762 62, 34, 111, 233, 112, -1, 62, 46, 111, 231,
763 112, -1, 234, -1, 234, 106, 234, -1, 62, 46,
764 111, 234, 112, -1, 23, -1, 23, -1, 237, -1,
765 239, -1, 238, -1, 239, -1, 240, -1, 24, -1,
766 23, -1, 118, 240, 119, -1, 118, 240, 109, 240,
767 119, -1, 118, 240, 109, 240, 109, 240, 119, -1,
768 118, 240, 109, 240, 109, 240, 109, 240, 119, -1,
769 241, 24, -1, 241, 23, -1, 113, -1, 114, -1,
770 -1, -1, 244, 11, 243, 247, -1, 262, -1, -1,
771 -1, 5, 246, 247, -1, 247, 109, 99, -1, 99,
772 -1, 244, 9, 99, 117, 249, -1, 65, 60, -1,
773 65, 37, -1, 65, 250, -1, 65, 59, -1, 65,
774 74, 255, -1, 65, 30, -1, 29, 251, 252, -1,
775 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
776 -1, 39, -1, 27, -1, -1, 61, -1, 68, -1,
777 -1, 111, 258, 112, -1, -1, 111, 259, 112, -1,
778 -1, 111, 260, 112, -1, 23, -1, 23, -1, 23,
779 -1, 6, 99, 117, 100, -1, 99, -1, 100, -1
782 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
783 static const yytype_uint16 yyrline
[] =
785 0, 268, 268, 271, 279, 291, 292, 295, 317, 318,
786 321, 336, 339, 344, 351, 352, 353, 354, 355, 356,
787 357, 360, 361, 362, 365, 371, 377, 383, 390, 396,
788 403, 447, 452, 462, 506, 512, 513, 514, 515, 516,
789 517, 518, 519, 520, 521, 522, 523, 526, 538, 546,
790 563, 570, 589, 600, 620, 645, 654, 687, 694, 709,
791 759, 801, 812, 833, 843, 849, 880, 897, 897, 899,
792 906, 918, 919, 920, 923, 937, 951, 969, 980, 992,
793 994, 995, 996, 997, 1000, 1000, 1000, 1000, 1001, 1004,
794 1008, 1013, 1020, 1027, 1034, 1057, 1080, 1081, 1082, 1083,
795 1084, 1085, 1088, 1106, 1110, 1116, 1120, 1124, 1128, 1137,
796 1146, 1150, 1155, 1161, 1172, 1172, 1173, 1175, 1179, 1183,
797 1187, 1193, 1193, 1195, 1211, 1234, 1237, 1248, 1254, 1260,
798 1261, 1268, 1274, 1280, 1288, 1294, 1300, 1308, 1314, 1320,
799 1328, 1329, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339,
800 1340, 1341, 1342, 1345, 1354, 1358, 1362, 1368, 1377, 1381,
801 1385, 1394, 1398, 1404, 1410, 1417, 1422, 1430, 1440, 1442,
802 1450, 1456, 1460, 1464, 1470, 1481, 1490, 1494, 1499, 1503,
803 1507, 1511, 1517, 1524, 1528, 1534, 1542, 1553, 1560, 1564,
804 1570, 1580, 1591, 1595, 1613, 1622, 1625, 1631, 1635, 1639,
805 1645, 1656, 1661, 1666, 1671, 1676, 1681, 1689, 1692, 1697,
806 1710, 1718, 1729, 1737, 1737, 1739, 1739, 1741, 1751, 1756,
807 1763, 1773, 1782, 1787, 1794, 1804, 1814, 1826, 1826, 1827,
808 1827, 1829, 1839, 1847, 1857, 1865, 1873, 1882, 1893, 1897,
809 1903, 1904, 1905, 1908, 1908, 1911, 1946, 1950, 1950, 1953,
810 1959, 1967, 1980, 1989, 1998, 2002, 2011, 2020, 2031, 2038,
811 2043, 2052, 2064, 2067, 2076, 2087, 2088, 2089, 2092, 2093,
812 2094, 2097, 2098, 2101, 2102, 2105, 2106, 2109, 2120, 2131,
817 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
818 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
819 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
820 static const char *const yytname
[] =
822 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
823 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
824 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
825 "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION",
826 "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION",
827 "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
828 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
829 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
830 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE",
831 "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
832 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK", "SPECULAR", "SPOT",
833 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
834 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
835 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D",
836 "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D",
837 "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB",
838 "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2",
839 "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'",
840 "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program",
841 "language", "optionSequence", "option", "statementSequence", "statement",
842 "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction",
843 "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction",
844 "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction",
845 "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget",
846 "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg",
847 "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp",
848 "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem",
849 "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset",
850 "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent",
851 "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask",
852 "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2",
853 "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem",
854 "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem",
855 "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt",
856 "optArraySize", "paramSingleInit", "paramMultipleInit",
857 "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse",
858 "paramMultipleItem", "stateMultipleItem", "stateSingleItem",
859 "stateMaterialItem", "stateMatProperty", "stateLightItem",
860 "stateLightProperty", "stateSpotProperty", "stateLightModelItem",
861 "stateLModProperty", "stateLightProdItem", "stateLProdProperty",
862 "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty",
863 "stateLightNumber", "stateTexGenItem", "stateTexGenType",
864 "stateTexGenCoord", "stateFogItem", "stateFogProperty",
865 "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem",
866 "statePointProperty", "stateMatrixRow", "stateMatrixRows",
867 "optMatrixRows", "stateMatrixItem", "stateOptMatModifier",
868 "stateMatModifier", "stateMatrixRowNum", "stateMatrixName",
869 "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum",
870 "stateProgramMatNum", "stateDepthItem", "programSingleItem",
871 "programMultipleItem", "progEnvParams", "progEnvParamNums",
872 "progEnvParam", "progLocalParams", "progLocalParamNums",
873 "progLocalParam", "progEnvParamNum", "progLocalParamNum",
874 "paramConstDecl", "paramConstUse", "paramConstScalarDecl",
875 "paramConstScalarUse", "paramConstVector", "signedFloatConstant",
876 "optionalSign", "TEMP_statement", "@1", "optVarSize",
877 "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement",
878 "resultBinding", "resultColBinding", "optResultFaceType",
879 "optResultColorType", "optFaceType", "optColorType",
880 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
881 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
882 "ALIAS_statement", "string", 0
887 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
889 static const yytype_uint16 yytoknum
[] =
891 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
892 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
893 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
894 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
895 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
896 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
897 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
898 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
899 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
900 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
901 355, 356, 357, 358, 359, 360, 361, 362, 59, 44,
902 124, 91, 93, 43, 45, 40, 41, 61, 123, 125
906 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
907 static const yytype_uint16 yyr1
[] =
909 0, 120, 121, 122, 122, 123, 123, 124, 125, 125,
910 126, 126, 127, 127, 128, 128, 128, 128, 128, 128,
911 128, 129, 129, 129, 130, 131, 132, 133, 134, 135,
912 136, 137, 137, 138, 139, 140, 140, 140, 140, 140,
913 140, 140, 140, 140, 140, 140, 140, 141, 142, 142,
914 143, 143, 144, 144, 145, 146, 147, 148, 149, 149,
915 150, 150, 150, 150, 151, 151, 152, 153, 153, 154,
916 155, 156, 156, 156, 157, 158, 159, 160, 161, 162,
917 163, 163, 163, 163, 164, 164, 164, 164, 164, 165,
918 165, 165, 166, 167, 168, 169, 170, 170, 170, 170,
919 170, 170, 171, 172, 172, 173, 173, 173, 173, 173,
920 173, 173, 173, 174, 175, 175, 176, 177, 177, 177,
921 177, 178, 178, 179, 180, 181, 181, 182, 183, 184,
922 184, 185, 185, 185, 186, 186, 186, 187, 187, 187,
923 188, 188, 189, 189, 189, 189, 189, 189, 189, 189,
924 189, 189, 189, 190, 191, 191, 191, 192, 193, 193,
925 193, 193, 193, 194, 195, 196, 196, 197, 198, 199,
926 200, 201, 201, 201, 202, 203, 204, 204, 205, 205,
927 205, 205, 206, 207, 207, 208, 209, 210, 211, 211,
928 212, 213, 214, 214, 215, 216, 216, 217, 217, 217,
929 218, 219, 219, 219, 219, 219, 219, 220, 220, 221,
930 222, 223, 224, 225, 225, 226, 226, 227, 228, 228,
931 229, 230, 231, 231, 232, 233, 234, 235, 235, 236,
932 236, 237, 238, 238, 239, 239, 239, 239, 240, 240,
933 241, 241, 241, 243, 242, 244, 244, 246, 245, 247,
934 247, 248, 249, 249, 249, 249, 249, 249, 250, 251,
935 251, 251, 252, 252, 252, 253, 253, 253, 254, 254,
936 254, 255, 255, 256, 256, 257, 257, 258, 259, 260,
940 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
941 static const yytype_uint8 yyr2
[] =
943 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
944 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
945 1, 1, 1, 1, 4, 4, 4, 6, 6, 8,
946 8, 2, 2, 12, 2, 1, 1, 1, 1, 1,
947 1, 1, 1, 1, 1, 1, 1, 6, 2, 4,
948 2, 1, 3, 5, 3, 2, 7, 2, 1, 1,
949 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
950 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
951 1, 1, 1, 0, 1, 1, 1, 1, 0, 3,
952 3, 0, 2, 2, 1, 1, 1, 1, 1, 1,
953 1, 1, 4, 2, 2, 1, 2, 1, 2, 1,
954 2, 4, 4, 1, 0, 3, 1, 1, 2, 1,
955 2, 1, 1, 3, 6, 0, 1, 2, 4, 1,
956 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
957 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
958 2, 2, 2, 3, 1, 1, 1, 5, 1, 1,
959 1, 2, 1, 1, 2, 1, 2, 6, 1, 3,
960 1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
961 1, 1, 2, 1, 1, 5, 1, 2, 1, 1,
962 5, 2, 0, 6, 3, 0, 1, 1, 1, 1,
963 1, 2, 1, 1, 2, 4, 4, 0, 3, 1,
964 1, 1, 2, 1, 1, 1, 1, 5, 1, 3,
965 5, 5, 1, 3, 5, 1, 1, 1, 1, 1,
966 1, 1, 1, 1, 3, 5, 7, 9, 2, 2,
967 1, 1, 0, 0, 4, 1, 0, 0, 3, 3,
968 1, 5, 2, 2, 2, 2, 3, 2, 3, 0,
969 1, 1, 0, 1, 1, 0, 1, 1, 0, 1,
970 1, 0, 3, 0, 3, 0, 3, 1, 1, 1,
974 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
975 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
976 means the default is an error. */
977 static const yytype_uint16 yydefact
[] =
979 0, 3, 4, 0, 6, 1, 9, 0, 5, 246,
980 281, 282, 0, 247, 0, 0, 0, 2, 0, 0,
981 0, 0, 0, 0, 0, 242, 0, 0, 8, 0,
982 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
983 23, 20, 0, 96, 97, 121, 122, 98, 0, 99,
984 100, 101, 245, 7, 0, 0, 0, 0, 0, 65,
985 0, 88, 64, 0, 0, 0, 0, 0, 76, 0,
986 0, 94, 240, 241, 31, 32, 83, 0, 0, 0,
987 10, 11, 0, 243, 250, 248, 0, 0, 125, 242,
988 123, 259, 257, 253, 255, 252, 271, 254, 242, 84,
989 85, 86, 87, 91, 242, 242, 242, 242, 242, 242,
990 78, 55, 81, 80, 82, 92, 233, 232, 0, 0,
991 0, 0, 60, 0, 242, 83, 0, 61, 63, 134,
992 135, 213, 214, 136, 229, 230, 0, 242, 0, 0,
993 0, 280, 102, 126, 0, 127, 131, 132, 133, 227,
994 228, 231, 0, 261, 260, 262, 0, 256, 0, 0,
995 54, 0, 0, 0, 26, 0, 25, 24, 268, 119,
996 117, 271, 104, 0, 0, 0, 0, 0, 0, 265,
997 0, 265, 0, 0, 275, 271, 142, 143, 144, 145,
998 147, 146, 148, 149, 150, 151, 0, 152, 268, 109,
999 0, 107, 105, 271, 0, 114, 103, 83, 0, 52,
1000 0, 0, 0, 0, 244, 249, 0, 239, 238, 263,
1001 264, 258, 277, 0, 242, 95, 0, 0, 83, 242,
1002 0, 48, 0, 51, 0, 242, 269, 270, 118, 120,
1003 0, 0, 0, 212, 183, 184, 182, 0, 165, 267,
1004 266, 164, 0, 0, 0, 0, 207, 203, 0, 202,
1005 271, 195, 189, 188, 187, 0, 0, 0, 0, 108,
1006 0, 110, 0, 0, 106, 0, 242, 234, 69, 0,
1007 67, 68, 0, 242, 242, 251, 0, 124, 272, 28,
1008 89, 90, 93, 27, 0, 79, 50, 273, 0, 0,
1009 225, 0, 226, 0, 186, 0, 174, 0, 166, 0,
1010 171, 172, 155, 156, 173, 153, 154, 0, 0, 201,
1011 0, 204, 197, 199, 198, 194, 196, 279, 0, 170,
1012 169, 176, 177, 0, 0, 116, 0, 113, 0, 0,
1013 53, 0, 62, 77, 71, 47, 0, 0, 0, 242,
1014 49, 0, 34, 0, 242, 220, 224, 0, 0, 265,
1015 211, 0, 209, 0, 210, 0, 276, 181, 180, 178,
1016 179, 175, 200, 0, 111, 112, 115, 242, 235, 0,
1017 0, 70, 242, 58, 57, 59, 242, 0, 0, 0,
1018 129, 137, 140, 138, 215, 216, 139, 278, 0, 35,
1019 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
1020 46, 30, 29, 185, 160, 162, 159, 0, 157, 158,
1021 0, 206, 208, 205, 190, 0, 74, 72, 75, 73,
1022 0, 0, 0, 0, 141, 192, 242, 128, 274, 163,
1023 161, 167, 168, 242, 236, 242, 0, 0, 0, 0,
1024 191, 130, 0, 0, 0, 0, 218, 0, 222, 0,
1025 237, 242, 0, 217, 0, 221, 0, 0, 56, 33,
1029 /* YYDEFGOTO[NTERM-NUM]. */
1030 static const yytype_int16 yydefgoto
[] =
1032 -1, 3, 4, 6, 8, 9, 28, 29, 30, 31,
1033 32, 33, 34, 35, 36, 37, 38, 39, 40, 298,
1034 411, 41, 161, 231, 74, 60, 69, 345, 346, 384,
1035 232, 61, 126, 279, 280, 281, 381, 427, 429, 70,
1036 344, 111, 296, 115, 103, 160, 75, 227, 76, 228,
1037 42, 43, 127, 206, 338, 274, 336, 172, 44, 45,
1038 46, 144, 90, 287, 389, 145, 128, 390, 391, 129,
1039 186, 315, 187, 418, 440, 188, 251, 189, 441, 190,
1040 330, 316, 307, 191, 333, 371, 192, 246, 193, 305,
1041 194, 264, 195, 434, 450, 196, 325, 326, 373, 261,
1042 319, 363, 365, 361, 197, 130, 393, 394, 455, 131,
1043 395, 457, 132, 301, 303, 396, 133, 149, 134, 135,
1044 151, 77, 47, 139, 48, 49, 54, 85, 50, 62,
1045 97, 155, 221, 252, 238, 157, 352, 266, 223, 398,
1049 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1051 #define YYPACT_NINF -401
1052 static const yytype_int16 yypact
[] =
1054 193, -401, -401, 27, -401, -401, 62, 143, -401, 24,
1055 -401, -401, -30, -401, -18, 12, 83, -401, 15, 15,
1056 15, 15, 15, 15, 67, 61, 15, 15, -401, 127,
1057 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1058 -401, -401, 144, -401, -401, -401, -401, -401, 204, -401,
1059 -401, -401, -401, -401, 155, 136, 138, 34, 140, -401,
1060 147, 108, -401, 150, 156, 157, 158, 160, -401, 162,
1061 159, -401, -401, -401, -401, -401, 102, -13, 163, 164,
1062 -401, -401, 165, -401, -401, 166, 170, 10, 235, 0,
1063 -401, 141, -401, -401, -401, -401, 167, -401, 131, -401,
1064 -401, -401, -401, 168, 131, 131, 131, 131, 131, 131,
1065 -401, -401, -401, -401, -401, -401, -401, -401, 104, 97,
1066 114, 38, 169, 30, 131, 102, 171, -401, -401, -401,
1067 -401, -401, -401, -401, -401, -401, 30, 131, 172, 155,
1068 175, -401, -401, -401, 173, -401, -401, -401, -401, -401,
1069 -401, -401, 223, -401, -401, 123, 253, -401, 177, 149,
1070 -401, 178, -10, 181, -401, 182, -401, -401, 134, -401,
1071 -401, 167, -401, 183, 184, 185, 213, 99, 186, 154,
1072 187, 146, 153, 7, 188, 167, -401, -401, -401, -401,
1073 -401, -401, -401, -401, -401, -401, 215, -401, 134, -401,
1074 190, -401, -401, 167, 191, 192, -401, 102, -48, -401,
1075 1, 195, 196, 214, 166, -401, 189, -401, -401, -401,
1076 -401, -401, -401, 180, 131, -401, 194, 197, 102, 131,
1077 30, -401, 203, 205, 201, 131, -401, -401, -401, -401,
1078 285, 288, 289, -401, -401, -401, -401, 291, -401, -401,
1079 -401, -401, 248, 291, 33, 206, 207, -401, 208, -401,
1080 167, 14, -401, -401, -401, 293, 292, 92, 209, -401,
1081 299, -401, 301, 299, -401, 216, 131, -401, -401, 217,
1082 -401, -401, 221, 131, 131, -401, 212, -401, -401, -401,
1083 -401, -401, -401, -401, 218, -401, -401, 220, 224, 225,
1084 -401, 226, -401, 227, -401, 228, -401, 230, -401, 231,
1085 -401, -401, -401, -401, -401, -401, -401, 304, 309, -401,
1086 312, -401, -401, -401, -401, -401, -401, -401, 232, -401,
1087 -401, -401, -401, 161, 313, -401, 233, -401, 234, 238,
1088 -401, 13, -401, -401, 137, -401, 242, -15, 243, 3,
1089 -401, 314, -401, 133, 131, -401, -401, 296, 94, 146,
1090 -401, 245, -401, 246, -401, 247, -401, -401, -401, -401,
1091 -401, -401, -401, 249, -401, -401, -401, 131, -401, 332,
1092 337, -401, 131, -401, -401, -401, 131, 142, 114, 28,
1093 -401, -401, -401, -401, -401, -401, -401, -401, 250, -401,
1094 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1095 -401, -401, -401, -401, -401, -401, -401, 331, -401, -401,
1096 68, -401, -401, -401, -401, 43, -401, -401, -401, -401,
1097 255, 256, 257, 258, -401, 300, 3, -401, -401, -401,
1098 -401, -401, -401, 131, -401, 131, 201, 285, 288, 259,
1099 -401, -401, 252, 264, 265, 263, 261, 266, 270, 313,
1100 -401, 131, 133, -401, 285, -401, 288, 80, -401, -401,
1101 -401, -401, 313, 267, -401
1104 /* YYPGOTO[NTERM-NUM]. */
1105 static const yytype_int16 yypgoto
[] =
1107 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1108 -401, -401, -401, -401, -401, -401, -401, -401, -401, -69,
1109 -82, -401, -100, 151, -86, 210, -401, -401, -366, -401,
1110 -54, -401, -401, -401, -401, -401, -401, -401, -401, 174,
1111 -401, -401, -401, -118, -401, -401, 229, -401, -401, -401,
1112 -401, -401, 295, -401, -401, -401, 110, -401, -401, -401,
1113 -401, -401, -401, -401, -401, -401, -401, -51, -401, -88,
1114 -401, -401, -401, -401, -401, -401, -401, -401, -401, -401,
1115 -401, -311, 139, -401, -401, -401, -401, -401, -401, -401,
1116 -401, -401, -401, -401, -401, -2, -401, -401, -400, -401,
1117 -401, -401, -401, -401, -401, 298, -401, -401, -401, -401,
1118 -401, -401, -401, -390, -295, 302, -401, -401, -136, -87,
1119 -120, -89, -401, -401, -401, -401, -401, 251, -401, 176,
1120 -401, -401, -401, -176, 198, -153, -401, -401, -401, -401,
1124 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1125 positive, shift that token. If negative, reduce the rule which
1126 number is the opposite. If zero, do what YYDEFACT says.
1127 If YYTABLE_NINF, syntax error. */
1128 #define YYTABLE_NINF -230
1129 static const yytype_int16 yytable
[] =
1131 152, 146, 150, 52, 208, 254, 164, 209, 383, 167,
1132 116, 117, 158, 116, 117, 162, 430, 162, 239, 163,
1133 162, 165, 166, 125, 278, 118, 233, 5, 118, 13,
1134 14, 15, 267, 262, 16, 152, 17, 18, 19, 20,
1135 21, 22, 23, 24, 25, 26, 27, 419, 118, 119,
1136 271, 212, 119, 116, 117, 322, 323, 456, 310, 467,
1137 120, 276, 119, 120, 311, 387, 312, 198, 118, 207,
1138 7, 277, 473, 120, 470, 199, 388, 263, 53, 453,
1139 58, 55, 211, 121, 10, 11, 121, 122, 200, 275,
1140 122, 201, 119, 310, 233, 468, 324, 123, 202, 311,
1141 230, 68, 313, 120, 314, 124, 121, 321, 124, 442,
1142 292, 56, 203, 72, 73, 59, 72, 73, 124, 310,
1143 414, 124, 377, 10, 11, 311, 121, 331, 244, 293,
1144 122, 173, 378, 168, 415, 204, 205, 436, 289, 314,
1145 162, 169, 175, 174, 176, 88, 332, 437, 124, 299,
1146 177, 89, 443, 458, 416, 245, 341, 178, 179, 180,
1147 71, 181, 444, 182, 170, 314, 417, 68, 153, 91,
1148 92, 471, 183, 249, 72, 73, 432, 93, 171, 248,
1149 154, 249, 57, 420, 219, 250, 472, 152, 433, 184,
1150 185, 220, 424, 250, 347, 236, 1, 2, 348, 94,
1151 95, 255, 237, 112, 256, 257, 113, 114, 258, 99,
1152 100, 101, 102, 82, 96, 83, 259, 399, 400, 401,
1153 402, 403, 404, 405, 406, 407, 408, 409, 410, 63,
1154 64, 65, 66, 67, 260, 80, 78, 79, 367, 368,
1155 369, 370, 10, 11, 72, 73, 217, 218, 71, 225,
1156 379, 380, 81, 86, 84, 87, 98, 425, 143, 104,
1157 152, 392, 150, 110, 138, 105, 106, 107, 412, 108,
1158 141, 109, 136, 137, 215, 140, 222, 243, 156, 58,
1159 -66, 268, 210, 159, 297, 216, 224, 229, 152, 213,
1160 234, 235, 288, 347, 240, 241, 242, 247, 253, 265,
1161 431, 270, 272, 273, 283, 284, 286, 295, 300, -229,
1162 290, 302, 304, 291, 306, 308, 327, 317, 318, 320,
1163 334, 329, 335, 452, 337, 343, 340, 360, 350, 342,
1164 349, 351, 362, 353, 354, 364, 372, 397, 355, 356,
1165 357, 385, 358, 359, 366, 374, 375, 152, 392, 150,
1166 376, 382, 386, 413, 152, 426, 347, 421, 422, 423,
1167 428, 424, 438, 439, 445, 446, 449, 464, 447, 448,
1168 459, 460, 347, 461, 462, 463, 466, 454, 465, 474,
1169 469, 294, 142, 339, 282, 451, 435, 147, 226, 285,
1170 214, 148, 309, 0, 0, 0, 269
1173 static const yytype_int16 yycheck
[] =
1175 89, 89, 89, 9, 124, 181, 106, 125, 23, 109,
1176 23, 24, 98, 23, 24, 104, 382, 106, 171, 105,
1177 109, 107, 108, 77, 23, 38, 162, 0, 38, 5,
1178 6, 7, 185, 26, 10, 124, 12, 13, 14, 15,
1179 16, 17, 18, 19, 20, 21, 22, 358, 38, 62,
1180 203, 137, 62, 23, 24, 41, 42, 447, 25, 459,
1181 73, 109, 62, 73, 31, 62, 33, 29, 38, 123,
1182 8, 119, 472, 73, 464, 37, 73, 70, 108, 445,
1183 65, 99, 136, 96, 99, 100, 96, 100, 50, 207,
1184 100, 53, 62, 25, 230, 461, 82, 110, 60, 31,
1185 110, 100, 69, 73, 71, 118, 96, 260, 118, 420,
1186 228, 99, 74, 113, 114, 100, 113, 114, 118, 25,
1187 26, 118, 109, 99, 100, 31, 96, 35, 29, 229,
1188 100, 34, 119, 29, 40, 97, 98, 109, 224, 71,
1189 229, 37, 28, 46, 30, 111, 54, 119, 118, 235,
1190 36, 117, 109, 448, 60, 56, 276, 43, 44, 45,
1191 99, 47, 119, 49, 60, 71, 72, 100, 27, 29,
1192 30, 466, 58, 27, 113, 114, 34, 37, 74, 25,
1193 39, 27, 99, 359, 61, 39, 106, 276, 46, 75,
1194 76, 68, 112, 39, 283, 61, 3, 4, 284, 59,
1195 60, 48, 68, 101, 51, 52, 104, 105, 55, 101,
1196 102, 103, 104, 9, 74, 11, 63, 84, 85, 86,
1197 87, 88, 89, 90, 91, 92, 93, 94, 95, 19,
1198 20, 21, 22, 23, 81, 108, 26, 27, 77, 78,
1199 79, 80, 99, 100, 113, 114, 23, 24, 99, 100,
1200 113, 114, 108, 117, 99, 117, 109, 377, 23, 109,
1201 349, 349, 349, 104, 99, 109, 109, 109, 354, 109,
1202 100, 109, 109, 109, 99, 109, 23, 64, 111, 65,
1203 111, 66, 111, 115, 83, 112, 109, 109, 377, 117,
1204 109, 109, 112, 382, 111, 111, 111, 111, 111, 111,
1205 386, 111, 111, 111, 109, 109, 117, 104, 23, 104,
1206 116, 23, 23, 116, 23, 67, 23, 111, 111, 111,
1207 111, 29, 23, 443, 23, 104, 110, 23, 110, 112,
1208 118, 111, 23, 109, 109, 23, 23, 23, 112, 112,
1209 112, 347, 112, 112, 112, 112, 112, 436, 436, 436,
1210 112, 109, 109, 57, 443, 23, 445, 112, 112, 112,
1211 23, 112, 112, 32, 109, 109, 66, 106, 111, 111,
1212 111, 119, 461, 109, 109, 112, 106, 446, 112, 112,
1213 462, 230, 87, 273, 210, 436, 388, 89, 159, 213,
1214 139, 89, 253, -1, -1, -1, 198
1217 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1218 symbol of state STATE-NUM. */
1219 static const yytype_uint16 yystos
[] =
1221 0, 3, 4, 121, 122, 0, 123, 8, 124, 125,
1222 99, 100, 262, 5, 6, 7, 10, 12, 13, 14,
1223 15, 16, 17, 18, 19, 20, 21, 22, 126, 127,
1224 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
1225 138, 141, 170, 171, 178, 179, 180, 242, 244, 245,
1226 248, 261, 262, 108, 246, 99, 99, 99, 65, 100,
1227 145, 151, 249, 145, 145, 145, 145, 145, 100, 146,
1228 159, 99, 113, 114, 144, 166, 168, 241, 145, 145,
1229 108, 108, 9, 11, 99, 247, 117, 117, 111, 117,
1230 182, 29, 30, 37, 59, 60, 74, 250, 109, 101,
1231 102, 103, 104, 164, 109, 109, 109, 109, 109, 109,
1232 104, 161, 101, 104, 105, 163, 23, 24, 38, 62,
1233 73, 96, 100, 110, 118, 150, 152, 172, 186, 189,
1234 225, 229, 232, 236, 238, 239, 109, 109, 99, 243,
1235 109, 100, 172, 23, 181, 185, 189, 225, 235, 237,
1236 239, 240, 241, 27, 39, 251, 111, 255, 144, 115,
1237 165, 142, 241, 144, 142, 144, 144, 142, 29, 37,
1238 60, 74, 177, 34, 46, 28, 30, 36, 43, 44,
1239 45, 47, 49, 58, 75, 76, 190, 192, 195, 197,
1240 199, 203, 206, 208, 210, 212, 215, 224, 29, 37,
1241 50, 53, 60, 74, 97, 98, 173, 150, 240, 163,
1242 111, 150, 144, 117, 247, 99, 112, 23, 24, 61,
1243 68, 252, 23, 258, 109, 100, 166, 167, 169, 109,
1244 110, 143, 150, 238, 109, 109, 61, 68, 254, 255,
1245 111, 111, 111, 64, 29, 56, 207, 111, 25, 27,
1246 39, 196, 253, 111, 253, 48, 51, 52, 55, 63,
1247 81, 219, 26, 70, 211, 111, 257, 255, 66, 254,
1248 111, 255, 111, 111, 175, 163, 109, 119, 23, 153,
1249 154, 155, 159, 109, 109, 249, 117, 183, 112, 144,
1250 116, 116, 163, 142, 143, 104, 162, 83, 139, 144,
1251 23, 233, 23, 234, 23, 209, 23, 202, 67, 202,
1252 25, 31, 33, 69, 71, 191, 201, 111, 111, 220,
1253 111, 255, 41, 42, 82, 216, 217, 23, 260, 29,
1254 200, 35, 54, 204, 111, 23, 176, 23, 174, 176,
1255 110, 240, 112, 104, 160, 147, 148, 241, 144, 118,
1256 110, 111, 256, 109, 109, 112, 112, 112, 112, 112,
1257 23, 223, 23, 221, 23, 222, 112, 77, 78, 79,
1258 80, 205, 23, 218, 112, 112, 112, 109, 119, 113,
1259 114, 156, 109, 23, 149, 262, 109, 62, 73, 184,
1260 187, 188, 189, 226, 227, 230, 235, 23, 259, 84,
1261 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1262 95, 140, 144, 57, 26, 40, 60, 72, 193, 201,
1263 253, 112, 112, 112, 112, 240, 23, 157, 23, 158,
1264 148, 144, 34, 46, 213, 215, 109, 119, 112, 32,
1265 194, 198, 201, 109, 119, 109, 109, 111, 111, 66,
1266 214, 187, 240, 148, 139, 228, 233, 231, 234, 111,
1267 119, 109, 109, 112, 106, 112, 106, 218, 148, 140,
1268 233, 234, 106, 218, 112
1271 #define yyerrok (yyerrstatus = 0)
1272 #define yyclearin (yychar = YYEMPTY)
1273 #define YYEMPTY (-2)
1276 #define YYACCEPT goto yyacceptlab
1277 #define YYABORT goto yyabortlab
1278 #define YYERROR goto yyerrorlab
1281 /* Like YYERROR except do call yyerror. This remains here temporarily
1282 to ease the transition to the new meaning of YYERROR, for GCC.
1283 Once GCC version 2 has supplanted version 1, this can go. */
1285 #define YYFAIL goto yyerrlab
1287 #define YYRECOVERING() (!!yyerrstatus)
1289 #define YYBACKUP(Token, Value) \
1291 if (yychar == YYEMPTY && yylen == 1) \
1295 yytoken = YYTRANSLATE (yychar); \
1301 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1308 #define YYERRCODE 256
1311 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1312 If N is 0, then set CURRENT to the empty location which ends
1313 the previous symbol: RHS[0] (always defined). */
1315 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1316 #ifndef YYLLOC_DEFAULT
1317 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1321 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1322 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1323 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1324 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1328 (Current).first_line = (Current).last_line = \
1329 YYRHSLOC (Rhs, 0).last_line; \
1330 (Current).first_column = (Current).last_column = \
1331 YYRHSLOC (Rhs, 0).last_column; \
1337 /* YY_LOCATION_PRINT -- Print the location on the stream.
1338 This macro was not mandated originally: define only if we know
1339 we won't break user code: when these are the locations we know. */
1341 #ifndef YY_LOCATION_PRINT
1342 # if YYLTYPE_IS_TRIVIAL
1343 # define YY_LOCATION_PRINT(File, Loc) \
1344 fprintf (File, "%d.%d-%d.%d", \
1345 (Loc).first_line, (Loc).first_column, \
1346 (Loc).last_line, (Loc).last_column)
1348 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1353 /* YYLEX -- calling `yylex' with the right arguments. */
1356 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1358 # define YYLEX yylex (&yylval, &yylloc, scanner)
1361 /* Enable debugging if requested. */
1365 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1366 # define YYFPRINTF fprintf
1369 # define YYDPRINTF(Args) \
1375 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1379 YYFPRINTF (stderr, "%s ", Title); \
1380 yy_symbol_print (stderr, \
1381 Type, Value, Location, state); \
1382 YYFPRINTF (stderr, "\n"); \
1387 /*--------------------------------.
1388 | Print this symbol on YYOUTPUT. |
1389 `--------------------------------*/
1392 #if (defined __STDC__ || defined __C99__FUNC__ \
1393 || defined __cplusplus || defined _MSC_VER)
1395 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1398 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1401 YYSTYPE
const * const yyvaluep
;
1402 YYLTYPE
const * const yylocationp
;
1403 struct asm_parser_state
*state
;
1408 YYUSE (yylocationp
);
1411 if (yytype
< YYNTOKENS
)
1412 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1424 /*--------------------------------.
1425 | Print this symbol on YYOUTPUT. |
1426 `--------------------------------*/
1428 #if (defined __STDC__ || defined __C99__FUNC__ \
1429 || defined __cplusplus || defined _MSC_VER)
1431 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1434 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1437 YYSTYPE
const * const yyvaluep
;
1438 YYLTYPE
const * const yylocationp
;
1439 struct asm_parser_state
*state
;
1442 if (yytype
< YYNTOKENS
)
1443 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1445 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1447 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1448 YYFPRINTF (yyoutput
, ": ");
1449 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1450 YYFPRINTF (yyoutput
, ")");
1453 /*------------------------------------------------------------------.
1454 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1456 `------------------------------------------------------------------*/
1458 #if (defined __STDC__ || defined __C99__FUNC__ \
1459 || defined __cplusplus || defined _MSC_VER)
1461 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1464 yy_stack_print (yybottom
, yytop
)
1465 yytype_int16
*yybottom
;
1466 yytype_int16
*yytop
;
1469 YYFPRINTF (stderr
, "Stack now");
1470 for (; yybottom
<= yytop
; yybottom
++)
1472 int yybot
= *yybottom
;
1473 YYFPRINTF (stderr
, " %d", yybot
);
1475 YYFPRINTF (stderr
, "\n");
1478 # define YY_STACK_PRINT(Bottom, Top) \
1481 yy_stack_print ((Bottom), (Top)); \
1485 /*------------------------------------------------.
1486 | Report that the YYRULE is going to be reduced. |
1487 `------------------------------------------------*/
1489 #if (defined __STDC__ || defined __C99__FUNC__ \
1490 || defined __cplusplus || defined _MSC_VER)
1492 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1495 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1499 struct asm_parser_state
*state
;
1502 int yynrhs
= yyr2
[yyrule
];
1504 unsigned long int yylno
= yyrline
[yyrule
];
1505 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1507 /* The symbols being reduced. */
1508 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1510 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1511 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1512 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1513 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1514 YYFPRINTF (stderr
, "\n");
1518 # define YY_REDUCE_PRINT(Rule) \
1521 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1524 /* Nonzero means print parse trace. It is left uninitialized so that
1525 multiple parsers can coexist. */
1527 #else /* !YYDEBUG */
1528 # define YYDPRINTF(Args)
1529 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1530 # define YY_STACK_PRINT(Bottom, Top)
1531 # define YY_REDUCE_PRINT(Rule)
1532 #endif /* !YYDEBUG */
1535 /* YYINITDEPTH -- initial size of the parser's stacks. */
1537 # define YYINITDEPTH 200
1540 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1541 if the built-in stack extension method is used).
1543 Do not make this value too large; the results are undefined if
1544 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1545 evaluated with infinite-precision integer arithmetic. */
1548 # define YYMAXDEPTH 10000
1556 # if defined __GLIBC__ && defined _STRING_H
1557 # define yystrlen strlen
1559 /* Return the length of YYSTR. */
1560 #if (defined __STDC__ || defined __C99__FUNC__ \
1561 || defined __cplusplus || defined _MSC_VER)
1563 yystrlen (const char *yystr
)
1571 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1579 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1580 # define yystpcpy stpcpy
1582 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1584 #if (defined __STDC__ || defined __C99__FUNC__ \
1585 || defined __cplusplus || defined _MSC_VER)
1587 yystpcpy (char *yydest
, const char *yysrc
)
1590 yystpcpy (yydest
, yysrc
)
1596 const char *yys
= yysrc
;
1598 while ((*yyd
++ = *yys
++) != '\0')
1607 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1608 quotes and backslashes, so that it's suitable for yyerror. The
1609 heuristic is that double-quoting is unnecessary unless the string
1610 contains an apostrophe, a comma, or backslash (other than
1611 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1612 null, do not copy; instead, return the length of what the result
1615 yytnamerr (char *yyres
, const char *yystr
)
1620 char const *yyp
= yystr
;
1627 goto do_not_strip_quotes
;
1631 goto do_not_strip_quotes
;
1644 do_not_strip_quotes
: ;
1648 return yystrlen (yystr
);
1650 return yystpcpy (yyres
, yystr
) - yyres
;
1654 /* Copy into YYRESULT an error message about the unexpected token
1655 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1656 including the terminating null byte. If YYRESULT is null, do not
1657 copy anything; just return the number of bytes that would be
1658 copied. As a special case, return 0 if an ordinary "syntax error"
1659 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1660 size calculation. */
1662 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1664 int yyn
= yypact
[yystate
];
1666 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1670 int yytype
= YYTRANSLATE (yychar
);
1671 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1672 YYSIZE_T yysize
= yysize0
;
1674 int yysize_overflow
= 0;
1675 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1676 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1680 /* This is so xgettext sees the translatable formats that are
1681 constructed on the fly. */
1682 YY_("syntax error, unexpected %s");
1683 YY_("syntax error, unexpected %s, expecting %s");
1684 YY_("syntax error, unexpected %s, expecting %s or %s");
1685 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1686 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1690 static char const yyunexpected
[] = "syntax error, unexpected %s";
1691 static char const yyexpecting
[] = ", expecting %s";
1692 static char const yyor
[] = " or %s";
1693 char yyformat
[sizeof yyunexpected
1694 + sizeof yyexpecting
- 1
1695 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1696 * (sizeof yyor
- 1))];
1697 char const *yyprefix
= yyexpecting
;
1699 /* Start YYX at -YYN if negative to avoid negative indexes in
1701 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1703 /* Stay within bounds of both yycheck and yytname. */
1704 int yychecklim
= YYLAST
- yyn
+ 1;
1705 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1708 yyarg
[0] = yytname
[yytype
];
1709 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1711 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1712 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1714 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1718 yyformat
[sizeof yyunexpected
- 1] = '\0';
1721 yyarg
[yycount
++] = yytname
[yyx
];
1722 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1723 yysize_overflow
|= (yysize1
< yysize
);
1725 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1729 yyf
= YY_(yyformat
);
1730 yysize1
= yysize
+ yystrlen (yyf
);
1731 yysize_overflow
|= (yysize1
< yysize
);
1734 if (yysize_overflow
)
1735 return YYSIZE_MAXIMUM
;
1739 /* Avoid sprintf, as that infringes on the user's name space.
1740 Don't have undefined behavior even if the translation
1741 produced a string with the wrong number of "%s"s. */
1742 char *yyp
= yyresult
;
1744 while ((*yyp
= *yyf
) != '\0')
1746 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1748 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1761 #endif /* YYERROR_VERBOSE */
1764 /*-----------------------------------------------.
1765 | Release the memory associated to this symbol. |
1766 `-----------------------------------------------*/
1769 #if (defined __STDC__ || defined __C99__FUNC__ \
1770 || defined __cplusplus || defined _MSC_VER)
1772 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1775 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1779 YYLTYPE
*yylocationp
;
1780 struct asm_parser_state
*state
;
1784 YYUSE (yylocationp
);
1789 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1799 /* Prevent warnings from -Wmissing-prototypes. */
1800 #ifdef YYPARSE_PARAM
1801 #if defined __STDC__ || defined __cplusplus
1802 int yyparse (void *YYPARSE_PARAM
);
1806 #else /* ! YYPARSE_PARAM */
1807 #if defined __STDC__ || defined __cplusplus
1808 int yyparse (struct asm_parser_state
*state
);
1812 #endif /* ! YYPARSE_PARAM */
1818 /*-------------------------.
1819 | yyparse or yypush_parse. |
1820 `-------------------------*/
1822 #ifdef YYPARSE_PARAM
1823 #if (defined __STDC__ || defined __C99__FUNC__ \
1824 || defined __cplusplus || defined _MSC_VER)
1826 yyparse (void *YYPARSE_PARAM
)
1829 yyparse (YYPARSE_PARAM
)
1830 void *YYPARSE_PARAM
;
1832 #else /* ! YYPARSE_PARAM */
1833 #if (defined __STDC__ || defined __C99__FUNC__ \
1834 || defined __cplusplus || defined _MSC_VER)
1836 yyparse (struct asm_parser_state
*state
)
1840 struct asm_parser_state
*state
;
1844 /* The lookahead symbol. */
1847 /* The semantic value of the lookahead symbol. */
1850 /* Location data for the lookahead symbol. */
1853 /* Number of syntax errors so far. */
1857 /* Number of tokens to shift before error messages enabled. */
1860 /* The stacks and their tools:
1861 `yyss': related to states.
1862 `yyvs': related to semantic values.
1863 `yyls': related to locations.
1865 Refer to the stacks thru separate pointers, to allow yyoverflow
1866 to reallocate them elsewhere. */
1868 /* The state stack. */
1869 yytype_int16 yyssa
[YYINITDEPTH
];
1871 yytype_int16
*yyssp
;
1873 /* The semantic value stack. */
1874 YYSTYPE yyvsa
[YYINITDEPTH
];
1878 /* The location stack. */
1879 YYLTYPE yylsa
[YYINITDEPTH
];
1883 /* The locations where the error started and ended. */
1884 YYLTYPE yyerror_range
[2];
1886 YYSIZE_T yystacksize
;
1890 /* Lookahead token as an internal (translated) token number. */
1892 /* The variables used to return semantic value and location from the
1898 /* Buffer for error messages, and its allocated size. */
1900 char *yymsg
= yymsgbuf
;
1901 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1904 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1906 /* The number of symbols on the RHS of the reduced rule.
1907 Keep to zero when no symbol should be popped. */
1914 yystacksize
= YYINITDEPTH
;
1916 YYDPRINTF ((stderr
, "Starting parse\n"));
1921 yychar
= YYEMPTY
; /* Cause a token to be read. */
1923 /* Initialize stack pointers.
1924 Waste one element of value and location stack
1925 so that they stay on the same level as the state stack.
1926 The wasted elements are never initialized. */
1931 #if YYLTYPE_IS_TRIVIAL
1932 /* Initialize the default location before parsing starts. */
1933 yylloc
.first_line
= yylloc
.last_line
= 1;
1934 yylloc
.first_column
= yylloc
.last_column
= 1;
1939 /*------------------------------------------------------------.
1940 | yynewstate -- Push a new state, which is found in yystate. |
1941 `------------------------------------------------------------*/
1943 /* In all cases, when you get here, the value and location stacks
1944 have just been pushed. So pushing a state here evens the stacks. */
1950 if (yyss
+ yystacksize
- 1 <= yyssp
)
1952 /* Get the current used size of the three stacks, in elements. */
1953 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1957 /* Give user a chance to reallocate the stack. Use copies of
1958 these so that the &'s don't force the real ones into
1960 YYSTYPE
*yyvs1
= yyvs
;
1961 yytype_int16
*yyss1
= yyss
;
1962 YYLTYPE
*yyls1
= yyls
;
1964 /* Each stack pointer address is followed by the size of the
1965 data in use in that stack, in bytes. This used to be a
1966 conditional around just the two extra args, but that might
1967 be undefined if yyoverflow is a macro. */
1968 yyoverflow (YY_("memory exhausted"),
1969 &yyss1
, yysize
* sizeof (*yyssp
),
1970 &yyvs1
, yysize
* sizeof (*yyvsp
),
1971 &yyls1
, yysize
* sizeof (*yylsp
),
1978 #else /* no yyoverflow */
1979 # ifndef YYSTACK_RELOCATE
1980 goto yyexhaustedlab
;
1982 /* Extend the stack our own way. */
1983 if (YYMAXDEPTH
<= yystacksize
)
1984 goto yyexhaustedlab
;
1986 if (YYMAXDEPTH
< yystacksize
)
1987 yystacksize
= YYMAXDEPTH
;
1990 yytype_int16
*yyss1
= yyss
;
1991 union yyalloc
*yyptr
=
1992 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1994 goto yyexhaustedlab
;
1995 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1996 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1997 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1998 # undef YYSTACK_RELOCATE
2000 YYSTACK_FREE (yyss1
);
2003 #endif /* no yyoverflow */
2005 yyssp
= yyss
+ yysize
- 1;
2006 yyvsp
= yyvs
+ yysize
- 1;
2007 yylsp
= yyls
+ yysize
- 1;
2009 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2010 (unsigned long int) yystacksize
));
2012 if (yyss
+ yystacksize
- 1 <= yyssp
)
2016 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2018 if (yystate
== YYFINAL
)
2028 /* Do appropriate processing given the current state. Read a
2029 lookahead token if we need one and don't already have one. */
2031 /* First try to decide what to do without reference to lookahead token. */
2032 yyn
= yypact
[yystate
];
2033 if (yyn
== YYPACT_NINF
)
2036 /* Not known => get a lookahead token if don't already have one. */
2038 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2039 if (yychar
== YYEMPTY
)
2041 YYDPRINTF ((stderr
, "Reading a token: "));
2045 if (yychar
<= YYEOF
)
2047 yychar
= yytoken
= YYEOF
;
2048 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2052 yytoken
= YYTRANSLATE (yychar
);
2053 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2056 /* If the proper action on seeing token YYTOKEN is to reduce or to
2057 detect an error, take that action. */
2059 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2064 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2070 /* Count tokens shifted since error; after three, turn off error
2075 /* Shift the lookahead token. */
2076 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2078 /* Discard the shifted token. */
2087 /*-----------------------------------------------------------.
2088 | yydefault -- do the default action for the current state. |
2089 `-----------------------------------------------------------*/
2091 yyn
= yydefact
[yystate
];
2097 /*-----------------------------.
2098 | yyreduce -- Do a reduction. |
2099 `-----------------------------*/
2101 /* yyn is the number of a rule to reduce with. */
2104 /* If YYLEN is nonzero, implement the default value of the action:
2107 Otherwise, the following line sets YYVAL to garbage.
2108 This behavior is undocumented and Bison
2109 users should not rely upon it. Assigning to YYVAL
2110 unconditionally makes the parser a bit smaller, and it avoids a
2111 GCC warning that YYVAL may be used uninitialized. */
2112 yyval
= yyvsp
[1-yylen
];
2114 /* Default location. */
2115 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2116 YY_REDUCE_PRINT (yyn
);
2121 /* Line 1455 of yacc.c */
2122 #line 272 "program_parse.y"
2124 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2125 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2128 state
->mode
= ARB_vertex
;
2134 /* Line 1455 of yacc.c */
2135 #line 280 "program_parse.y"
2137 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2138 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2140 state
->mode
= ARB_fragment
;
2142 state
->option
.TexRect
=
2143 (state
->ctx
->Extensions
.NV_texture_rectangle
!= GL_FALSE
);
2149 /* Line 1455 of yacc.c */
2150 #line 296 "program_parse.y"
2154 if (state
->mode
== ARB_vertex
) {
2155 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2156 } else if (state
->mode
== ARB_fragment
) {
2157 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2162 const char *const err_str
= (state
->mode
== ARB_vertex
)
2163 ? "invalid ARB vertex program option"
2164 : "invalid ARB fragment program option";
2166 yyerror(& (yylsp
[(2) - (3)]), state
, err_str
);
2174 /* Line 1455 of yacc.c */
2175 #line 322 "program_parse.y"
2177 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2178 if (state
->inst_tail
== NULL
) {
2179 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2181 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2184 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2185 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2187 state
->prog
->NumInstructions
++;
2194 /* Line 1455 of yacc.c */
2195 #line 340 "program_parse.y"
2197 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2198 state
->prog
->NumAluInstructions
++;
2204 /* Line 1455 of yacc.c */
2205 #line 345 "program_parse.y"
2207 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2208 state
->prog
->NumTexInstructions
++;
2214 /* Line 1455 of yacc.c */
2215 #line 366 "program_parse.y"
2217 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2223 /* Line 1455 of yacc.c */
2224 #line 372 "program_parse.y"
2226 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2232 /* Line 1455 of yacc.c */
2233 #line 378 "program_parse.y"
2235 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (4)].temp_inst
), & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2241 /* Line 1455 of yacc.c */
2242 #line 384 "program_parse.y"
2244 (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
);
2250 /* Line 1455 of yacc.c */
2251 #line 391 "program_parse.y"
2253 (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
);
2259 /* Line 1455 of yacc.c */
2260 #line 398 "program_parse.y"
2262 (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
));
2268 /* Line 1455 of yacc.c */
2269 #line 404 "program_parse.y"
2271 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (8)].temp_inst
), & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2272 if ((yyval
.inst
) != NULL
) {
2273 const GLbitfield tex_mask
= (1U << (yyvsp
[(6) - (8)].integer
));
2274 GLbitfield shadow_tex
= 0;
2275 GLbitfield target_mask
= 0;
2278 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2280 if ((yyvsp
[(8) - (8)].integer
) < 0) {
2281 shadow_tex
= tex_mask
;
2283 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(8) - (8)].integer
);
2284 (yyval
.inst
)->Base
.TexShadow
= 1;
2286 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2289 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2291 /* If this texture unit was previously accessed and that access
2292 * had a different texture target, generate an error.
2294 * If this texture unit was previously accessed and that access
2295 * had a different shadow mode, generate an error.
2297 if ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != 0)
2298 && ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != target_mask
)
2299 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2301 yyerror(& (yylsp
[(8) - (8)]), state
,
2302 "multiple targets used on one texture image unit");
2307 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= target_mask
;
2308 state
->prog
->ShadowSamplers
|= shadow_tex
;
2315 /* Line 1455 of yacc.c */
2316 #line 448 "program_parse.y"
2318 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2319 state
->fragment
.UsesKill
= 1;
2325 /* Line 1455 of yacc.c */
2326 #line 453 "program_parse.y"
2328 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL_NV
, NULL
, NULL
, NULL
, NULL
);
2329 (yyval
.inst
)->Base
.DstReg
.CondMask
= (yyvsp
[(2) - (2)].dst_reg
).CondMask
;
2330 (yyval
.inst
)->Base
.DstReg
.CondSwizzle
= (yyvsp
[(2) - (2)].dst_reg
).CondSwizzle
;
2331 (yyval
.inst
)->Base
.DstReg
.CondSrc
= (yyvsp
[(2) - (2)].dst_reg
).CondSrc
;
2332 state
->fragment
.UsesKill
= 1;
2338 /* Line 1455 of yacc.c */
2339 #line 463 "program_parse.y"
2341 (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
));
2342 if ((yyval
.inst
) != NULL
) {
2343 const GLbitfield tex_mask
= (1U << (yyvsp
[(10) - (12)].integer
));
2344 GLbitfield shadow_tex
= 0;
2345 GLbitfield target_mask
= 0;
2348 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(10) - (12)].integer
);
2350 if ((yyvsp
[(12) - (12)].integer
) < 0) {
2351 shadow_tex
= tex_mask
;
2353 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(12) - (12)].integer
);
2354 (yyval
.inst
)->Base
.TexShadow
= 1;
2356 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(12) - (12)].integer
);
2359 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2361 /* If this texture unit was previously accessed and that access
2362 * had a different texture target, generate an error.
2364 * If this texture unit was previously accessed and that access
2365 * had a different shadow mode, generate an error.
2367 if ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != 0)
2368 && ((state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] != target_mask
)
2369 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2371 yyerror(& (yylsp
[(12) - (12)]), state
,
2372 "multiple targets used on one texture image unit");
2377 state
->prog
->TexturesUsed
[(yyvsp
[(10) - (12)].integer
)] |= target_mask
;
2378 state
->prog
->ShadowSamplers
|= shadow_tex
;
2385 /* Line 1455 of yacc.c */
2386 #line 507 "program_parse.y"
2388 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2394 /* Line 1455 of yacc.c */
2395 #line 512 "program_parse.y"
2396 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2401 /* Line 1455 of yacc.c */
2402 #line 513 "program_parse.y"
2403 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2408 /* Line 1455 of yacc.c */
2409 #line 514 "program_parse.y"
2410 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2415 /* Line 1455 of yacc.c */
2416 #line 515 "program_parse.y"
2417 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2422 /* Line 1455 of yacc.c */
2423 #line 516 "program_parse.y"
2424 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2429 /* Line 1455 of yacc.c */
2430 #line 517 "program_parse.y"
2431 { (yyval
.integer
) = -TEXTURE_1D_INDEX
; ;}
2436 /* Line 1455 of yacc.c */
2437 #line 518 "program_parse.y"
2438 { (yyval
.integer
) = -TEXTURE_2D_INDEX
; ;}
2443 /* Line 1455 of yacc.c */
2444 #line 519 "program_parse.y"
2445 { (yyval
.integer
) = -TEXTURE_RECT_INDEX
; ;}
2450 /* Line 1455 of yacc.c */
2451 #line 520 "program_parse.y"
2452 { (yyval
.integer
) = TEXTURE_1D_ARRAY_INDEX
; ;}
2457 /* Line 1455 of yacc.c */
2458 #line 521 "program_parse.y"
2459 { (yyval
.integer
) = TEXTURE_2D_ARRAY_INDEX
; ;}
2464 /* Line 1455 of yacc.c */
2465 #line 522 "program_parse.y"
2466 { (yyval
.integer
) = -TEXTURE_1D_ARRAY_INDEX
; ;}
2471 /* Line 1455 of yacc.c */
2472 #line 523 "program_parse.y"
2473 { (yyval
.integer
) = -TEXTURE_2D_ARRAY_INDEX
; ;}
2478 /* Line 1455 of yacc.c */
2479 #line 527 "program_parse.y"
2481 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2482 * FIXME: to the existing swizzle?
2484 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2485 (yyvsp
[(4) - (6)].src_reg
).Base
.Negate
= (yyvsp
[(6) - (6)].swiz_mask
).mask
;
2487 (yyval
.inst
) = asm_instruction_copy_ctor(& (yyvsp
[(1) - (6)].temp_inst
), & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2493 /* Line 1455 of yacc.c */
2494 #line 539 "program_parse.y"
2496 (yyval
.src_reg
) = (yyvsp
[(2) - (2)].src_reg
);
2498 if ((yyvsp
[(1) - (2)].negate
)) {
2499 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2506 /* Line 1455 of yacc.c */
2507 #line 547 "program_parse.y"
2509 (yyval
.src_reg
) = (yyvsp
[(3) - (4)].src_reg
);
2511 if (!state
->option
.NV_fragment
) {
2512 yyerror(& (yylsp
[(2) - (4)]), state
, "unexpected character '|'");
2516 if ((yyvsp
[(1) - (4)].negate
)) {
2517 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2520 (yyval
.src_reg
).Base
.Abs
= 1;
2526 /* Line 1455 of yacc.c */
2527 #line 564 "program_parse.y"
2529 (yyval
.src_reg
) = (yyvsp
[(1) - (2)].src_reg
);
2531 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2532 (yyvsp
[(2) - (2)].swiz_mask
).swizzle
);
2538 /* Line 1455 of yacc.c */
2539 #line 571 "program_parse.y"
2541 struct asm_symbol temp_sym
;
2543 if (!state
->option
.NV_fragment
) {
2544 yyerror(& (yylsp
[(1) - (1)]), state
, "expected scalar suffix");
2548 memset(& temp_sym
, 0, sizeof(temp_sym
));
2549 temp_sym
.param_binding_begin
= ~0;
2550 initialize_symbol_from_const(state
->prog
, & temp_sym
, & (yyvsp
[(1) - (1)].vector
));
2552 init_src_reg(& (yyval
.src_reg
));
2553 (yyval
.src_reg
).Base
.File
= PROGRAM_CONSTANT
;
2554 (yyval
.src_reg
).Base
.Index
= temp_sym
.param_binding_begin
;
2560 /* Line 1455 of yacc.c */
2561 #line 590 "program_parse.y"
2563 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2565 if ((yyvsp
[(1) - (3)].negate
)) {
2566 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2569 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2570 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2576 /* Line 1455 of yacc.c */
2577 #line 601 "program_parse.y"
2579 (yyval
.src_reg
) = (yyvsp
[(3) - (5)].src_reg
);
2581 if (!state
->option
.NV_fragment
) {
2582 yyerror(& (yylsp
[(2) - (5)]), state
, "unexpected character '|'");
2586 if ((yyvsp
[(1) - (5)].negate
)) {
2587 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2590 (yyval
.src_reg
).Base
.Abs
= 1;
2591 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2592 (yyvsp
[(4) - (5)].swiz_mask
).swizzle
);
2598 /* Line 1455 of yacc.c */
2599 #line 621 "program_parse.y"
2601 (yyval
.dst_reg
) = (yyvsp
[(1) - (3)].dst_reg
);
2602 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (3)].swiz_mask
).mask
;
2603 (yyval
.dst_reg
).CondMask
= (yyvsp
[(3) - (3)].dst_reg
).CondMask
;
2604 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(3) - (3)].dst_reg
).CondSwizzle
;
2605 (yyval
.dst_reg
).CondSrc
= (yyvsp
[(3) - (3)].dst_reg
).CondSrc
;
2607 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2608 /* Technically speaking, this should check that it is in
2609 * vertex program mode. However, PositionInvariant can never be
2610 * set in fragment program mode, so it is somewhat irrelevant.
2612 if (state
->option
.PositionInvariant
2613 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2614 yyerror(& (yylsp
[(1) - (3)]), state
, "position-invariant programs cannot "
2619 state
->prog
->OutputsWritten
|= (1U << (yyval
.dst_reg
).Index
);
2626 /* Line 1455 of yacc.c */
2627 #line 646 "program_parse.y"
2629 init_dst_reg(& (yyval
.dst_reg
));
2630 (yyval
.dst_reg
).File
= PROGRAM_ADDRESS
;
2631 (yyval
.dst_reg
).Index
= 0;
2632 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2638 /* Line 1455 of yacc.c */
2639 #line 655 "program_parse.y"
2641 const unsigned xyzw_valid
=
2642 ((yyvsp
[(1) - (7)].ext_swizzle
).xyzw_valid
<< 0)
2643 | ((yyvsp
[(3) - (7)].ext_swizzle
).xyzw_valid
<< 1)
2644 | ((yyvsp
[(5) - (7)].ext_swizzle
).xyzw_valid
<< 2)
2645 | ((yyvsp
[(7) - (7)].ext_swizzle
).xyzw_valid
<< 3);
2646 const unsigned rgba_valid
=
2647 ((yyvsp
[(1) - (7)].ext_swizzle
).rgba_valid
<< 0)
2648 | ((yyvsp
[(3) - (7)].ext_swizzle
).rgba_valid
<< 1)
2649 | ((yyvsp
[(5) - (7)].ext_swizzle
).rgba_valid
<< 2)
2650 | ((yyvsp
[(7) - (7)].ext_swizzle
).rgba_valid
<< 3);
2652 /* All of the swizzle components have to be valid in either RGBA
2653 * or XYZW. Note that 0 and 1 are valid in both, so both masks
2654 * can have some bits set.
2656 * We somewhat deviate from the spec here. It would be really hard
2657 * to figure out which component is the error, and there probably
2658 * isn't a lot of benefit.
2660 if ((rgba_valid
!= 0x0f) && (xyzw_valid
!= 0x0f)) {
2661 yyerror(& (yylsp
[(1) - (7)]), state
, "cannot combine RGBA and XYZW swizzle "
2666 (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
);
2667 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].ext_swizzle
).negate
) | ((yyvsp
[(3) - (7)].ext_swizzle
).negate
<< 1) | ((yyvsp
[(5) - (7)].ext_swizzle
).negate
<< 2)
2668 | ((yyvsp
[(7) - (7)].ext_swizzle
).negate
<< 3);
2674 /* Line 1455 of yacc.c */
2675 #line 688 "program_parse.y"
2677 (yyval
.ext_swizzle
) = (yyvsp
[(2) - (2)].ext_swizzle
);
2678 (yyval
.ext_swizzle
).negate
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2684 /* Line 1455 of yacc.c */
2685 #line 695 "program_parse.y"
2687 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2688 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2692 (yyval
.ext_swizzle
).swz
= ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2694 /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2697 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2698 (yyval
.ext_swizzle
).rgba_valid
= 1;
2704 /* Line 1455 of yacc.c */
2705 #line 710 "program_parse.y"
2707 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2708 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2712 switch ((yyvsp
[(1) - (1)].string
)[0]) {
2714 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2715 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2718 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2719 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2722 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2723 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2726 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2727 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2731 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2732 (yyval
.ext_swizzle
).rgba_valid
= 1;
2735 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2736 (yyval
.ext_swizzle
).rgba_valid
= 1;
2739 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2740 (yyval
.ext_swizzle
).rgba_valid
= 1;
2743 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2744 (yyval
.ext_swizzle
).rgba_valid
= 1;
2748 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2757 /* Line 1455 of yacc.c */
2758 #line 760 "program_parse.y"
2760 struct asm_symbol
*const s
= (struct asm_symbol
*)
2761 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2764 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2766 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2767 && (s
->type
!= at_attrib
)) {
2768 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2770 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2771 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2775 init_src_reg(& (yyval
.src_reg
));
2778 (yyval
.src_reg
).Base
.File
= PROGRAM_TEMPORARY
;
2779 (yyval
.src_reg
).Base
.Index
= s
->temp_binding
;
2782 (yyval
.src_reg
).Base
.File
= s
->param_binding_type
;
2783 (yyval
.src_reg
).Base
.Index
= s
->param_binding_begin
;
2786 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2787 (yyval
.src_reg
).Base
.Index
= s
->attrib_binding
;
2788 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2790 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2804 /* Line 1455 of yacc.c */
2805 #line 802 "program_parse.y"
2807 init_src_reg(& (yyval
.src_reg
));
2808 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2809 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].attrib
);
2810 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2812 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2820 /* Line 1455 of yacc.c */
2821 #line 813 "program_parse.y"
2823 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2824 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2825 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2829 init_src_reg(& (yyval
.src_reg
));
2830 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2832 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2833 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2835 (yyval
.src_reg
).Base
.RelAddr
= 1;
2836 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2837 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2839 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2846 /* Line 1455 of yacc.c */
2847 #line 834 "program_parse.y"
2849 init_src_reg(& (yyval
.src_reg
));
2850 (yyval
.src_reg
).Base
.File
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2851 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2853 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
;
2859 /* Line 1455 of yacc.c */
2860 #line 844 "program_parse.y"
2862 init_dst_reg(& (yyval
.dst_reg
));
2863 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2864 (yyval
.dst_reg
).Index
= (yyvsp
[(1) - (1)].result
);
2870 /* Line 1455 of yacc.c */
2871 #line 850 "program_parse.y"
2873 struct asm_symbol
*const s
= (struct asm_symbol
*)
2874 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2877 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2879 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2880 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2884 init_dst_reg(& (yyval
.dst_reg
));
2887 (yyval
.dst_reg
).File
= PROGRAM_TEMPORARY
;
2888 (yyval
.dst_reg
).Index
= s
->temp_binding
;
2891 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2892 (yyval
.dst_reg
).Index
= s
->output_binding
;
2895 (yyval
.dst_reg
).File
= s
->param_binding_type
;
2896 (yyval
.dst_reg
).Index
= s
->param_binding_begin
;
2904 /* Line 1455 of yacc.c */
2905 #line 881 "program_parse.y"
2907 struct asm_symbol
*const s
= (struct asm_symbol
*)
2908 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2911 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2913 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2914 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2924 /* Line 1455 of yacc.c */
2925 #line 900 "program_parse.y"
2927 init_src_reg(& (yyval
.src_reg
));
2928 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2934 /* Line 1455 of yacc.c */
2935 #line 907 "program_parse.y"
2937 /* FINISHME: Add support for multiple address registers.
2939 /* FINISHME: Add support for 4-component address registers.
2941 init_src_reg(& (yyval
.src_reg
));
2942 (yyval
.src_reg
).Base
.RelAddr
= 1;
2943 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2949 /* Line 1455 of yacc.c */
2950 #line 918 "program_parse.y"
2951 { (yyval
.integer
) = 0; ;}
2956 /* Line 1455 of yacc.c */
2957 #line 919 "program_parse.y"
2958 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2963 /* Line 1455 of yacc.c */
2964 #line 920 "program_parse.y"
2965 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2970 /* Line 1455 of yacc.c */
2971 #line 924 "program_parse.y"
2973 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2975 _mesa_snprintf(s
, sizeof(s
),
2976 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2977 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2980 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2987 /* Line 1455 of yacc.c */
2988 #line 938 "program_parse.y"
2990 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2992 _mesa_snprintf(s
, sizeof(s
),
2993 "relative address offset too large (%d)", (yyvsp
[(1) - (1)].integer
));
2994 yyerror(& (yylsp
[(1) - (1)]), state
, s
);
2997 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3004 /* Line 1455 of yacc.c */
3005 #line 952 "program_parse.y"
3007 struct asm_symbol
*const s
= (struct asm_symbol
*)
3008 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
3011 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
3013 } else if (s
->type
!= at_address
) {
3014 yyerror(& (yylsp
[(1) - (1)]), state
,
3015 "invalid variable for indexed array access");
3025 /* Line 1455 of yacc.c */
3026 #line 970 "program_parse.y"
3028 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3029 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
3032 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3039 /* Line 1455 of yacc.c */
3040 #line 981 "program_parse.y"
3042 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
3043 yyerror(& (yylsp
[(1) - (1)]), state
,
3044 "address register write mask must be \".x\"");
3047 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
3054 /* Line 1455 of yacc.c */
3055 #line 997 "program_parse.y"
3056 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3061 /* Line 1455 of yacc.c */
3062 #line 1001 "program_parse.y"
3063 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
3068 /* Line 1455 of yacc.c */
3069 #line 1005 "program_parse.y"
3071 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3077 /* Line 1455 of yacc.c */
3078 #line 1009 "program_parse.y"
3080 (yyval
.dst_reg
) = (yyvsp
[(2) - (3)].dst_reg
);
3086 /* Line 1455 of yacc.c */
3087 #line 1013 "program_parse.y"
3089 (yyval
.dst_reg
).CondMask
= COND_TR
;
3090 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3091 (yyval
.dst_reg
).CondSrc
= 0;
3097 /* Line 1455 of yacc.c */
3098 #line 1021 "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 1028 "program_parse.y"
3110 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
3111 (yyval
.dst_reg
).CondSwizzle
= (yyvsp
[(2) - (2)].swiz_mask
).swizzle
;
3117 /* Line 1455 of yacc.c */
3118 #line 1035 "program_parse.y"
3120 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3121 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3122 char *const err_str
=
3123 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3125 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3126 ? err_str
: "invalid condition code");
3128 if (err_str
!= NULL
) {
3129 _mesa_free(err_str
);
3135 (yyval
.dst_reg
).CondMask
= cond
;
3136 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3137 (yyval
.dst_reg
).CondSrc
= 0;
3143 /* Line 1455 of yacc.c */
3144 #line 1058 "program_parse.y"
3146 const int cond
= _mesa_parse_cc((yyvsp
[(1) - (1)].string
));
3147 if ((cond
== 0) || ((yyvsp
[(1) - (1)].string
)[2] != '\0')) {
3148 char *const err_str
=
3149 make_error_string("invalid condition code \"%s\"", (yyvsp
[(1) - (1)].string
));
3151 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
3152 ? err_str
: "invalid condition code");
3154 if (err_str
!= NULL
) {
3155 _mesa_free(err_str
);
3161 (yyval
.dst_reg
).CondMask
= cond
;
3162 (yyval
.dst_reg
).CondSwizzle
= SWIZZLE_NOOP
;
3163 (yyval
.dst_reg
).CondSrc
= 0;
3169 /* Line 1455 of yacc.c */
3170 #line 1089 "program_parse.y"
3172 struct asm_symbol
*const s
=
3173 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
3178 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
3179 state
->InputsBound
|= (1U << s
->attrib_binding
);
3181 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
3190 /* Line 1455 of yacc.c */
3191 #line 1107 "program_parse.y"
3193 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3199 /* Line 1455 of yacc.c */
3200 #line 1111 "program_parse.y"
3202 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
3208 /* Line 1455 of yacc.c */
3209 #line 1117 "program_parse.y"
3211 (yyval
.attrib
) = VERT_ATTRIB_POS
;
3217 /* Line 1455 of yacc.c */
3218 #line 1121 "program_parse.y"
3220 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
3226 /* Line 1455 of yacc.c */
3227 #line 1125 "program_parse.y"
3229 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
3235 /* Line 1455 of yacc.c */
3236 #line 1129 "program_parse.y"
3238 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
3239 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
3243 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
3249 /* Line 1455 of yacc.c */
3250 #line 1138 "program_parse.y"
3252 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
3253 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
3257 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
3263 /* Line 1455 of yacc.c */
3264 #line 1147 "program_parse.y"
3266 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3272 /* Line 1455 of yacc.c */
3273 #line 1151 "program_parse.y"
3275 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3282 /* Line 1455 of yacc.c */
3283 #line 1156 "program_parse.y"
3285 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
3291 /* Line 1455 of yacc.c */
3292 #line 1162 "program_parse.y"
3294 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
3295 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
3299 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3305 /* Line 1455 of yacc.c */
3306 #line 1176 "program_parse.y"
3308 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
3314 /* Line 1455 of yacc.c */
3315 #line 1180 "program_parse.y"
3317 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
3323 /* Line 1455 of yacc.c */
3324 #line 1184 "program_parse.y"
3326 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
3332 /* Line 1455 of yacc.c */
3333 #line 1188 "program_parse.y"
3335 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3341 /* Line 1455 of yacc.c */
3342 #line 1196 "program_parse.y"
3344 struct asm_symbol
*const s
=
3345 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
3350 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
3351 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
3352 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3353 s
->param_is_array
= 0;
3360 /* Line 1455 of yacc.c */
3361 #line 1212 "program_parse.y"
3363 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
3364 yyerror(& (yylsp
[(4) - (6)]), state
,
3365 "parameter array size and number of bindings must match");
3368 struct asm_symbol
*const s
=
3369 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
3374 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
3375 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
3376 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
3377 s
->param_is_array
= 1;
3385 /* Line 1455 of yacc.c */
3386 #line 1234 "program_parse.y"
3388 (yyval
.integer
) = 0;
3394 /* Line 1455 of yacc.c */
3395 #line 1238 "program_parse.y"
3397 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxParameters
)) {
3398 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
3401 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3408 /* Line 1455 of yacc.c */
3409 #line 1249 "program_parse.y"
3411 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
3417 /* Line 1455 of yacc.c */
3418 #line 1255 "program_parse.y"
3420 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
3426 /* Line 1455 of yacc.c */
3427 #line 1262 "program_parse.y"
3429 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3430 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
3436 /* Line 1455 of yacc.c */
3437 #line 1269 "program_parse.y"
3439 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3440 (yyval
.temp_sym
).param_binding_begin
= ~0;
3441 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3447 /* Line 1455 of yacc.c */
3448 #line 1275 "program_parse.y"
3450 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3451 (yyval
.temp_sym
).param_binding_begin
= ~0;
3452 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3458 /* Line 1455 of yacc.c */
3459 #line 1281 "program_parse.y"
3461 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3462 (yyval
.temp_sym
).param_binding_begin
= ~0;
3463 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3469 /* Line 1455 of yacc.c */
3470 #line 1289 "program_parse.y"
3472 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3473 (yyval
.temp_sym
).param_binding_begin
= ~0;
3474 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3480 /* Line 1455 of yacc.c */
3481 #line 1295 "program_parse.y"
3483 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3484 (yyval
.temp_sym
).param_binding_begin
= ~0;
3485 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3491 /* Line 1455 of yacc.c */
3492 #line 1301 "program_parse.y"
3494 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3495 (yyval
.temp_sym
).param_binding_begin
= ~0;
3496 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3502 /* Line 1455 of yacc.c */
3503 #line 1309 "program_parse.y"
3505 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3506 (yyval
.temp_sym
).param_binding_begin
= ~0;
3507 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3513 /* Line 1455 of yacc.c */
3514 #line 1315 "program_parse.y"
3516 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3517 (yyval
.temp_sym
).param_binding_begin
= ~0;
3518 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3524 /* Line 1455 of yacc.c */
3525 #line 1321 "program_parse.y"
3527 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3528 (yyval
.temp_sym
).param_binding_begin
= ~0;
3529 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3535 /* Line 1455 of yacc.c */
3536 #line 1328 "program_parse.y"
3537 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3542 /* Line 1455 of yacc.c */
3543 #line 1329 "program_parse.y"
3544 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3549 /* Line 1455 of yacc.c */
3550 #line 1332 "program_parse.y"
3551 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3556 /* Line 1455 of yacc.c */
3557 #line 1333 "program_parse.y"
3558 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3563 /* Line 1455 of yacc.c */
3564 #line 1334 "program_parse.y"
3565 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3570 /* Line 1455 of yacc.c */
3571 #line 1335 "program_parse.y"
3572 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3577 /* Line 1455 of yacc.c */
3578 #line 1336 "program_parse.y"
3579 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3584 /* Line 1455 of yacc.c */
3585 #line 1337 "program_parse.y"
3586 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3591 /* Line 1455 of yacc.c */
3592 #line 1338 "program_parse.y"
3593 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3598 /* Line 1455 of yacc.c */
3599 #line 1339 "program_parse.y"
3600 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3605 /* Line 1455 of yacc.c */
3606 #line 1340 "program_parse.y"
3607 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3612 /* Line 1455 of yacc.c */
3613 #line 1341 "program_parse.y"
3614 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3619 /* Line 1455 of yacc.c */
3620 #line 1342 "program_parse.y"
3621 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3626 /* Line 1455 of yacc.c */
3627 #line 1346 "program_parse.y"
3629 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3630 (yyval
.state
)[0] = STATE_MATERIAL
;
3631 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3632 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3638 /* Line 1455 of yacc.c */
3639 #line 1355 "program_parse.y"
3641 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3647 /* Line 1455 of yacc.c */
3648 #line 1359 "program_parse.y"
3650 (yyval
.integer
) = STATE_EMISSION
;
3656 /* Line 1455 of yacc.c */
3657 #line 1363 "program_parse.y"
3659 (yyval
.integer
) = STATE_SHININESS
;
3665 /* Line 1455 of yacc.c */
3666 #line 1369 "program_parse.y"
3668 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3669 (yyval
.state
)[0] = STATE_LIGHT
;
3670 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3671 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3677 /* Line 1455 of yacc.c */
3678 #line 1378 "program_parse.y"
3680 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3686 /* Line 1455 of yacc.c */
3687 #line 1382 "program_parse.y"
3689 (yyval
.integer
) = STATE_POSITION
;
3695 /* Line 1455 of yacc.c */
3696 #line 1386 "program_parse.y"
3698 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3699 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3703 (yyval
.integer
) = STATE_ATTENUATION
;
3709 /* Line 1455 of yacc.c */
3710 #line 1395 "program_parse.y"
3712 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3718 /* Line 1455 of yacc.c */
3719 #line 1399 "program_parse.y"
3721 (yyval
.integer
) = STATE_HALF_VECTOR
;
3727 /* Line 1455 of yacc.c */
3728 #line 1405 "program_parse.y"
3730 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3736 /* Line 1455 of yacc.c */
3737 #line 1411 "program_parse.y"
3739 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3740 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3746 /* Line 1455 of yacc.c */
3747 #line 1418 "program_parse.y"
3749 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3750 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3756 /* Line 1455 of yacc.c */
3757 #line 1423 "program_parse.y"
3759 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3760 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3761 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3767 /* Line 1455 of yacc.c */
3768 #line 1431 "program_parse.y"
3770 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3771 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3772 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3773 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3774 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3780 /* Line 1455 of yacc.c */
3781 #line 1443 "program_parse.y"
3783 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3784 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3785 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3791 /* Line 1455 of yacc.c */
3792 #line 1451 "program_parse.y"
3794 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3800 /* Line 1455 of yacc.c */
3801 #line 1457 "program_parse.y"
3803 (yyval
.integer
) = STATE_AMBIENT
;
3809 /* Line 1455 of yacc.c */
3810 #line 1461 "program_parse.y"
3812 (yyval
.integer
) = STATE_DIFFUSE
;
3818 /* Line 1455 of yacc.c */
3819 #line 1465 "program_parse.y"
3821 (yyval
.integer
) = STATE_SPECULAR
;
3827 /* Line 1455 of yacc.c */
3828 #line 1471 "program_parse.y"
3830 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3831 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3835 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3841 /* Line 1455 of yacc.c */
3842 #line 1482 "program_parse.y"
3844 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3845 (yyval
.state
)[0] = STATE_TEXGEN
;
3846 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3847 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3853 /* Line 1455 of yacc.c */
3854 #line 1491 "program_parse.y"
3856 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3862 /* Line 1455 of yacc.c */
3863 #line 1495 "program_parse.y"
3865 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3871 /* Line 1455 of yacc.c */
3872 #line 1500 "program_parse.y"
3874 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3880 /* Line 1455 of yacc.c */
3881 #line 1504 "program_parse.y"
3883 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3889 /* Line 1455 of yacc.c */
3890 #line 1508 "program_parse.y"
3892 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3898 /* Line 1455 of yacc.c */
3899 #line 1512 "program_parse.y"
3901 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3907 /* Line 1455 of yacc.c */
3908 #line 1518 "program_parse.y"
3910 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3911 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3917 /* Line 1455 of yacc.c */
3918 #line 1525 "program_parse.y"
3920 (yyval
.integer
) = STATE_FOG_COLOR
;
3926 /* Line 1455 of yacc.c */
3927 #line 1529 "program_parse.y"
3929 (yyval
.integer
) = STATE_FOG_PARAMS
;
3935 /* Line 1455 of yacc.c */
3936 #line 1535 "program_parse.y"
3938 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3939 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3940 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3946 /* Line 1455 of yacc.c */
3947 #line 1543 "program_parse.y"
3949 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3950 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3954 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3960 /* Line 1455 of yacc.c */
3961 #line 1554 "program_parse.y"
3963 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3964 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3970 /* Line 1455 of yacc.c */
3971 #line 1561 "program_parse.y"
3973 (yyval
.integer
) = STATE_POINT_SIZE
;
3979 /* Line 1455 of yacc.c */
3980 #line 1565 "program_parse.y"
3982 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3988 /* Line 1455 of yacc.c */
3989 #line 1571 "program_parse.y"
3991 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
3992 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
3993 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3994 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3995 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
4001 /* Line 1455 of yacc.c */
4002 #line 1581 "program_parse.y"
4004 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
4005 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
4006 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
4007 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
4008 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
4014 /* Line 1455 of yacc.c */
4015 #line 1591 "program_parse.y"
4017 (yyval
.state
)[2] = 0;
4018 (yyval
.state
)[3] = 3;
4024 /* Line 1455 of yacc.c */
4025 #line 1596 "program_parse.y"
4027 /* It seems logical that the matrix row range specifier would have
4028 * to specify a range or more than one row (i.e., $5 > $3).
4029 * However, the ARB_vertex_program spec says "a program will fail
4030 * to load if <a> is greater than <b>." This means that $3 == $5
4033 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
4034 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
4038 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
4039 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
4045 /* Line 1455 of yacc.c */
4046 #line 1614 "program_parse.y"
4048 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
4049 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
4050 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
4056 /* Line 1455 of yacc.c */
4057 #line 1622 "program_parse.y"
4059 (yyval
.integer
) = 0;
4065 /* Line 1455 of yacc.c */
4066 #line 1626 "program_parse.y"
4068 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4074 /* Line 1455 of yacc.c */
4075 #line 1632 "program_parse.y"
4077 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
4083 /* Line 1455 of yacc.c */
4084 #line 1636 "program_parse.y"
4086 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
4092 /* Line 1455 of yacc.c */
4093 #line 1640 "program_parse.y"
4095 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
4101 /* Line 1455 of yacc.c */
4102 #line 1646 "program_parse.y"
4104 if ((yyvsp
[(1) - (1)].integer
) > 3) {
4105 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
4109 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4115 /* Line 1455 of yacc.c */
4116 #line 1657 "program_parse.y"
4118 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
4119 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4125 /* Line 1455 of yacc.c */
4126 #line 1662 "program_parse.y"
4128 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
4129 (yyval
.state
)[1] = 0;
4135 /* Line 1455 of yacc.c */
4136 #line 1667 "program_parse.y"
4138 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
4139 (yyval
.state
)[1] = 0;
4145 /* Line 1455 of yacc.c */
4146 #line 1672 "program_parse.y"
4148 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
4149 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
4155 /* Line 1455 of yacc.c */
4156 #line 1677 "program_parse.y"
4158 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
4165 /* Line 1455 of yacc.c */
4166 #line 1682 "program_parse.y"
4168 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
4169 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
4175 /* Line 1455 of yacc.c */
4176 #line 1689 "program_parse.y"
4178 (yyval
.integer
) = 0;
4184 /* Line 1455 of yacc.c */
4185 #line 1693 "program_parse.y"
4187 (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
);
4193 /* Line 1455 of yacc.c */
4194 #line 1698 "program_parse.y"
4196 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
4199 if ((yyvsp
[(1) - (1)].integer
) != 0) {
4200 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
4204 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4210 /* Line 1455 of yacc.c */
4211 #line 1711 "program_parse.y"
4213 /* Since GL_ARB_matrix_palette isn't supported, just let any value
4214 * through here. The error will be generated later.
4216 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4222 /* Line 1455 of yacc.c */
4223 #line 1719 "program_parse.y"
4225 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
4226 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
4230 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4236 /* Line 1455 of yacc.c */
4237 #line 1730 "program_parse.y"
4239 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4240 (yyval
.state
)[0] = STATE_DEPTH_RANGE
;
4246 /* Line 1455 of yacc.c */
4247 #line 1742 "program_parse.y"
4249 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4250 (yyval
.state
)[0] = state
->state_param_enum
;
4251 (yyval
.state
)[1] = STATE_ENV
;
4252 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4253 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4259 /* Line 1455 of yacc.c */
4260 #line 1752 "program_parse.y"
4262 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4263 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4269 /* Line 1455 of yacc.c */
4270 #line 1757 "program_parse.y"
4272 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4273 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4279 /* Line 1455 of yacc.c */
4280 #line 1764 "program_parse.y"
4282 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4283 (yyval
.state
)[0] = state
->state_param_enum
;
4284 (yyval
.state
)[1] = STATE_ENV
;
4285 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4286 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4292 /* Line 1455 of yacc.c */
4293 #line 1774 "program_parse.y"
4295 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4296 (yyval
.state
)[0] = state
->state_param_enum
;
4297 (yyval
.state
)[1] = STATE_LOCAL
;
4298 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4299 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4305 /* Line 1455 of yacc.c */
4306 #line 1783 "program_parse.y"
4308 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4309 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4315 /* Line 1455 of yacc.c */
4316 #line 1788 "program_parse.y"
4318 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4319 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4325 /* Line 1455 of yacc.c */
4326 #line 1795 "program_parse.y"
4328 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4329 (yyval
.state
)[0] = state
->state_param_enum
;
4330 (yyval
.state
)[1] = STATE_LOCAL
;
4331 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4332 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4338 /* Line 1455 of yacc.c */
4339 #line 1805 "program_parse.y"
4341 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
4342 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
4345 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4351 /* Line 1455 of yacc.c */
4352 #line 1815 "program_parse.y"
4354 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
4355 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
4358 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4364 /* Line 1455 of yacc.c */
4365 #line 1830 "program_parse.y"
4367 (yyval
.vector
).count
= 4;
4368 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4369 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4370 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4371 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4377 /* Line 1455 of yacc.c */
4378 #line 1840 "program_parse.y"
4380 (yyval
.vector
).count
= 1;
4381 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4382 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4383 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4384 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4390 /* Line 1455 of yacc.c */
4391 #line 1848 "program_parse.y"
4393 (yyval
.vector
).count
= 1;
4394 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
4395 (yyval
.vector
).data
[1] = (float) (yyvsp
[(1) - (1)].integer
);
4396 (yyval
.vector
).data
[2] = (float) (yyvsp
[(1) - (1)].integer
);
4397 (yyval
.vector
).data
[3] = (float) (yyvsp
[(1) - (1)].integer
);
4403 /* Line 1455 of yacc.c */
4404 #line 1858 "program_parse.y"
4406 (yyval
.vector
).count
= 4;
4407 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
4408 (yyval
.vector
).data
[1] = 0.0f
;
4409 (yyval
.vector
).data
[2] = 0.0f
;
4410 (yyval
.vector
).data
[3] = 1.0f
;
4416 /* Line 1455 of yacc.c */
4417 #line 1866 "program_parse.y"
4419 (yyval
.vector
).count
= 4;
4420 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
4421 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
4422 (yyval
.vector
).data
[2] = 0.0f
;
4423 (yyval
.vector
).data
[3] = 1.0f
;
4429 /* Line 1455 of yacc.c */
4430 #line 1875 "program_parse.y"
4432 (yyval
.vector
).count
= 4;
4433 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
4434 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
4435 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
4436 (yyval
.vector
).data
[3] = 1.0f
;
4442 /* Line 1455 of yacc.c */
4443 #line 1884 "program_parse.y"
4445 (yyval
.vector
).count
= 4;
4446 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
4447 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
4448 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
4449 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
4455 /* Line 1455 of yacc.c */
4456 #line 1894 "program_parse.y"
4458 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
4464 /* Line 1455 of yacc.c */
4465 #line 1898 "program_parse.y"
4467 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
4473 /* Line 1455 of yacc.c */
4474 #line 1903 "program_parse.y"
4475 { (yyval
.negate
) = FALSE
; ;}
4480 /* Line 1455 of yacc.c */
4481 #line 1904 "program_parse.y"
4482 { (yyval
.negate
) = TRUE
; ;}
4487 /* Line 1455 of yacc.c */
4488 #line 1905 "program_parse.y"
4489 { (yyval
.negate
) = FALSE
; ;}
4494 /* Line 1455 of yacc.c */
4495 #line 1908 "program_parse.y"
4496 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
4501 /* Line 1455 of yacc.c */
4502 #line 1912 "program_parse.y"
4504 /* NV_fragment_program_option defines the size qualifiers in a
4505 * fairly broken way. "SHORT" or "LONG" can optionally be used
4506 * before TEMP or OUTPUT. However, neither is a reserved word!
4507 * This means that we have to parse it as an identifier, then check
4508 * to make sure it's one of the valid values. *sigh*
4510 * In addition, the grammar in the extension spec does *not* allow
4511 * the size specifier to be optional, but all known implementations
4514 if (!state
->option
.NV_fragment
) {
4515 yyerror(& (yylsp
[(1) - (1)]), state
, "unexpected IDENTIFIER");
4519 if (strcmp("SHORT", (yyvsp
[(1) - (1)].string
)) == 0) {
4520 } else if (strcmp("LONG", (yyvsp
[(1) - (1)].string
)) == 0) {
4522 char *const err_str
=
4523 make_error_string("invalid storage size specifier \"%s\"",
4524 (yyvsp
[(1) - (1)].string
));
4526 yyerror(& (yylsp
[(1) - (1)]), state
, (err_str
!= NULL
)
4527 ? err_str
: "invalid storage size specifier");
4529 if (err_str
!= NULL
) {
4530 _mesa_free(err_str
);
4540 /* Line 1455 of yacc.c */
4541 #line 1946 "program_parse.y"
4548 /* Line 1455 of yacc.c */
4549 #line 1950 "program_parse.y"
4550 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4555 /* Line 1455 of yacc.c */
4556 #line 1954 "program_parse.y"
4558 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4566 /* Line 1455 of yacc.c */
4567 #line 1960 "program_parse.y"
4569 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4577 /* Line 1455 of yacc.c */
4578 #line 1968 "program_parse.y"
4580 struct asm_symbol
*const s
=
4581 declare_variable(state
, (yyvsp
[(3) - (5)].string
), at_output
, & (yylsp
[(3) - (5)]));
4586 s
->output_binding
= (yyvsp
[(5) - (5)].result
);
4593 /* Line 1455 of yacc.c */
4594 #line 1981 "program_parse.y"
4596 if (state
->mode
== ARB_vertex
) {
4597 (yyval
.result
) = VERT_RESULT_HPOS
;
4599 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4607 /* Line 1455 of yacc.c */
4608 #line 1990 "program_parse.y"
4610 if (state
->mode
== ARB_vertex
) {
4611 (yyval
.result
) = VERT_RESULT_FOGC
;
4613 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4621 /* Line 1455 of yacc.c */
4622 #line 1999 "program_parse.y"
4624 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4630 /* Line 1455 of yacc.c */
4631 #line 2003 "program_parse.y"
4633 if (state
->mode
== ARB_vertex
) {
4634 (yyval
.result
) = VERT_RESULT_PSIZ
;
4636 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4644 /* Line 1455 of yacc.c */
4645 #line 2012 "program_parse.y"
4647 if (state
->mode
== ARB_vertex
) {
4648 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4650 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4658 /* Line 1455 of yacc.c */
4659 #line 2021 "program_parse.y"
4661 if (state
->mode
== ARB_fragment
) {
4662 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4664 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4672 /* Line 1455 of yacc.c */
4673 #line 2032 "program_parse.y"
4675 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4681 /* Line 1455 of yacc.c */
4682 #line 2038 "program_parse.y"
4684 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4686 : FRAG_RESULT_COLOR
;
4692 /* Line 1455 of yacc.c */
4693 #line 2044 "program_parse.y"
4695 if (state
->mode
== ARB_vertex
) {
4696 (yyval
.integer
) = VERT_RESULT_COL0
;
4698 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4706 /* Line 1455 of yacc.c */
4707 #line 2053 "program_parse.y"
4709 if (state
->mode
== ARB_vertex
) {
4710 (yyval
.integer
) = VERT_RESULT_BFC0
;
4712 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4720 /* Line 1455 of yacc.c */
4721 #line 2064 "program_parse.y"
4723 (yyval
.integer
) = 0;
4729 /* Line 1455 of yacc.c */
4730 #line 2068 "program_parse.y"
4732 if (state
->mode
== ARB_vertex
) {
4733 (yyval
.integer
) = 0;
4735 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4743 /* Line 1455 of yacc.c */
4744 #line 2077 "program_parse.y"
4746 if (state
->mode
== ARB_vertex
) {
4747 (yyval
.integer
) = 1;
4749 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4757 /* Line 1455 of yacc.c */
4758 #line 2087 "program_parse.y"
4759 { (yyval
.integer
) = 0; ;}
4764 /* Line 1455 of yacc.c */
4765 #line 2088 "program_parse.y"
4766 { (yyval
.integer
) = 0; ;}
4771 /* Line 1455 of yacc.c */
4772 #line 2089 "program_parse.y"
4773 { (yyval
.integer
) = 1; ;}
4778 /* Line 1455 of yacc.c */
4779 #line 2092 "program_parse.y"
4780 { (yyval
.integer
) = 0; ;}
4785 /* Line 1455 of yacc.c */
4786 #line 2093 "program_parse.y"
4787 { (yyval
.integer
) = 0; ;}
4792 /* Line 1455 of yacc.c */
4793 #line 2094 "program_parse.y"
4794 { (yyval
.integer
) = 1; ;}
4799 /* Line 1455 of yacc.c */
4800 #line 2097 "program_parse.y"
4801 { (yyval
.integer
) = 0; ;}
4806 /* Line 1455 of yacc.c */
4807 #line 2098 "program_parse.y"
4808 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4813 /* Line 1455 of yacc.c */
4814 #line 2101 "program_parse.y"
4815 { (yyval
.integer
) = 0; ;}
4820 /* Line 1455 of yacc.c */
4821 #line 2102 "program_parse.y"
4822 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4827 /* Line 1455 of yacc.c */
4828 #line 2105 "program_parse.y"
4829 { (yyval
.integer
) = 0; ;}
4834 /* Line 1455 of yacc.c */
4835 #line 2106 "program_parse.y"
4836 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4841 /* Line 1455 of yacc.c */
4842 #line 2110 "program_parse.y"
4844 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4845 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4849 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4855 /* Line 1455 of yacc.c */
4856 #line 2121 "program_parse.y"
4858 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4859 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4863 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4869 /* Line 1455 of yacc.c */
4870 #line 2132 "program_parse.y"
4872 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4873 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4877 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4883 /* Line 1455 of yacc.c */
4884 #line 2143 "program_parse.y"
4886 struct asm_symbol
*exist
= (struct asm_symbol
*)
4887 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4888 struct asm_symbol
*target
= (struct asm_symbol
*)
4889 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4892 if (exist
!= NULL
) {
4893 yyerror(& (yylsp
[(2) - (4)]), state
, "redeclared identifier");
4895 } else if (target
== NULL
) {
4896 yyerror(& (yylsp
[(4) - (4)]), state
,
4897 "undefined variable binding in ALIAS statement");
4900 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4907 /* Line 1455 of yacc.c */
4908 #line 4909 "program_parse.tab.c"
4911 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4915 YY_STACK_PRINT (yyss
, yyssp
);
4920 /* Now `shift' the result of the reduction. Determine what state
4921 that goes to, based on the state we popped back to and the rule
4922 number reduced by. */
4926 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4927 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4928 yystate
= yytable
[yystate
];
4930 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4935 /*------------------------------------.
4936 | yyerrlab -- here on detecting error |
4937 `------------------------------------*/
4939 /* If not already recovering from an error, report this error. */
4943 #if ! YYERROR_VERBOSE
4944 yyerror (&yylloc
, state
, YY_("syntax error"));
4947 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4948 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4950 YYSIZE_T yyalloc
= 2 * yysize
;
4951 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4952 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4953 if (yymsg
!= yymsgbuf
)
4954 YYSTACK_FREE (yymsg
);
4955 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4957 yymsg_alloc
= yyalloc
;
4961 yymsg_alloc
= sizeof yymsgbuf
;
4965 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4967 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4968 yyerror (&yylloc
, state
, yymsg
);
4972 yyerror (&yylloc
, state
, YY_("syntax error"));
4974 goto yyexhaustedlab
;
4980 yyerror_range
[0] = yylloc
;
4982 if (yyerrstatus
== 3)
4984 /* If just tried and failed to reuse lookahead token after an
4985 error, discard it. */
4987 if (yychar
<= YYEOF
)
4989 /* Return failure if at end of input. */
4990 if (yychar
== YYEOF
)
4995 yydestruct ("Error: discarding",
4996 yytoken
, &yylval
, &yylloc
, state
);
5001 /* Else will try to reuse lookahead token after shifting the error
5006 /*---------------------------------------------------.
5007 | yyerrorlab -- error raised explicitly by YYERROR. |
5008 `---------------------------------------------------*/
5011 /* Pacify compilers like GCC when the user code never invokes
5012 YYERROR and the label yyerrorlab therefore never appears in user
5014 if (/*CONSTCOND*/ 0)
5017 yyerror_range
[0] = yylsp
[1-yylen
];
5018 /* Do not reclaim the symbols of the rule which action triggered
5022 YY_STACK_PRINT (yyss
, yyssp
);
5027 /*-------------------------------------------------------------.
5028 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5029 `-------------------------------------------------------------*/
5031 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5035 yyn
= yypact
[yystate
];
5036 if (yyn
!= YYPACT_NINF
)
5039 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5047 /* Pop the current state because it cannot handle the error token. */
5051 yyerror_range
[0] = *yylsp
;
5052 yydestruct ("Error: popping",
5053 yystos
[yystate
], yyvsp
, yylsp
, state
);
5056 YY_STACK_PRINT (yyss
, yyssp
);
5061 yyerror_range
[1] = yylloc
;
5062 /* Using YYLLOC is tempting, but would change the location of
5063 the lookahead. YYLOC is available though. */
5064 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
5067 /* Shift the error token. */
5068 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5074 /*-------------------------------------.
5075 | yyacceptlab -- YYACCEPT comes here. |
5076 `-------------------------------------*/
5081 /*-----------------------------------.
5082 | yyabortlab -- YYABORT comes here. |
5083 `-----------------------------------*/
5088 #if !defined(yyoverflow) || YYERROR_VERBOSE
5089 /*-------------------------------------------------.
5090 | yyexhaustedlab -- memory exhaustion comes here. |
5091 `-------------------------------------------------*/
5093 yyerror (&yylloc
, state
, YY_("memory exhausted"));
5099 if (yychar
!= YYEMPTY
)
5100 yydestruct ("Cleanup: discarding lookahead",
5101 yytoken
, &yylval
, &yylloc
, state
);
5102 /* Do not reclaim the symbols of the rule which action triggered
5103 this YYABORT or YYACCEPT. */
5105 YY_STACK_PRINT (yyss
, yyssp
);
5106 while (yyssp
!= yyss
)
5108 yydestruct ("Cleanup: popping",
5109 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
5114 YYSTACK_FREE (yyss
);
5117 if (yymsg
!= yymsgbuf
)
5118 YYSTACK_FREE (yymsg
);
5120 /* Make sure YYID is used. */
5121 return YYID (yyresult
);
5126 /* Line 1675 of yacc.c */
5127 #line 2167 "program_parse.y"
5131 asm_instruction_set_operands(struct asm_instruction
*inst
,
5132 const struct prog_dst_register
*dst
,
5133 const struct asm_src_register
*src0
,
5134 const struct asm_src_register
*src1
,
5135 const struct asm_src_register
*src2
)
5137 /* In the core ARB extensions only the KIL instruction doesn't have a
5138 * destination register.
5141 init_dst_reg(& inst
->Base
.DstReg
);
5143 inst
->Base
.DstReg
= *dst
;
5146 /* The only instruction that doesn't have any source registers is the
5147 * condition-code based KIL instruction added by NV_fragment_program_option.
5150 inst
->Base
.SrcReg
[0] = src0
->Base
;
5151 inst
->SrcReg
[0] = *src0
;
5153 init_src_reg(& inst
->SrcReg
[0]);
5157 inst
->Base
.SrcReg
[1] = src1
->Base
;
5158 inst
->SrcReg
[1] = *src1
;
5160 init_src_reg(& inst
->SrcReg
[1]);
5164 inst
->Base
.SrcReg
[2] = src2
->Base
;
5165 inst
->SrcReg
[2] = *src2
;
5167 init_src_reg(& inst
->SrcReg
[2]);
5172 struct asm_instruction
*
5173 asm_instruction_ctor(gl_inst_opcode op
,
5174 const struct prog_dst_register
*dst
,
5175 const struct asm_src_register
*src0
,
5176 const struct asm_src_register
*src1
,
5177 const struct asm_src_register
*src2
)
5179 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5182 _mesa_init_instructions(& inst
->Base
, 1);
5183 inst
->Base
.Opcode
= op
;
5185 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5192 struct asm_instruction
*
5193 asm_instruction_copy_ctor(const struct prog_instruction
*base
,
5194 const struct prog_dst_register
*dst
,
5195 const struct asm_src_register
*src0
,
5196 const struct asm_src_register
*src1
,
5197 const struct asm_src_register
*src2
)
5199 struct asm_instruction
*inst
= CALLOC_STRUCT(asm_instruction
);
5202 _mesa_init_instructions(& inst
->Base
, 1);
5203 inst
->Base
.Opcode
= base
->Opcode
;
5204 inst
->Base
.CondUpdate
= base
->CondUpdate
;
5205 inst
->Base
.CondDst
= base
->CondDst
;
5206 inst
->Base
.SaturateMode
= base
->SaturateMode
;
5207 inst
->Base
.Precision
= base
->Precision
;
5209 asm_instruction_set_operands(inst
, dst
, src0
, src1
, src2
);
5217 init_dst_reg(struct prog_dst_register
*r
)
5219 memset(r
, 0, sizeof(*r
));
5220 r
->File
= PROGRAM_UNDEFINED
;
5221 r
->WriteMask
= WRITEMASK_XYZW
;
5222 r
->CondMask
= COND_TR
;
5223 r
->CondSwizzle
= SWIZZLE_NOOP
;
5228 init_src_reg(struct asm_src_register
*r
)
5230 memset(r
, 0, sizeof(*r
));
5231 r
->Base
.File
= PROGRAM_UNDEFINED
;
5232 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
5238 * Validate the set of inputs used by a program
5240 * Validates that legal sets of inputs are used by the program. In this case
5241 * "used" included both reading the input or binding the input to a name using
5242 * the \c ATTRIB command.
5245 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
5248 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
5250 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
5252 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
5253 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
5262 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
5263 struct YYLTYPE
*locp
)
5265 struct asm_symbol
*s
= NULL
;
5266 struct asm_symbol
*exist
= (struct asm_symbol
*)
5267 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
5270 if (exist
!= NULL
) {
5271 yyerror(locp
, state
, "redeclared identifier");
5273 s
= calloc(1, sizeof(struct asm_symbol
));
5279 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
5280 yyerror(locp
, state
, "too many temporaries declared");
5285 s
->temp_binding
= state
->prog
->NumTemporaries
;
5286 state
->prog
->NumTemporaries
++;
5290 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
5291 yyerror(locp
, state
, "too many address registers declared");
5296 /* FINISHME: Add support for multiple address registers.
5298 state
->prog
->NumAddressRegs
++;
5305 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
5306 s
->next
= state
->sym
;
5314 int add_state_reference(struct gl_program_parameter_list
*param_list
,
5315 const gl_state_index tokens
[STATE_LENGTH
])
5317 const GLuint size
= 4; /* XXX fix */
5321 name
= _mesa_program_state_string(tokens
);
5322 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
5323 size
, GL_NONE
, NULL
, tokens
, 0x0);
5324 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
5326 /* free name string here since we duplicated it in add_parameter() */
5334 initialize_symbol_from_state(struct gl_program
*prog
,
5335 struct asm_symbol
*param_var
,
5336 const gl_state_index tokens
[STATE_LENGTH
])
5339 gl_state_index state_tokens
[STATE_LENGTH
];
5342 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5344 param_var
->type
= at_param
;
5345 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
5347 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
5348 * unroll it and call add_state_reference() for each row
5350 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
5351 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
5352 state_tokens
[0] == STATE_MVP_MATRIX
||
5353 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
5354 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
5355 && (state_tokens
[2] != state_tokens
[3])) {
5357 const int first_row
= state_tokens
[2];
5358 const int last_row
= state_tokens
[3];
5360 for (row
= first_row
; row
<= last_row
; row
++) {
5361 state_tokens
[2] = state_tokens
[3] = row
;
5363 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5364 if (param_var
->param_binding_begin
== ~0U)
5365 param_var
->param_binding_begin
= idx
;
5366 param_var
->param_binding_length
++;
5370 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5371 if (param_var
->param_binding_begin
== ~0U)
5372 param_var
->param_binding_begin
= idx
;
5373 param_var
->param_binding_length
++;
5381 initialize_symbol_from_param(struct gl_program
*prog
,
5382 struct asm_symbol
*param_var
,
5383 const gl_state_index tokens
[STATE_LENGTH
])
5386 gl_state_index state_tokens
[STATE_LENGTH
];
5389 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5391 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
5392 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
5393 assert((state_tokens
[1] == STATE_ENV
)
5394 || (state_tokens
[1] == STATE_LOCAL
));
5396 param_var
->type
= at_param
;
5397 param_var
->param_binding_type
= (state_tokens
[1] == STATE_ENV
)
5398 ? PROGRAM_ENV_PARAM
: PROGRAM_LOCAL_PARAM
;
5400 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5401 * we need to unroll it and call add_state_reference() for each row
5403 if (state_tokens
[2] != state_tokens
[3]) {
5405 const int first_row
= state_tokens
[2];
5406 const int last_row
= state_tokens
[3];
5408 for (row
= first_row
; row
<= last_row
; row
++) {
5409 state_tokens
[2] = state_tokens
[3] = row
;
5411 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5412 if (param_var
->param_binding_begin
== ~0U)
5413 param_var
->param_binding_begin
= idx
;
5414 param_var
->param_binding_length
++;
5418 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5419 if (param_var
->param_binding_begin
== ~0U)
5420 param_var
->param_binding_begin
= idx
;
5421 param_var
->param_binding_length
++;
5429 initialize_symbol_from_const(struct gl_program
*prog
,
5430 struct asm_symbol
*param_var
,
5431 const struct asm_vector
*vec
)
5433 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
5434 NULL
, vec
->count
, GL_NONE
, vec
->data
,
5437 param_var
->type
= at_param
;
5438 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
5440 if (param_var
->param_binding_begin
== ~0U)
5441 param_var
->param_binding_begin
= idx
;
5442 param_var
->param_binding_length
++;
5449 make_error_string(const char *fmt
, ...)
5455 va_start(args
, fmt
);
5457 /* Call vsnprintf once to determine how large the final string is. Call it
5458 * again to do the actual formatting. from the vsnprintf manual page:
5460 * Upon successful return, these functions return the number of
5461 * characters printed (not including the trailing '\0' used to end
5462 * output to strings).
5464 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
5466 str
= _mesa_malloc(length
);
5468 vsnprintf(str
, length
, fmt
, args
);
5478 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
5483 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
5485 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
5486 _mesa_free(err_str
);
5489 err_str
= make_error_string("line %u, char %u: error: %s\n",
5490 locp
->first_line
, locp
->first_column
, s
);
5491 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
5494 _mesa_free(err_str
);
5500 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
5501 GLsizei len
, struct asm_parser_state
*state
)
5503 struct asm_instruction
*inst
;
5506 GLboolean result
= GL_FALSE
;
5508 struct asm_symbol
*sym
;
5511 state
->prog
->Target
= target
;
5512 state
->prog
->Parameters
= _mesa_new_parameter_list();
5514 /* Make a copy of the program string and force it to be NUL-terminated.
5516 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
5518 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5521 _mesa_memcpy (strz
, str
, len
);
5524 state
->prog
->String
= strz
;
5526 state
->st
= _mesa_symbol_table_ctor();
5528 state
->limits
= (target
== GL_VERTEX_PROGRAM_ARB
)
5529 ? & ctx
->Const
.VertexProgram
5530 : & ctx
->Const
.FragmentProgram
;
5532 state
->MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
5533 state
->MaxTextureCoordUnits
= ctx
->Const
.MaxTextureCoordUnits
;
5534 state
->MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
5535 state
->MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
5536 state
->MaxLights
= ctx
->Const
.MaxLights
;
5537 state
->MaxProgramMatrices
= ctx
->Const
.MaxProgramMatrices
;
5539 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
5540 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
5542 _mesa_set_program_error(ctx
, -1, NULL
);
5544 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
5546 _mesa_program_lexer_dtor(state
->scanner
);
5549 if (ctx
->Program
.ErrorPos
!= -1) {
5553 if (! _mesa_layout_parameters(state
)) {
5557 loc
.first_column
= 0;
5560 yyerror(& loc
, state
, "invalid PARAM usage");
5566 /* Add one instruction to store the "END" instruction.
5568 state
->prog
->Instructions
=
5569 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5570 inst
= state
->inst_head
;
5571 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5572 struct asm_instruction
*const temp
= inst
->next
;
5574 state
->prog
->Instructions
[i
] = inst
->Base
;
5578 /* Finally, tag on an OPCODE_END instruction */
5580 const GLuint numInst
= state
->prog
->NumInstructions
;
5581 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5582 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5584 state
->prog
->NumInstructions
++;
5586 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5587 state
->prog
->NumAttributes
= _mesa_bitcount(state
->prog
->InputsRead
);
5590 * Initialize native counts to logical counts. The device driver may
5591 * change them if program is translated into a hardware program.
5593 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5594 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5595 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5596 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5597 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5602 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5607 state
->inst_head
= NULL
;
5608 state
->inst_tail
= NULL
;
5610 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5613 _mesa_free((void *) sym
->name
);
5618 _mesa_symbol_table_dtor(state
->st
);