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 struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
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
);
148 #define TRUE (!FALSE)
151 #define YYLLOC_DEFAULT(Current, Rhs, N) \
154 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
155 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
156 (Current).position = YYRHSLOC(Rhs, 1).position; \
157 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
158 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
160 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
161 (Current).last_line = (Current).first_line; \
162 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
163 (Current).last_column = (Current).first_column; \
164 (Current).position = YYRHSLOC(Rhs, 0).position \
165 + (Current).first_column; \
169 #define YYLEX_PARAM state->scanner
172 /* Line 189 of yacc.c */
173 #line 174 "program_parse.tab.c"
175 /* Enabling traces. */
180 /* Enabling verbose error messages. */
181 #ifdef YYERROR_VERBOSE
182 # undef YYERROR_VERBOSE
183 # define YYERROR_VERBOSE 1
185 # define YYERROR_VERBOSE 1
188 /* Enabling the token table. */
189 #ifndef YYTOKEN_TABLE
190 # define YYTOKEN_TABLE 0
197 /* Put the tokens into the symbol table, so that GDB and other debuggers
301 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
302 typedef union YYSTYPE
305 /* Line 214 of yacc.c */
306 #line 107 "program_parse.y"
308 struct asm_instruction
*inst
;
309 struct asm_symbol
*sym
;
310 struct asm_symbol temp_sym
;
311 struct asm_swizzle_mask swiz_mask
;
312 struct asm_src_register src_reg
;
313 struct prog_dst_register dst_reg
;
314 struct prog_instruction temp_inst
;
322 struct asm_vector vector
;
323 gl_inst_opcode opcode
;
327 /* Line 214 of yacc.c */
328 #line 329 "program_parse.tab.c"
330 # define YYSTYPE_IS_TRIVIAL 1
331 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
332 # define YYSTYPE_IS_DECLARED 1
335 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
336 typedef struct YYLTYPE
343 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
344 # define YYLTYPE_IS_DECLARED 1
345 # define YYLTYPE_IS_TRIVIAL 1
349 /* Copy the second part of user declarations. */
351 /* Line 264 of yacc.c */
352 #line 240 "program_parse.y"
354 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
358 /* Line 264 of yacc.c */
359 #line 360 "program_parse.tab.c"
366 typedef YYTYPE_UINT8 yytype_uint8
;
368 typedef unsigned char yytype_uint8
;
372 typedef YYTYPE_INT8 yytype_int8
;
373 #elif (defined __STDC__ || defined __C99__FUNC__ \
374 || defined __cplusplus || defined _MSC_VER)
375 typedef signed char yytype_int8
;
377 typedef short int yytype_int8
;
381 typedef YYTYPE_UINT16 yytype_uint16
;
383 typedef unsigned short int yytype_uint16
;
387 typedef YYTYPE_INT16 yytype_int16
;
389 typedef short int yytype_int16
;
393 # ifdef __SIZE_TYPE__
394 # define YYSIZE_T __SIZE_TYPE__
395 # elif defined size_t
396 # define YYSIZE_T size_t
397 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
398 || defined __cplusplus || defined _MSC_VER)
399 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
400 # define YYSIZE_T size_t
402 # define YYSIZE_T unsigned int
406 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
411 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
412 # define YY_(msgid) dgettext ("bison-runtime", msgid)
416 # define YY_(msgid) msgid
420 /* Suppress unused-variable warnings by "using" E. */
421 #if ! defined lint || defined __GNUC__
422 # define YYUSE(e) ((void) (e))
424 # define YYUSE(e) /* empty */
427 /* Identity function, used to suppress warnings about constant conditions. */
431 #if (defined __STDC__ || defined __C99__FUNC__ \
432 || defined __cplusplus || defined _MSC_VER)
445 #if ! defined yyoverflow || YYERROR_VERBOSE
447 /* The parser invokes alloca or malloc; define the necessary symbols. */
449 # ifdef YYSTACK_USE_ALLOCA
450 # if YYSTACK_USE_ALLOCA
452 # define YYSTACK_ALLOC __builtin_alloca
453 # elif defined __BUILTIN_VA_ARG_INCR
454 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
456 # define YYSTACK_ALLOC __alloca
457 # elif defined _MSC_VER
458 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
459 # define alloca _alloca
461 # define YYSTACK_ALLOC alloca
462 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
463 || defined __cplusplus || defined _MSC_VER)
464 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
473 # ifdef YYSTACK_ALLOC
474 /* Pacify GCC's `empty if-body' warning. */
475 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
476 # ifndef YYSTACK_ALLOC_MAXIMUM
477 /* The OS might guarantee only one guard page at the bottom of the stack,
478 and a page size can be as small as 4096 bytes. So we cannot safely
479 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
480 to allow for a few compiler-allocated temporary stack slots. */
481 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
484 # define YYSTACK_ALLOC YYMALLOC
485 # define YYSTACK_FREE YYFREE
486 # ifndef YYSTACK_ALLOC_MAXIMUM
487 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
489 # if (defined __cplusplus && ! defined _STDLIB_H \
490 && ! ((defined YYMALLOC || defined malloc) \
491 && (defined YYFREE || defined free)))
492 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
498 # define YYMALLOC malloc
499 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
500 || defined __cplusplus || defined _MSC_VER)
501 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
506 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
507 || defined __cplusplus || defined _MSC_VER)
508 void free (void *); /* INFRINGES ON USER NAME SPACE */
512 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
515 #if (! defined yyoverflow \
516 && (! defined __cplusplus \
517 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
518 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
520 /* A type that is properly aligned for any stack member. */
523 yytype_int16 yyss_alloc
;
528 /* The size of the maximum gap between one aligned stack and the next. */
529 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
531 /* The size of an array large to enough to hold all stacks, each with
533 # define YYSTACK_BYTES(N) \
534 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
535 + 2 * YYSTACK_GAP_MAXIMUM)
537 /* Copy COUNT objects from FROM to TO. The source and destination do
540 # if defined __GNUC__ && 1 < __GNUC__
541 # define YYCOPY(To, From, Count) \
542 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
544 # define YYCOPY(To, From, Count) \
548 for (yyi = 0; yyi < (Count); yyi++) \
549 (To)[yyi] = (From)[yyi]; \
555 /* Relocate STACK from its old location to the new one. The
556 local variables YYSIZE and YYSTACKSIZE give the old and new number of
557 elements in the stack, and YYPTR gives the new location of the
558 stack. Advance YYPTR to a properly aligned location for the next
560 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
563 YYSIZE_T yynewbytes; \
564 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
565 Stack = &yyptr->Stack_alloc; \
566 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
567 yyptr += yynewbytes / sizeof (*yyptr); \
573 /* YYFINAL -- State number of the termination state. */
575 /* YYLAST -- Last index in YYTABLE. */
578 /* YYNTOKENS -- Number of terminals. */
579 #define YYNTOKENS 108
580 /* YYNNTS -- Number of nonterminals. */
582 /* YYNRULES -- Number of rules. */
584 /* YYNRULES -- Number of states. */
585 #define YYNSTATES 424
587 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
589 #define YYMAXUTOK 353
591 #define YYTRANSLATE(YYX) \
592 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
594 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
595 static const yytype_uint8 yytranslate
[] =
597 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 103, 100, 104, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 99,
603 2, 105, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 101, 2, 102, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 106, 2, 107, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
623 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
624 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
625 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
626 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
627 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
628 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
629 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
630 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
631 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
636 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
638 static const yytype_uint16 yyprhs
[] =
640 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
641 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
642 46, 48, 50, 52, 57, 62, 67, 74, 81, 90,
643 99, 102, 105, 107, 109, 111, 113, 115, 122, 126,
644 130, 133, 136, 144, 147, 149, 151, 153, 155, 160,
645 162, 164, 166, 168, 170, 172, 174, 178, 179, 182,
646 185, 187, 189, 191, 193, 195, 197, 199, 201, 203,
647 204, 206, 208, 210, 212, 213, 215, 217, 219, 221,
648 223, 225, 230, 233, 236, 238, 241, 243, 246, 248,
649 251, 256, 261, 263, 264, 268, 270, 272, 275, 277,
650 280, 282, 284, 288, 295, 296, 298, 301, 306, 308,
651 312, 314, 316, 318, 320, 322, 324, 326, 328, 330,
652 332, 335, 338, 341, 344, 347, 350, 353, 356, 359,
653 362, 365, 369, 371, 373, 375, 381, 383, 385, 387,
654 390, 392, 394, 397, 399, 402, 409, 411, 415, 417,
655 419, 421, 423, 425, 430, 432, 434, 436, 438, 440,
656 442, 445, 447, 449, 455, 457, 460, 462, 464, 470,
657 473, 474, 481, 485, 486, 488, 490, 492, 494, 496,
658 499, 501, 503, 506, 511, 516, 517, 519, 521, 523,
659 525, 527, 529, 531, 533, 539, 541, 545, 551, 557,
660 559, 563, 569, 571, 573, 575, 577, 579, 581, 583,
661 585, 587, 591, 597, 605, 615, 618, 621, 623, 625,
662 626, 627, 631, 632, 636, 640, 642, 647, 650, 653,
663 656, 659, 663, 666, 670, 671, 673, 675, 676, 678,
664 680, 681, 683, 685, 686, 688, 690, 691, 695, 696,
665 700, 701, 705, 707, 709, 711
668 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
669 static const yytype_int16 yyrhs
[] =
671 109, 0, -1, 110, 111, 113, 12, -1, 3, -1,
672 4, -1, 111, 112, -1, -1, 8, 91, 99, -1,
673 113, 114, -1, -1, 115, 99, -1, 151, 99, -1,
674 116, -1, 117, -1, 118, -1, 119, -1, 120, -1,
675 121, -1, 122, -1, 123, -1, 128, -1, 124, -1,
676 125, -1, 19, 132, 100, 129, -1, 18, 131, 100,
677 130, -1, 16, 131, 100, 129, -1, 14, 131, 100,
678 129, 100, 129, -1, 13, 131, 100, 130, 100, 130,
679 -1, 17, 131, 100, 130, 100, 130, 100, 130, -1,
680 15, 131, 100, 130, 100, 126, 100, 127, -1, 20,
681 130, -1, 82, 235, -1, 83, -1, 84, -1, 85,
682 -1, 86, -1, 87, -1, 21, 131, 100, 136, 100,
683 133, -1, 221, 136, 148, -1, 221, 136, 149, -1,
684 137, 150, -1, 145, 147, -1, 134, 100, 134, 100,
685 134, 100, 134, -1, 221, 135, -1, 22, -1, 91,
686 -1, 91, -1, 153, -1, 138, 101, 139, 102, -1,
687 167, -1, 228, -1, 91, -1, 91, -1, 140, -1,
688 141, -1, 22, -1, 145, 146, 142, -1, -1, 103,
689 143, -1, 104, 144, -1, 22, -1, 22, -1, 91,
690 -1, 95, -1, 95, -1, 95, -1, 95, -1, 92,
691 -1, 96, -1, -1, 92, -1, 93, -1, 94, -1,
692 95, -1, -1, 152, -1, 159, -1, 222, -1, 224,
693 -1, 227, -1, 240, -1, 7, 91, 105, 153, -1,
694 88, 154, -1, 37, 158, -1, 59, -1, 90, 156,
695 -1, 52, -1, 28, 233, -1, 36, -1, 73, 234,
696 -1, 49, 101, 157, 102, -1, 89, 101, 155, 102,
697 -1, 22, -1, -1, 101, 157, 102, -1, 22, -1,
698 59, -1, 28, 233, -1, 36, -1, 73, 234, -1,
699 160, -1, 161, -1, 10, 91, 163, -1, 10, 91,
700 101, 162, 102, 164, -1, -1, 22, -1, 105, 166,
701 -1, 105, 106, 165, 107, -1, 168, -1, 165, 100,
702 168, -1, 170, -1, 205, -1, 215, -1, 170, -1,
703 205, -1, 216, -1, 169, -1, 206, -1, 215, -1,
704 170, -1, 72, 194, -1, 72, 171, -1, 72, 173,
705 -1, 72, 176, -1, 72, 178, -1, 72, 184, -1,
706 72, 180, -1, 72, 187, -1, 72, 189, -1, 72,
707 191, -1, 72, 193, -1, 46, 232, 172, -1, 182,
708 -1, 32, -1, 68, -1, 42, 101, 183, 102, 174,
709 -1, 182, -1, 59, -1, 25, -1, 71, 175, -1,
710 39, -1, 31, -1, 43, 177, -1, 24, -1, 232,
711 66, -1, 44, 101, 183, 102, 232, 179, -1, 182,
712 -1, 74, 236, 181, -1, 28, -1, 24, -1, 30,
713 -1, 70, -1, 22, -1, 75, 234, 185, 186, -1,
714 34, -1, 53, -1, 78, -1, 79, -1, 77, -1,
715 76, -1, 35, 188, -1, 28, -1, 55, -1, 27,
716 101, 190, 102, 56, -1, 22, -1, 57, 192, -1,
717 69, -1, 25, -1, 196, 65, 101, 199, 102, -1,
718 196, 195, -1, -1, 65, 101, 199, 97, 199, 102,
719 -1, 48, 200, 197, -1, -1, 198, -1, 40, -1,
720 81, -1, 41, -1, 22, -1, 50, 201, -1, 62,
721 -1, 51, -1, 80, 234, -1, 54, 101, 203, 102,
722 -1, 47, 101, 204, 102, -1, -1, 202, -1, 22,
723 -1, 22, -1, 22, -1, 209, -1, 212, -1, 207,
724 -1, 210, -1, 61, 33, 101, 208, 102, -1, 213,
725 -1, 213, 97, 213, -1, 61, 33, 101, 213, 102,
726 -1, 61, 45, 101, 211, 102, -1, 214, -1, 214,
727 97, 214, -1, 61, 45, 101, 214, 102, -1, 22,
728 -1, 22, -1, 217, -1, 219, -1, 218, -1, 219,
729 -1, 220, -1, 23, -1, 22, -1, 106, 220, 107,
730 -1, 106, 220, 100, 220, 107, -1, 106, 220, 100,
731 220, 100, 220, 107, -1, 106, 220, 100, 220, 100,
732 220, 100, 220, 107, -1, 221, 23, -1, 221, 22,
733 -1, 103, -1, 104, -1, -1, -1, 11, 223, 226,
734 -1, -1, 5, 225, 226, -1, 226, 100, 91, -1,
735 91, -1, 9, 91, 105, 228, -1, 64, 59, -1,
736 64, 36, -1, 64, 229, -1, 64, 58, -1, 64,
737 73, 234, -1, 64, 29, -1, 28, 230, 231, -1,
738 -1, 38, -1, 26, -1, -1, 60, -1, 67, -1,
739 -1, 38, -1, 26, -1, -1, 60, -1, 67, -1,
740 -1, 101, 237, 102, -1, -1, 101, 238, 102, -1,
741 -1, 101, 239, 102, -1, 22, -1, 22, -1, 22,
742 -1, 6, 91, 105, 91, -1
745 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
746 static const yytype_uint16 yyrline
[] =
748 0, 247, 247, 250, 258, 267, 268, 271, 289, 290,
749 293, 308, 311, 316, 323, 324, 325, 326, 327, 328,
750 329, 332, 333, 336, 342, 349, 356, 364, 371, 379,
751 392, 399, 405, 406, 407, 408, 409, 412, 424, 437,
752 450, 472, 481, 490, 497, 506, 534, 576, 587, 608,
753 618, 624, 648, 665, 665, 667, 674, 686, 687, 688,
754 691, 703, 715, 733, 744, 756, 758, 759, 760, 761,
755 764, 764, 764, 764, 765, 768, 769, 770, 771, 772,
756 773, 776, 794, 798, 804, 808, 812, 816, 825, 834,
757 838, 843, 849, 860, 860, 861, 863, 867, 871, 875,
758 881, 881, 883, 899, 922, 925, 936, 942, 948, 949,
759 956, 962, 968, 976, 982, 988, 996, 1002, 1008, 1016,
760 1017, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028,
761 1029, 1032, 1041, 1045, 1049, 1055, 1064, 1068, 1072, 1081,
762 1085, 1091, 1097, 1104, 1109, 1117, 1127, 1129, 1137, 1143,
763 1147, 1151, 1157, 1168, 1177, 1181, 1186, 1190, 1194, 1198,
764 1204, 1211, 1215, 1221, 1229, 1240, 1247, 1251, 1257, 1267,
765 1278, 1282, 1300, 1309, 1312, 1318, 1322, 1326, 1332, 1343,
766 1348, 1353, 1358, 1363, 1368, 1376, 1379, 1384, 1397, 1405,
767 1418, 1418, 1420, 1420, 1422, 1432, 1437, 1444, 1454, 1463,
768 1468, 1475, 1485, 1495, 1507, 1507, 1508, 1508, 1510, 1517,
769 1522, 1529, 1537, 1545, 1554, 1565, 1569, 1575, 1576, 1577,
770 1580, 1580, 1583, 1583, 1586, 1592, 1600, 1613, 1622, 1631,
771 1635, 1644, 1653, 1664, 1671, 1676, 1685, 1697, 1700, 1709,
772 1720, 1721, 1722, 1725, 1726, 1727, 1730, 1731, 1734, 1735,
773 1738, 1739, 1742, 1753, 1764, 1775
777 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
778 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
779 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
780 static const char *const yytname
[] =
782 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
783 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
784 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
785 "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK",
786 "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV",
787 "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
788 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
789 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
790 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT", "POINTSIZE", "POSITION",
791 "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
792 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE", "SPECULAR", "SPOT",
793 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
794 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
795 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "VERTEX", "VTXATTRIB",
796 "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE",
797 "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'",
798 "'}'", "$accept", "program", "language", "optionSequence", "option",
799 "statementSequence", "statement", "instruction", "ALU_instruction",
800 "TexInstruction", "ARL_instruction", "VECTORop_instruction",
801 "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction",
802 "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction",
803 "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg",
804 "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle",
805 "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray",
806 "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel",
807 "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg",
808 "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix",
809 "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding",
810 "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum",
811 "fragAttribItem", "PARAM_statement", "PARAM_singleStmt",
812 "PARAM_multipleStmt", "optArraySize", "paramSingleInit",
813 "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl",
814 "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem",
815 "stateSingleItem", "stateMaterialItem", "stateMatProperty",
816 "stateLightItem", "stateLightProperty", "stateSpotProperty",
817 "stateLightModelItem", "stateLModProperty", "stateLightProdItem",
818 "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty",
819 "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem",
820 "stateTexGenType", "stateTexGenCoord", "stateFogItem",
821 "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum",
822 "statePointItem", "statePointProperty", "stateMatrixRow",
823 "stateMatrixRows", "optMatrixRows", "stateMatrixItem",
824 "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum",
825 "stateMatrixName", "stateOptModMatNum", "stateModMatNum",
826 "statePaletteMatNum", "stateProgramMatNum", "programSingleItem",
827 "programMultipleItem", "progEnvParams", "progEnvParamNums",
828 "progEnvParam", "progLocalParams", "progLocalParamNums",
829 "progLocalParam", "progEnvParamNum", "progLocalParamNum",
830 "paramConstDecl", "paramConstUse", "paramConstScalarDecl",
831 "paramConstScalarUse", "paramConstVector", "signedFloatConstant",
832 "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2",
833 "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding",
834 "optResultFaceType", "optResultColorType", "optFaceType", "optColorType",
835 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
836 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
842 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
844 static const yytype_uint16 yytoknum
[] =
846 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
847 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
848 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
849 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
850 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
851 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
852 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
853 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
854 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
855 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
856 44, 91, 93, 43, 45, 61, 123, 125
860 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
861 static const yytype_uint8 yyr1
[] =
863 0, 108, 109, 110, 110, 111, 111, 112, 113, 113,
864 114, 114, 115, 115, 116, 116, 116, 116, 116, 116,
865 116, 117, 117, 118, 119, 120, 121, 122, 123, 124,
866 125, 126, 127, 127, 127, 127, 127, 128, 129, 130,
867 131, 132, 133, 134, 135, 135, 136, 136, 136, 136,
868 137, 137, 138, 139, 139, 140, 141, 142, 142, 142,
869 143, 144, 145, 146, 147, 148, 149, 149, 149, 149,
870 150, 150, 150, 150, 150, 151, 151, 151, 151, 151,
871 151, 152, 153, 153, 154, 154, 154, 154, 154, 154,
872 154, 154, 155, 156, 156, 157, 158, 158, 158, 158,
873 159, 159, 160, 161, 162, 162, 163, 164, 165, 165,
874 166, 166, 166, 167, 167, 167, 168, 168, 168, 169,
875 169, 170, 170, 170, 170, 170, 170, 170, 170, 170,
876 170, 171, 172, 172, 172, 173, 174, 174, 174, 174,
877 174, 175, 176, 177, 177, 178, 179, 180, 181, 182,
878 182, 182, 183, 184, 185, 185, 186, 186, 186, 186,
879 187, 188, 188, 189, 190, 191, 192, 192, 193, 194,
880 195, 195, 196, 197, 197, 198, 198, 198, 199, 200,
881 200, 200, 200, 200, 200, 201, 201, 202, 203, 204,
882 205, 205, 206, 206, 207, 208, 208, 209, 210, 211,
883 211, 212, 213, 214, 215, 215, 216, 216, 217, 218,
884 218, 219, 219, 219, 219, 220, 220, 221, 221, 221,
885 223, 222, 225, 224, 226, 226, 227, 228, 228, 228,
886 228, 228, 228, 229, 230, 230, 230, 231, 231, 231,
887 232, 232, 232, 233, 233, 233, 234, 234, 235, 235,
888 236, 236, 237, 238, 239, 240
891 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
892 static const yytype_uint8 yyr2
[] =
894 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
895 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
896 1, 1, 1, 4, 4, 4, 6, 6, 8, 8,
897 2, 2, 1, 1, 1, 1, 1, 6, 3, 3,
898 2, 2, 7, 2, 1, 1, 1, 1, 4, 1,
899 1, 1, 1, 1, 1, 1, 3, 0, 2, 2,
900 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
901 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
902 1, 4, 2, 2, 1, 2, 1, 2, 1, 2,
903 4, 4, 1, 0, 3, 1, 1, 2, 1, 2,
904 1, 1, 3, 6, 0, 1, 2, 4, 1, 3,
905 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
906 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
907 2, 3, 1, 1, 1, 5, 1, 1, 1, 2,
908 1, 1, 2, 1, 2, 6, 1, 3, 1, 1,
909 1, 1, 1, 4, 1, 1, 1, 1, 1, 1,
910 2, 1, 1, 5, 1, 2, 1, 1, 5, 2,
911 0, 6, 3, 0, 1, 1, 1, 1, 1, 2,
912 1, 1, 2, 4, 4, 0, 1, 1, 1, 1,
913 1, 1, 1, 1, 5, 1, 3, 5, 5, 1,
914 3, 5, 1, 1, 1, 1, 1, 1, 1, 1,
915 1, 3, 5, 7, 9, 2, 2, 1, 1, 0,
916 0, 3, 0, 3, 3, 1, 4, 2, 2, 2,
917 2, 3, 2, 3, 0, 1, 1, 0, 1, 1,
918 0, 1, 1, 0, 1, 1, 0, 3, 0, 3,
922 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
923 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
924 means the default is an error. */
925 static const yytype_uint8 yydefact
[] =
927 0, 3, 4, 0, 6, 1, 9, 0, 5, 0,
928 0, 222, 0, 0, 0, 0, 220, 2, 0, 0,
929 0, 0, 0, 0, 0, 219, 0, 8, 0, 12,
930 13, 14, 15, 16, 17, 18, 19, 21, 22, 20,
931 0, 75, 76, 100, 101, 77, 78, 79, 80, 7,
932 0, 0, 0, 0, 0, 0, 0, 51, 0, 74,
933 50, 0, 0, 0, 0, 0, 62, 0, 0, 217,
934 218, 30, 0, 0, 10, 11, 225, 223, 0, 0,
935 0, 104, 219, 102, 221, 234, 232, 228, 230, 227,
936 246, 229, 219, 70, 71, 72, 73, 40, 219, 219,
937 219, 219, 219, 219, 64, 41, 210, 209, 0, 0,
938 0, 0, 46, 219, 69, 0, 47, 49, 113, 114,
939 190, 191, 115, 206, 207, 0, 0, 255, 81, 226,
940 105, 0, 106, 110, 111, 112, 204, 205, 208, 0,
941 236, 235, 237, 0, 231, 0, 0, 0, 0, 25,
942 0, 24, 23, 243, 98, 96, 246, 83, 0, 0,
943 0, 0, 0, 240, 0, 240, 0, 0, 250, 246,
944 121, 122, 123, 124, 126, 125, 127, 128, 129, 130,
945 0, 243, 88, 0, 86, 84, 246, 0, 93, 82,
946 0, 67, 66, 68, 39, 0, 0, 224, 0, 216,
947 215, 238, 239, 233, 252, 0, 219, 219, 0, 0,
948 219, 244, 245, 97, 99, 0, 0, 0, 161, 162,
949 160, 0, 143, 242, 241, 142, 0, 0, 0, 0,
950 185, 181, 0, 180, 246, 173, 167, 166, 165, 0,
951 0, 0, 0, 87, 0, 89, 0, 0, 85, 219,
952 211, 55, 0, 53, 54, 0, 219, 0, 103, 247,
953 27, 26, 65, 38, 248, 0, 0, 202, 0, 203,
954 0, 164, 0, 152, 0, 144, 0, 149, 150, 133,
955 134, 151, 131, 132, 0, 187, 179, 186, 0, 182,
956 175, 177, 176, 172, 174, 254, 0, 148, 147, 154,
957 155, 0, 0, 95, 0, 92, 0, 0, 0, 48,
958 63, 57, 37, 0, 0, 219, 0, 31, 0, 219,
959 197, 201, 0, 0, 240, 189, 0, 188, 0, 251,
960 159, 158, 156, 157, 153, 178, 0, 90, 91, 94,
961 219, 212, 0, 0, 56, 219, 44, 45, 43, 0,
962 0, 0, 108, 116, 119, 117, 192, 193, 118, 253,
963 0, 32, 33, 34, 35, 36, 29, 28, 163, 138,
964 140, 137, 0, 135, 136, 0, 184, 183, 168, 0,
965 60, 58, 61, 59, 0, 0, 0, 120, 170, 219,
966 107, 249, 141, 139, 145, 146, 219, 213, 219, 0,
967 0, 0, 169, 109, 0, 0, 0, 195, 0, 199,
968 0, 214, 219, 194, 0, 198, 0, 0, 42, 196,
972 /* YYDEFGOTO[NTERM-NUM]. */
973 static const yytype_int16 yydefgoto
[] =
975 -1, 3, 4, 6, 8, 9, 27, 28, 29, 30,
976 31, 32, 33, 34, 35, 36, 37, 38, 265, 366,
977 39, 146, 71, 58, 67, 312, 313, 348, 114, 59,
978 115, 252, 253, 254, 344, 381, 383, 68, 311, 105,
979 263, 194, 97, 40, 41, 116, 189, 306, 248, 304,
980 157, 42, 43, 44, 131, 83, 258, 351, 132, 117,
981 352, 353, 118, 170, 282, 171, 373, 393, 172, 225,
982 173, 394, 174, 298, 283, 274, 175, 301, 334, 176,
983 220, 177, 272, 178, 238, 179, 387, 402, 180, 293,
984 294, 336, 235, 286, 287, 328, 326, 119, 355, 356,
985 406, 120, 357, 408, 121, 268, 270, 358, 122, 136,
986 123, 124, 138, 72, 45, 55, 46, 50, 77, 47,
987 60, 91, 142, 203, 226, 213, 144, 317, 240, 205,
991 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
993 #define YYPACT_NINF -371
994 static const yytype_int16 yypact
[] =
996 159, -371, -371, 34, -371, -371, 66, 11, -371, 140,
997 -22, -371, 25, 37, 51, 53, -371, -371, -28, -28,
998 -28, -28, -28, -28, 74, 102, -28, -371, 80, -371,
999 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1000 82, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1001 120, -6, 107, 108, 91, 120, 61, -371, 93, 105,
1002 -371, 114, 115, 116, 117, 118, -371, 119, 87, -371,
1003 -371, -371, -15, 121, -371, -371, -371, 122, 129, -17,
1004 160, 201, -3, -371, 122, 21, -371, -371, -371, -371,
1005 124, -371, 102, -371, -371, -371, -371, -371, 102, 102,
1006 102, 102, 102, 102, -371, -371, -371, -371, 68, 72,
1007 8, -11, 126, 102, 99, 127, -371, -371, -371, -371,
1008 -371, -371, -371, -371, -371, -15, 135, -371, -371, -371,
1009 -371, 130, -371, -371, -371, -371, -371, -371, -371, 185,
1010 -371, -371, 48, 207, -371, 136, 137, -15, 138, -371,
1011 139, -371, -371, 64, -371, -371, 124, -371, 141, 142,
1012 143, 9, 144, 88, 145, 83, 86, 24, 146, 124,
1013 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1014 175, 64, -371, 147, -371, -371, 124, 148, 150, -371,
1015 73, -371, -371, -371, -371, -10, 152, -371, 151, -371,
1016 -371, -371, -371, -371, -371, 153, 102, 102, 155, 171,
1017 102, -371, -371, -371, -371, 219, 232, 235, -371, -371,
1018 -371, 237, -371, -371, -371, -371, 194, 237, 0, 161,
1019 239, -371, 163, -371, 124, -14, -371, -371, -371, 243,
1020 238, 58, 166, -371, 246, -371, 247, 246, -371, 102,
1021 -371, -371, 168, -371, -371, 176, 102, 167, -371, -371,
1022 -371, -371, -371, -371, 173, 172, 177, -371, 174, -371,
1023 178, -371, 179, -371, 180, -371, 181, -371, -371, -371,
1024 -371, -371, -371, -371, 253, -371, -371, -371, 256, -371,
1025 -371, -371, -371, -371, -371, -371, 182, -371, -371, -371,
1026 -371, 125, 257, -371, 183, -371, 186, 187, 76, -371,
1027 -371, 106, -371, 190, -7, 26, 265, -371, 103, 102,
1028 -371, -371, 236, 36, 83, -371, 189, -371, 191, -371,
1029 -371, -371, -371, -371, -371, -371, 192, -371, -371, -371,
1030 102, -371, 273, 274, -371, 102, -371, -371, -371, 90,
1031 8, 77, -371, -371, -371, -371, -371, -371, -371, -371,
1032 195, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1033 -371, -371, 267, -371, -371, 15, -371, -371, -371, 78,
1034 -371, -371, -371, -371, 199, 200, 202, -371, 240, 26,
1035 -371, -371, -371, -371, -371, -371, 102, -371, 102, 219,
1036 232, 203, -371, -371, 193, 206, 208, 205, 209, 215,
1037 257, -371, 102, -371, 219, -371, 232, 41, -371, -371,
1038 -371, 257, 211, -371
1041 /* YYPGOTO[NTERM-NUM]. */
1042 static const yytype_int16 yypgoto
[] =
1044 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1045 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1046 -371, -94, -88, 149, -371, -371, -326, -371, -92, -371,
1047 -371, -371, -371, -371, -371, -371, -371, 123, -371, -371,
1048 -371, -371, -371, -371, -371, 241, -371, -371, -371, 70,
1049 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1050 -74, -371, -81, -371, -371, -371, -371, -371, -371, -371,
1051 -371, -371, -371, -371, -295, 92, -371, -371, -371, -371,
1052 -371, -371, -371, -371, -371, -371, -371, -371, -29, -371,
1053 -371, -368, -371, -371, -371, -371, -371, 242, -371, -371,
1054 -371, -371, -371, -371, -371, -370, -306, 244, -371, -371,
1055 -371, -80, -110, -82, -371, -371, -371, -371, 268, -371,
1056 245, -371, -371, -371, -160, 154, -146, -371, -371, -371,
1060 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1061 positive, shift that token. If negative, reduce the rule which
1062 number is the opposite. If zero, do what YYDEFACT says.
1063 If YYTABLE_NINF, syntax error. */
1064 #define YYTABLE_NINF -53
1065 static const yytype_int16 yytable
[] =
1067 139, 133, 137, 190, 145, 228, 149, 106, 107, 152,
1068 214, 148, 251, 150, 151, 346, 147, 181, 147, 384,
1069 108, 147, 108, 241, 277, 182, 290, 291, 374, 407,
1070 278, 139, 279, 196, 5, 160, 56, 218, 183, 277,
1071 245, 184, 417, 161, 419, 278, 109, 140, 185, 236,
1072 162, 163, 164, 422, 165, 208, 166, 110, 109, 141,
1073 277, 369, 186, 57, 219, 167, 278, 292, 280, 110,
1074 281, 111, 405, 111, 7, 370, 112, 49, 187, 188,
1075 395, 66, 168, 169, 347, 281, 418, 349, 289, 85,
1076 86, 113, 299, 237, 409, 371, 153, 87, 350, 78,
1077 69, 70, 10, 113, 154, 158, 281, 372, 201, 223,
1078 420, 300, 222, 261, 223, 202, 51, 159, 260, 88,
1079 89, 224, 266, 385, 211, 147, 224, 155, 52, 69,
1080 70, 212, 113, 229, 90, 386, 230, 231, 421, 308,
1081 232, 156, 53, 378, 54, 11, 12, 13, 233, 14,
1082 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1083 25, 26, 1, 2, 375, 66, 234, 139, 61, 62,
1084 63, 64, 65, 249, 314, 73, 340, 389, 396, 74,
1085 250, 75, 104, 341, 390, 397, 361, 362, 363, 364,
1086 365, 191, 81, 92, 192, 193, 82, 93, 94, 95,
1087 96, 330, 331, 332, 333, 69, 70, 199, 200, 342,
1088 343, 76, 79, 80, 98, 99, 100, 101, 102, 103,
1089 127, 125, 126, 130, 56, 143, 197, -52, 195, 204,
1090 379, 367, 198, 139, 354, 137, 206, 207, 209, 210,
1091 242, 267, 215, 216, 217, 221, 227, 239, 244, 246,
1092 262, 247, 256, 264, 269, 259, 257, 271, 139, 273,
1093 275, 285, 284, 314, 288, 295, 297, 302, 303, 305,
1094 309, 310, 318, 315, 316, 325, 320, 319, 327, 335,
1095 321, 322, 323, 324, 329, 337, 404, 359, 338, 339,
1096 345, 376, 368, 377, 378, 380, 382, 391, 392, 398,
1097 411, 399, 414, 400, 410, 401, 412, 139, 354, 137,
1098 413, 415, 416, 423, 139, 403, 314, 307, 255, 276,
1099 128, 388, 0, 84, 134, 129, 135, 0, 0, 0,
1100 314, 0, 0, 0, 0, 243
1103 static const yytype_int16 yycheck
[] =
1105 82, 82, 82, 113, 92, 165, 100, 22, 23, 103,
1106 156, 99, 22, 101, 102, 22, 98, 28, 100, 345,
1107 37, 103, 37, 169, 24, 36, 40, 41, 323, 399,
1108 30, 113, 32, 125, 0, 27, 64, 28, 49, 24,
1109 186, 52, 410, 35, 414, 30, 61, 26, 59, 25,
1110 42, 43, 44, 421, 46, 147, 48, 72, 61, 38,
1111 24, 25, 73, 91, 55, 57, 30, 81, 68, 72,
1112 70, 88, 398, 88, 8, 39, 91, 99, 89, 90,
1113 375, 91, 74, 75, 91, 70, 412, 61, 234, 28,
1114 29, 106, 34, 69, 400, 59, 28, 36, 72, 105,
1115 103, 104, 91, 106, 36, 33, 70, 71, 60, 26,
1116 416, 53, 24, 207, 26, 67, 91, 45, 206, 58,
1117 59, 38, 210, 33, 60, 207, 38, 59, 91, 103,
1118 104, 67, 106, 47, 73, 45, 50, 51, 97, 249,
1119 54, 73, 91, 102, 91, 5, 6, 7, 62, 9,
1120 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1121 20, 21, 3, 4, 324, 91, 80, 249, 19, 20,
1122 21, 22, 23, 100, 256, 26, 100, 100, 100, 99,
1123 107, 99, 95, 107, 107, 107, 83, 84, 85, 86,
1124 87, 92, 101, 100, 95, 96, 105, 92, 93, 94,
1125 95, 76, 77, 78, 79, 103, 104, 22, 23, 103,
1126 104, 91, 105, 105, 100, 100, 100, 100, 100, 100,
1127 91, 100, 100, 22, 64, 101, 91, 101, 101, 22,
1128 340, 319, 102, 315, 315, 315, 100, 100, 100, 100,
1129 65, 22, 101, 101, 101, 101, 101, 101, 101, 101,
1130 95, 101, 100, 82, 22, 102, 105, 22, 340, 22,
1131 66, 22, 101, 345, 101, 22, 28, 101, 22, 22,
1132 102, 95, 100, 106, 101, 22, 102, 100, 22, 22,
1133 102, 102, 102, 102, 102, 102, 396, 22, 102, 102,
1134 100, 102, 56, 102, 102, 22, 22, 102, 31, 100,
1135 107, 101, 97, 101, 101, 65, 100, 389, 389, 389,
1136 102, 102, 97, 102, 396, 389, 398, 247, 195, 227,
1137 79, 350, -1, 55, 82, 80, 82, -1, -1, -1,
1138 412, -1, -1, -1, -1, 181
1141 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1142 symbol of state STATE-NUM. */
1143 static const yytype_uint8 yystos
[] =
1145 0, 3, 4, 109, 110, 0, 111, 8, 112, 113,
1146 91, 5, 6, 7, 9, 10, 11, 12, 13, 14,
1147 15, 16, 17, 18, 19, 20, 21, 114, 115, 116,
1148 117, 118, 119, 120, 121, 122, 123, 124, 125, 128,
1149 151, 152, 159, 160, 161, 222, 224, 227, 240, 99,
1150 225, 91, 91, 91, 91, 223, 64, 91, 131, 137,
1151 228, 131, 131, 131, 131, 131, 91, 132, 145, 103,
1152 104, 130, 221, 131, 99, 99, 91, 226, 105, 105,
1153 105, 101, 105, 163, 226, 28, 29, 36, 58, 59,
1154 73, 229, 100, 92, 93, 94, 95, 150, 100, 100,
1155 100, 100, 100, 100, 95, 147, 22, 23, 37, 61,
1156 72, 88, 91, 106, 136, 138, 153, 167, 170, 205,
1157 209, 212, 216, 218, 219, 100, 100, 91, 153, 228,
1158 22, 162, 166, 170, 205, 215, 217, 219, 220, 221,
1159 26, 38, 230, 101, 234, 130, 129, 221, 130, 129,
1160 130, 130, 129, 28, 36, 59, 73, 158, 33, 45,
1161 27, 35, 42, 43, 44, 46, 48, 57, 74, 75,
1162 171, 173, 176, 178, 180, 184, 187, 189, 191, 193,
1163 196, 28, 36, 49, 52, 59, 73, 89, 90, 154,
1164 220, 92, 95, 96, 149, 101, 136, 91, 102, 22,
1165 23, 60, 67, 231, 22, 237, 100, 100, 136, 100,
1166 100, 60, 67, 233, 234, 101, 101, 101, 28, 55,
1167 188, 101, 24, 26, 38, 177, 232, 101, 232, 47,
1168 50, 51, 54, 62, 80, 200, 25, 69, 192, 101,
1169 236, 234, 65, 233, 101, 234, 101, 101, 156, 100,
1170 107, 22, 139, 140, 141, 145, 100, 105, 164, 102,
1171 130, 129, 95, 148, 82, 126, 130, 22, 213, 22,
1172 214, 22, 190, 22, 183, 66, 183, 24, 30, 32,
1173 68, 70, 172, 182, 101, 22, 201, 202, 101, 234,
1174 40, 41, 81, 197, 198, 22, 239, 28, 181, 34,
1175 53, 185, 101, 22, 157, 22, 155, 157, 220, 102,
1176 95, 146, 133, 134, 221, 106, 101, 235, 100, 100,
1177 102, 102, 102, 102, 102, 22, 204, 22, 203, 102,
1178 76, 77, 78, 79, 186, 22, 199, 102, 102, 102,
1179 100, 107, 103, 104, 142, 100, 22, 91, 135, 61,
1180 72, 165, 168, 169, 170, 206, 207, 210, 215, 22,
1181 238, 83, 84, 85, 86, 87, 127, 130, 56, 25,
1182 39, 59, 71, 174, 182, 232, 102, 102, 102, 220,
1183 22, 143, 22, 144, 134, 33, 45, 194, 196, 100,
1184 107, 102, 31, 175, 179, 182, 100, 107, 100, 101,
1185 101, 65, 195, 168, 220, 134, 208, 213, 211, 214,
1186 101, 107, 100, 102, 97, 102, 97, 199, 134, 213,
1190 #define yyerrok (yyerrstatus = 0)
1191 #define yyclearin (yychar = YYEMPTY)
1192 #define YYEMPTY (-2)
1195 #define YYACCEPT goto yyacceptlab
1196 #define YYABORT goto yyabortlab
1197 #define YYERROR goto yyerrorlab
1200 /* Like YYERROR except do call yyerror. This remains here temporarily
1201 to ease the transition to the new meaning of YYERROR, for GCC.
1202 Once GCC version 2 has supplanted version 1, this can go. */
1204 #define YYFAIL goto yyerrlab
1206 #define YYRECOVERING() (!!yyerrstatus)
1208 #define YYBACKUP(Token, Value) \
1210 if (yychar == YYEMPTY && yylen == 1) \
1214 yytoken = YYTRANSLATE (yychar); \
1220 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1227 #define YYERRCODE 256
1230 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1231 If N is 0, then set CURRENT to the empty location which ends
1232 the previous symbol: RHS[0] (always defined). */
1234 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1235 #ifndef YYLLOC_DEFAULT
1236 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1240 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1241 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1242 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1243 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1247 (Current).first_line = (Current).last_line = \
1248 YYRHSLOC (Rhs, 0).last_line; \
1249 (Current).first_column = (Current).last_column = \
1250 YYRHSLOC (Rhs, 0).last_column; \
1256 /* YY_LOCATION_PRINT -- Print the location on the stream.
1257 This macro was not mandated originally: define only if we know
1258 we won't break user code: when these are the locations we know. */
1260 #ifndef YY_LOCATION_PRINT
1261 # if YYLTYPE_IS_TRIVIAL
1262 # define YY_LOCATION_PRINT(File, Loc) \
1263 fprintf (File, "%d.%d-%d.%d", \
1264 (Loc).first_line, (Loc).first_column, \
1265 (Loc).last_line, (Loc).last_column)
1267 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1272 /* YYLEX -- calling `yylex' with the right arguments. */
1275 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1277 # define YYLEX yylex (&yylval, &yylloc, scanner)
1280 /* Enable debugging if requested. */
1284 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1285 # define YYFPRINTF fprintf
1288 # define YYDPRINTF(Args) \
1294 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1298 YYFPRINTF (stderr, "%s ", Title); \
1299 yy_symbol_print (stderr, \
1300 Type, Value, Location, state); \
1301 YYFPRINTF (stderr, "\n"); \
1306 /*--------------------------------.
1307 | Print this symbol on YYOUTPUT. |
1308 `--------------------------------*/
1311 #if (defined __STDC__ || defined __C99__FUNC__ \
1312 || defined __cplusplus || defined _MSC_VER)
1314 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1317 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1320 YYSTYPE
const * const yyvaluep
;
1321 YYLTYPE
const * const yylocationp
;
1322 struct asm_parser_state
*state
;
1327 YYUSE (yylocationp
);
1330 if (yytype
< YYNTOKENS
)
1331 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1343 /*--------------------------------.
1344 | Print this symbol on YYOUTPUT. |
1345 `--------------------------------*/
1347 #if (defined __STDC__ || defined __C99__FUNC__ \
1348 || defined __cplusplus || defined _MSC_VER)
1350 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1353 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1356 YYSTYPE
const * const yyvaluep
;
1357 YYLTYPE
const * const yylocationp
;
1358 struct asm_parser_state
*state
;
1361 if (yytype
< YYNTOKENS
)
1362 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1364 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1366 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1367 YYFPRINTF (yyoutput
, ": ");
1368 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1369 YYFPRINTF (yyoutput
, ")");
1372 /*------------------------------------------------------------------.
1373 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1375 `------------------------------------------------------------------*/
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1380 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1383 yy_stack_print (yybottom
, yytop
)
1384 yytype_int16
*yybottom
;
1385 yytype_int16
*yytop
;
1388 YYFPRINTF (stderr
, "Stack now");
1389 for (; yybottom
<= yytop
; yybottom
++)
1391 int yybot
= *yybottom
;
1392 YYFPRINTF (stderr
, " %d", yybot
);
1394 YYFPRINTF (stderr
, "\n");
1397 # define YY_STACK_PRINT(Bottom, Top) \
1400 yy_stack_print ((Bottom), (Top)); \
1404 /*------------------------------------------------.
1405 | Report that the YYRULE is going to be reduced. |
1406 `------------------------------------------------*/
1408 #if (defined __STDC__ || defined __C99__FUNC__ \
1409 || defined __cplusplus || defined _MSC_VER)
1411 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1414 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1418 struct asm_parser_state
*state
;
1421 int yynrhs
= yyr2
[yyrule
];
1423 unsigned long int yylno
= yyrline
[yyrule
];
1424 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1426 /* The symbols being reduced. */
1427 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1429 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1430 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1431 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1432 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1433 YYFPRINTF (stderr
, "\n");
1437 # define YY_REDUCE_PRINT(Rule) \
1440 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1443 /* Nonzero means print parse trace. It is left uninitialized so that
1444 multiple parsers can coexist. */
1446 #else /* !YYDEBUG */
1447 # define YYDPRINTF(Args)
1448 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1449 # define YY_STACK_PRINT(Bottom, Top)
1450 # define YY_REDUCE_PRINT(Rule)
1451 #endif /* !YYDEBUG */
1454 /* YYINITDEPTH -- initial size of the parser's stacks. */
1456 # define YYINITDEPTH 200
1459 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1460 if the built-in stack extension method is used).
1462 Do not make this value too large; the results are undefined if
1463 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1464 evaluated with infinite-precision integer arithmetic. */
1467 # define YYMAXDEPTH 10000
1475 # if defined __GLIBC__ && defined _STRING_H
1476 # define yystrlen strlen
1478 /* Return the length of YYSTR. */
1479 #if (defined __STDC__ || defined __C99__FUNC__ \
1480 || defined __cplusplus || defined _MSC_VER)
1482 yystrlen (const char *yystr
)
1490 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1498 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1499 # define yystpcpy stpcpy
1501 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1503 #if (defined __STDC__ || defined __C99__FUNC__ \
1504 || defined __cplusplus || defined _MSC_VER)
1506 yystpcpy (char *yydest
, const char *yysrc
)
1509 yystpcpy (yydest
, yysrc
)
1515 const char *yys
= yysrc
;
1517 while ((*yyd
++ = *yys
++) != '\0')
1526 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1527 quotes and backslashes, so that it's suitable for yyerror. The
1528 heuristic is that double-quoting is unnecessary unless the string
1529 contains an apostrophe, a comma, or backslash (other than
1530 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1531 null, do not copy; instead, return the length of what the result
1534 yytnamerr (char *yyres
, const char *yystr
)
1539 char const *yyp
= yystr
;
1546 goto do_not_strip_quotes
;
1550 goto do_not_strip_quotes
;
1563 do_not_strip_quotes
: ;
1567 return yystrlen (yystr
);
1569 return yystpcpy (yyres
, yystr
) - yyres
;
1573 /* Copy into YYRESULT an error message about the unexpected token
1574 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1575 including the terminating null byte. If YYRESULT is null, do not
1576 copy anything; just return the number of bytes that would be
1577 copied. As a special case, return 0 if an ordinary "syntax error"
1578 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1579 size calculation. */
1581 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1583 int yyn
= yypact
[yystate
];
1585 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1589 int yytype
= YYTRANSLATE (yychar
);
1590 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1591 YYSIZE_T yysize
= yysize0
;
1593 int yysize_overflow
= 0;
1594 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1595 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1599 /* This is so xgettext sees the translatable formats that are
1600 constructed on the fly. */
1601 YY_("syntax error, unexpected %s");
1602 YY_("syntax error, unexpected %s, expecting %s");
1603 YY_("syntax error, unexpected %s, expecting %s or %s");
1604 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1605 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1609 static char const yyunexpected
[] = "syntax error, unexpected %s";
1610 static char const yyexpecting
[] = ", expecting %s";
1611 static char const yyor
[] = " or %s";
1612 char yyformat
[sizeof yyunexpected
1613 + sizeof yyexpecting
- 1
1614 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1615 * (sizeof yyor
- 1))];
1616 char const *yyprefix
= yyexpecting
;
1618 /* Start YYX at -YYN if negative to avoid negative indexes in
1620 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1622 /* Stay within bounds of both yycheck and yytname. */
1623 int yychecklim
= YYLAST
- yyn
+ 1;
1624 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1627 yyarg
[0] = yytname
[yytype
];
1628 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1630 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1631 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1633 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1637 yyformat
[sizeof yyunexpected
- 1] = '\0';
1640 yyarg
[yycount
++] = yytname
[yyx
];
1641 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1642 yysize_overflow
|= (yysize1
< yysize
);
1644 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1648 yyf
= YY_(yyformat
);
1649 yysize1
= yysize
+ yystrlen (yyf
);
1650 yysize_overflow
|= (yysize1
< yysize
);
1653 if (yysize_overflow
)
1654 return YYSIZE_MAXIMUM
;
1658 /* Avoid sprintf, as that infringes on the user's name space.
1659 Don't have undefined behavior even if the translation
1660 produced a string with the wrong number of "%s"s. */
1661 char *yyp
= yyresult
;
1663 while ((*yyp
= *yyf
) != '\0')
1665 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1667 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1680 #endif /* YYERROR_VERBOSE */
1683 /*-----------------------------------------------.
1684 | Release the memory associated to this symbol. |
1685 `-----------------------------------------------*/
1688 #if (defined __STDC__ || defined __C99__FUNC__ \
1689 || defined __cplusplus || defined _MSC_VER)
1691 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1694 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1698 YYLTYPE
*yylocationp
;
1699 struct asm_parser_state
*state
;
1703 YYUSE (yylocationp
);
1708 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1718 /* Prevent warnings from -Wmissing-prototypes. */
1719 #ifdef YYPARSE_PARAM
1720 #if defined __STDC__ || defined __cplusplus
1721 int yyparse (void *YYPARSE_PARAM
);
1725 #else /* ! YYPARSE_PARAM */
1726 #if defined __STDC__ || defined __cplusplus
1727 int yyparse (struct asm_parser_state
*state
);
1731 #endif /* ! YYPARSE_PARAM */
1737 /*-------------------------.
1738 | yyparse or yypush_parse. |
1739 `-------------------------*/
1741 #ifdef YYPARSE_PARAM
1742 #if (defined __STDC__ || defined __C99__FUNC__ \
1743 || defined __cplusplus || defined _MSC_VER)
1745 yyparse (void *YYPARSE_PARAM
)
1748 yyparse (YYPARSE_PARAM
)
1749 void *YYPARSE_PARAM
;
1751 #else /* ! YYPARSE_PARAM */
1752 #if (defined __STDC__ || defined __C99__FUNC__ \
1753 || defined __cplusplus || defined _MSC_VER)
1755 yyparse (struct asm_parser_state
*state
)
1759 struct asm_parser_state
*state
;
1763 /* The lookahead symbol. */
1766 /* The semantic value of the lookahead symbol. */
1769 /* Location data for the lookahead symbol. */
1772 /* Number of syntax errors so far. */
1776 /* Number of tokens to shift before error messages enabled. */
1779 /* The stacks and their tools:
1780 `yyss': related to states.
1781 `yyvs': related to semantic values.
1782 `yyls': related to locations.
1784 Refer to the stacks thru separate pointers, to allow yyoverflow
1785 to reallocate them elsewhere. */
1787 /* The state stack. */
1788 yytype_int16 yyssa
[YYINITDEPTH
];
1790 yytype_int16
*yyssp
;
1792 /* The semantic value stack. */
1793 YYSTYPE yyvsa
[YYINITDEPTH
];
1797 /* The location stack. */
1798 YYLTYPE yylsa
[YYINITDEPTH
];
1802 /* The locations where the error started and ended. */
1803 YYLTYPE yyerror_range
[2];
1805 YYSIZE_T yystacksize
;
1809 /* Lookahead token as an internal (translated) token number. */
1811 /* The variables used to return semantic value and location from the
1817 /* Buffer for error messages, and its allocated size. */
1819 char *yymsg
= yymsgbuf
;
1820 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1823 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1825 /* The number of symbols on the RHS of the reduced rule.
1826 Keep to zero when no symbol should be popped. */
1833 yystacksize
= YYINITDEPTH
;
1835 YYDPRINTF ((stderr
, "Starting parse\n"));
1840 yychar
= YYEMPTY
; /* Cause a token to be read. */
1842 /* Initialize stack pointers.
1843 Waste one element of value and location stack
1844 so that they stay on the same level as the state stack.
1845 The wasted elements are never initialized. */
1850 #if YYLTYPE_IS_TRIVIAL
1851 /* Initialize the default location before parsing starts. */
1852 yylloc
.first_line
= yylloc
.last_line
= 1;
1853 yylloc
.first_column
= yylloc
.last_column
= 1;
1858 /*------------------------------------------------------------.
1859 | yynewstate -- Push a new state, which is found in yystate. |
1860 `------------------------------------------------------------*/
1862 /* In all cases, when you get here, the value and location stacks
1863 have just been pushed. So pushing a state here evens the stacks. */
1869 if (yyss
+ yystacksize
- 1 <= yyssp
)
1871 /* Get the current used size of the three stacks, in elements. */
1872 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1876 /* Give user a chance to reallocate the stack. Use copies of
1877 these so that the &'s don't force the real ones into
1879 YYSTYPE
*yyvs1
= yyvs
;
1880 yytype_int16
*yyss1
= yyss
;
1881 YYLTYPE
*yyls1
= yyls
;
1883 /* Each stack pointer address is followed by the size of the
1884 data in use in that stack, in bytes. This used to be a
1885 conditional around just the two extra args, but that might
1886 be undefined if yyoverflow is a macro. */
1887 yyoverflow (YY_("memory exhausted"),
1888 &yyss1
, yysize
* sizeof (*yyssp
),
1889 &yyvs1
, yysize
* sizeof (*yyvsp
),
1890 &yyls1
, yysize
* sizeof (*yylsp
),
1897 #else /* no yyoverflow */
1898 # ifndef YYSTACK_RELOCATE
1899 goto yyexhaustedlab
;
1901 /* Extend the stack our own way. */
1902 if (YYMAXDEPTH
<= yystacksize
)
1903 goto yyexhaustedlab
;
1905 if (YYMAXDEPTH
< yystacksize
)
1906 yystacksize
= YYMAXDEPTH
;
1909 yytype_int16
*yyss1
= yyss
;
1910 union yyalloc
*yyptr
=
1911 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1913 goto yyexhaustedlab
;
1914 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1915 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1916 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1917 # undef YYSTACK_RELOCATE
1919 YYSTACK_FREE (yyss1
);
1922 #endif /* no yyoverflow */
1924 yyssp
= yyss
+ yysize
- 1;
1925 yyvsp
= yyvs
+ yysize
- 1;
1926 yylsp
= yyls
+ yysize
- 1;
1928 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1929 (unsigned long int) yystacksize
));
1931 if (yyss
+ yystacksize
- 1 <= yyssp
)
1935 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1937 if (yystate
== YYFINAL
)
1947 /* Do appropriate processing given the current state. Read a
1948 lookahead token if we need one and don't already have one. */
1950 /* First try to decide what to do without reference to lookahead token. */
1951 yyn
= yypact
[yystate
];
1952 if (yyn
== YYPACT_NINF
)
1955 /* Not known => get a lookahead token if don't already have one. */
1957 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1958 if (yychar
== YYEMPTY
)
1960 YYDPRINTF ((stderr
, "Reading a token: "));
1964 if (yychar
<= YYEOF
)
1966 yychar
= yytoken
= YYEOF
;
1967 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1971 yytoken
= YYTRANSLATE (yychar
);
1972 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1975 /* If the proper action on seeing token YYTOKEN is to reduce or to
1976 detect an error, take that action. */
1978 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1983 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1989 /* Count tokens shifted since error; after three, turn off error
1994 /* Shift the lookahead token. */
1995 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1997 /* Discard the shifted token. */
2006 /*-----------------------------------------------------------.
2007 | yydefault -- do the default action for the current state. |
2008 `-----------------------------------------------------------*/
2010 yyn
= yydefact
[yystate
];
2016 /*-----------------------------.
2017 | yyreduce -- Do a reduction. |
2018 `-----------------------------*/
2020 /* yyn is the number of a rule to reduce with. */
2023 /* If YYLEN is nonzero, implement the default value of the action:
2026 Otherwise, the following line sets YYVAL to garbage.
2027 This behavior is undocumented and Bison
2028 users should not rely upon it. Assigning to YYVAL
2029 unconditionally makes the parser a bit smaller, and it avoids a
2030 GCC warning that YYVAL may be used uninitialized. */
2031 yyval
= yyvsp
[1-yylen
];
2033 /* Default location. */
2034 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2035 YY_REDUCE_PRINT (yyn
);
2040 /* Line 1455 of yacc.c */
2041 #line 251 "program_parse.y"
2043 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2044 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2047 state
->mode
= ARB_vertex
;
2053 /* Line 1455 of yacc.c */
2054 #line 259 "program_parse.y"
2056 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2057 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2059 state
->mode
= ARB_fragment
;
2065 /* Line 1455 of yacc.c */
2066 #line 272 "program_parse.y"
2070 if (state
->mode
== ARB_vertex
) {
2071 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2072 } else if (state
->mode
== ARB_fragment
) {
2073 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2078 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid option string");
2086 /* Line 1455 of yacc.c */
2087 #line 294 "program_parse.y"
2089 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2090 if (state
->inst_tail
== NULL
) {
2091 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2093 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2096 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2097 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2099 state
->prog
->NumInstructions
++;
2106 /* Line 1455 of yacc.c */
2107 #line 312 "program_parse.y"
2109 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2110 state
->prog
->NumAluInstructions
++;
2116 /* Line 1455 of yacc.c */
2117 #line 317 "program_parse.y"
2119 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2120 state
->prog
->NumTexInstructions
++;
2126 /* Line 1455 of yacc.c */
2127 #line 337 "program_parse.y"
2129 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2135 /* Line 1455 of yacc.c */
2136 #line 343 "program_parse.y"
2138 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2139 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2145 /* Line 1455 of yacc.c */
2146 #line 350 "program_parse.y"
2148 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2149 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2155 /* Line 1455 of yacc.c */
2156 #line 357 "program_parse.y"
2158 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (6)].temp_inst
).Opcode
, & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), & (yyvsp
[(6) - (6)].src_reg
), NULL
);
2159 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2165 /* Line 1455 of yacc.c */
2166 #line 365 "program_parse.y"
2168 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (6)].temp_inst
).Opcode
, & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), & (yyvsp
[(6) - (6)].src_reg
), NULL
);
2169 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2175 /* Line 1455 of yacc.c */
2176 #line 373 "program_parse.y"
2178 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (8)].temp_inst
).Opcode
, & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), & (yyvsp
[(6) - (8)].src_reg
), & (yyvsp
[(8) - (8)].src_reg
));
2179 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2185 /* Line 1455 of yacc.c */
2186 #line 380 "program_parse.y"
2188 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (8)].temp_inst
).Opcode
, & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2189 if ((yyval
.inst
) != NULL
) {
2190 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2191 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2192 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2194 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= (1U << (yyvsp
[(8) - (8)].integer
));
2201 /* Line 1455 of yacc.c */
2202 #line 393 "program_parse.y"
2204 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2205 state
->fragment
.UsesKill
= 1;
2211 /* Line 1455 of yacc.c */
2212 #line 400 "program_parse.y"
2214 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2220 /* Line 1455 of yacc.c */
2221 #line 405 "program_parse.y"
2222 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2227 /* Line 1455 of yacc.c */
2228 #line 406 "program_parse.y"
2229 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2234 /* Line 1455 of yacc.c */
2235 #line 407 "program_parse.y"
2236 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2241 /* Line 1455 of yacc.c */
2242 #line 408 "program_parse.y"
2243 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2248 /* Line 1455 of yacc.c */
2249 #line 409 "program_parse.y"
2250 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2255 /* Line 1455 of yacc.c */
2256 #line 413 "program_parse.y"
2258 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2259 * FIXME: to the existing swizzle?
2261 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2263 (yyval
.inst
) = asm_instruction_ctor(OPCODE_SWZ
, & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2264 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2270 /* Line 1455 of yacc.c */
2271 #line 425 "program_parse.y"
2273 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2275 if ((yyvsp
[(1) - (3)].negate
)) {
2276 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2279 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2280 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2286 /* Line 1455 of yacc.c */
2287 #line 438 "program_parse.y"
2289 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2291 if ((yyvsp
[(1) - (3)].negate
)) {
2292 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2295 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2296 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2302 /* Line 1455 of yacc.c */
2303 #line 451 "program_parse.y"
2305 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
2306 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2308 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2309 /* Technically speaking, this should check that it is in
2310 * vertex program mode. However, PositionInvariant can never be
2311 * set in fragment program mode, so it is somewhat irrelevant.
2313 if (state
->option
.PositionInvariant
2314 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2315 yyerror(& (yylsp
[(1) - (2)]), state
, "position-invariant programs cannot "
2320 state
->prog
->OutputsWritten
|= (1U << (yyval
.dst_reg
).Index
);
2327 /* Line 1455 of yacc.c */
2328 #line 473 "program_parse.y"
2330 init_dst_reg(& (yyval
.dst_reg
));
2331 (yyval
.dst_reg
).File
= PROGRAM_ADDRESS
;
2332 (yyval
.dst_reg
).Index
= 0;
2333 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2339 /* Line 1455 of yacc.c */
2340 #line 482 "program_parse.y"
2342 (yyval
.swiz_mask
).swizzle
= MAKE_SWIZZLE4((yyvsp
[(1) - (7)].swiz_mask
).swizzle
, (yyvsp
[(3) - (7)].swiz_mask
).swizzle
,
2343 (yyvsp
[(5) - (7)].swiz_mask
).swizzle
, (yyvsp
[(7) - (7)].swiz_mask
).swizzle
);
2344 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].swiz_mask
).mask
) | ((yyvsp
[(3) - (7)].swiz_mask
).mask
<< 1) | ((yyvsp
[(5) - (7)].swiz_mask
).mask
<< 2)
2345 | ((yyvsp
[(7) - (7)].swiz_mask
).mask
<< 3);
2351 /* Line 1455 of yacc.c */
2352 #line 491 "program_parse.y"
2354 (yyval
.swiz_mask
).swizzle
= (yyvsp
[(2) - (2)].integer
);
2355 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2361 /* Line 1455 of yacc.c */
2362 #line 498 "program_parse.y"
2364 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2365 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2369 (yyval
.integer
) = ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2375 /* Line 1455 of yacc.c */
2376 #line 507 "program_parse.y"
2378 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2379 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2383 switch ((yyvsp
[(1) - (1)].string
)[0]) {
2385 (yyval
.integer
) = SWIZZLE_X
;
2388 (yyval
.integer
) = SWIZZLE_Y
;
2391 (yyval
.integer
) = SWIZZLE_Z
;
2394 (yyval
.integer
) = SWIZZLE_W
;
2397 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2406 /* Line 1455 of yacc.c */
2407 #line 535 "program_parse.y"
2409 struct asm_symbol
*const s
= (struct asm_symbol
*)
2410 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2413 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2415 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2416 && (s
->type
!= at_attrib
)) {
2417 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2419 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2420 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2424 init_src_reg(& (yyval
.src_reg
));
2427 (yyval
.src_reg
).Base
.File
= PROGRAM_TEMPORARY
;
2428 (yyval
.src_reg
).Base
.Index
= s
->temp_binding
;
2431 (yyval
.src_reg
).Base
.File
= s
->param_binding_type
;
2432 (yyval
.src_reg
).Base
.Index
= s
->param_binding_begin
;
2435 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2436 (yyval
.src_reg
).Base
.Index
= s
->attrib_binding
;
2437 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2439 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2453 /* Line 1455 of yacc.c */
2454 #line 577 "program_parse.y"
2456 init_src_reg(& (yyval
.src_reg
));
2457 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2458 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].attrib
);
2459 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2461 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2469 /* Line 1455 of yacc.c */
2470 #line 588 "program_parse.y"
2472 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2473 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2474 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2478 init_src_reg(& (yyval
.src_reg
));
2479 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2481 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2482 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2484 (yyval
.src_reg
).Base
.RelAddr
= 1;
2485 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2486 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2488 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2495 /* Line 1455 of yacc.c */
2496 #line 609 "program_parse.y"
2498 init_src_reg(& (yyval
.src_reg
));
2499 (yyval
.src_reg
).Base
.File
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2500 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2502 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
;
2508 /* Line 1455 of yacc.c */
2509 #line 619 "program_parse.y"
2511 init_dst_reg(& (yyval
.dst_reg
));
2512 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2513 (yyval
.dst_reg
).Index
= (yyvsp
[(1) - (1)].result
);
2519 /* Line 1455 of yacc.c */
2520 #line 625 "program_parse.y"
2522 struct asm_symbol
*const s
= (struct asm_symbol
*)
2523 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2526 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2528 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2529 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2533 init_dst_reg(& (yyval
.dst_reg
));
2534 if (s
->type
== at_temp
) {
2535 (yyval
.dst_reg
).File
= PROGRAM_TEMPORARY
;
2536 (yyval
.dst_reg
).Index
= s
->temp_binding
;
2538 (yyval
.dst_reg
).File
= s
->param_binding_type
;
2539 (yyval
.dst_reg
).Index
= s
->param_binding_begin
;
2546 /* Line 1455 of yacc.c */
2547 #line 649 "program_parse.y"
2549 struct asm_symbol
*const s
= (struct asm_symbol
*)
2550 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2553 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2555 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2556 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2566 /* Line 1455 of yacc.c */
2567 #line 668 "program_parse.y"
2569 init_src_reg(& (yyval
.src_reg
));
2570 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2576 /* Line 1455 of yacc.c */
2577 #line 675 "program_parse.y"
2579 /* FINISHME: Add support for multiple address registers.
2581 /* FINISHME: Add support for 4-component address registers.
2583 init_src_reg(& (yyval
.src_reg
));
2584 (yyval
.src_reg
).Base
.RelAddr
= 1;
2585 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2591 /* Line 1455 of yacc.c */
2592 #line 686 "program_parse.y"
2593 { (yyval
.integer
) = 0; ;}
2598 /* Line 1455 of yacc.c */
2599 #line 687 "program_parse.y"
2600 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2605 /* Line 1455 of yacc.c */
2606 #line 688 "program_parse.y"
2607 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2612 /* Line 1455 of yacc.c */
2613 #line 692 "program_parse.y"
2615 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2616 yyerror(& (yylsp
[(1) - (1)]), state
,
2617 "relative address offset too large (positive)");
2620 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2627 /* Line 1455 of yacc.c */
2628 #line 704 "program_parse.y"
2630 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2631 yyerror(& (yylsp
[(1) - (1)]), state
,
2632 "relative address offset too large (negative)");
2635 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2642 /* Line 1455 of yacc.c */
2643 #line 716 "program_parse.y"
2645 struct asm_symbol
*const s
= (struct asm_symbol
*)
2646 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2649 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
2651 } else if (s
->type
!= at_address
) {
2652 yyerror(& (yylsp
[(1) - (1)]), state
,
2653 "invalid variable for indexed array access");
2663 /* Line 1455 of yacc.c */
2664 #line 734 "program_parse.y"
2666 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2667 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
2670 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2677 /* Line 1455 of yacc.c */
2678 #line 745 "program_parse.y"
2680 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2681 yyerror(& (yylsp
[(1) - (1)]), state
,
2682 "address register write mask must be \".x\"");
2685 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2692 /* Line 1455 of yacc.c */
2693 #line 761 "program_parse.y"
2694 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2699 /* Line 1455 of yacc.c */
2700 #line 765 "program_parse.y"
2701 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2706 /* Line 1455 of yacc.c */
2707 #line 777 "program_parse.y"
2709 struct asm_symbol
*const s
=
2710 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
2715 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
2716 state
->InputsBound
|= (1U << s
->attrib_binding
);
2718 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
2727 /* Line 1455 of yacc.c */
2728 #line 795 "program_parse.y"
2730 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2736 /* Line 1455 of yacc.c */
2737 #line 799 "program_parse.y"
2739 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2745 /* Line 1455 of yacc.c */
2746 #line 805 "program_parse.y"
2748 (yyval
.attrib
) = VERT_ATTRIB_POS
;
2754 /* Line 1455 of yacc.c */
2755 #line 809 "program_parse.y"
2757 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
2763 /* Line 1455 of yacc.c */
2764 #line 813 "program_parse.y"
2766 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
2772 /* Line 1455 of yacc.c */
2773 #line 817 "program_parse.y"
2775 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
2776 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
2780 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
2786 /* Line 1455 of yacc.c */
2787 #line 826 "program_parse.y"
2789 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
2790 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
2794 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
2800 /* Line 1455 of yacc.c */
2801 #line 835 "program_parse.y"
2803 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
2809 /* Line 1455 of yacc.c */
2810 #line 839 "program_parse.y"
2812 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
2819 /* Line 1455 of yacc.c */
2820 #line 844 "program_parse.y"
2822 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
2828 /* Line 1455 of yacc.c */
2829 #line 850 "program_parse.y"
2831 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
2832 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
2836 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2842 /* Line 1455 of yacc.c */
2843 #line 864 "program_parse.y"
2845 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
2851 /* Line 1455 of yacc.c */
2852 #line 868 "program_parse.y"
2854 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
2860 /* Line 1455 of yacc.c */
2861 #line 872 "program_parse.y"
2863 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
2869 /* Line 1455 of yacc.c */
2870 #line 876 "program_parse.y"
2872 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
2878 /* Line 1455 of yacc.c */
2879 #line 884 "program_parse.y"
2881 struct asm_symbol
*const s
=
2882 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
2887 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
2888 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
2889 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
2890 s
->param_is_array
= 0;
2897 /* Line 1455 of yacc.c */
2898 #line 900 "program_parse.y"
2900 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
2901 yyerror(& (yylsp
[(4) - (6)]), state
,
2902 "parameter array size and number of bindings must match");
2905 struct asm_symbol
*const s
=
2906 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
2911 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
2912 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
2913 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
2914 s
->param_is_array
= 1;
2922 /* Line 1455 of yacc.c */
2923 #line 922 "program_parse.y"
2925 (yyval
.integer
) = 0;
2931 /* Line 1455 of yacc.c */
2932 #line 926 "program_parse.y"
2934 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxParameters
)) {
2935 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
2938 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2945 /* Line 1455 of yacc.c */
2946 #line 937 "program_parse.y"
2948 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
2954 /* Line 1455 of yacc.c */
2955 #line 943 "program_parse.y"
2957 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
2963 /* Line 1455 of yacc.c */
2964 #line 950 "program_parse.y"
2966 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
2967 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
2973 /* Line 1455 of yacc.c */
2974 #line 957 "program_parse.y"
2976 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2977 (yyval
.temp_sym
).param_binding_begin
= ~0;
2978 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2984 /* Line 1455 of yacc.c */
2985 #line 963 "program_parse.y"
2987 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2988 (yyval
.temp_sym
).param_binding_begin
= ~0;
2989 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2995 /* Line 1455 of yacc.c */
2996 #line 969 "program_parse.y"
2998 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2999 (yyval
.temp_sym
).param_binding_begin
= ~0;
3000 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3006 /* Line 1455 of yacc.c */
3007 #line 977 "program_parse.y"
3009 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3010 (yyval
.temp_sym
).param_binding_begin
= ~0;
3011 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3017 /* Line 1455 of yacc.c */
3018 #line 983 "program_parse.y"
3020 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3021 (yyval
.temp_sym
).param_binding_begin
= ~0;
3022 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3028 /* Line 1455 of yacc.c */
3029 #line 989 "program_parse.y"
3031 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3032 (yyval
.temp_sym
).param_binding_begin
= ~0;
3033 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3039 /* Line 1455 of yacc.c */
3040 #line 997 "program_parse.y"
3042 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3043 (yyval
.temp_sym
).param_binding_begin
= ~0;
3044 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3050 /* Line 1455 of yacc.c */
3051 #line 1003 "program_parse.y"
3053 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3054 (yyval
.temp_sym
).param_binding_begin
= ~0;
3055 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3061 /* Line 1455 of yacc.c */
3062 #line 1009 "program_parse.y"
3064 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3065 (yyval
.temp_sym
).param_binding_begin
= ~0;
3066 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3072 /* Line 1455 of yacc.c */
3073 #line 1016 "program_parse.y"
3074 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3079 /* Line 1455 of yacc.c */
3080 #line 1017 "program_parse.y"
3081 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3086 /* Line 1455 of yacc.c */
3087 #line 1020 "program_parse.y"
3088 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3093 /* Line 1455 of yacc.c */
3094 #line 1021 "program_parse.y"
3095 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3100 /* Line 1455 of yacc.c */
3101 #line 1022 "program_parse.y"
3102 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3107 /* Line 1455 of yacc.c */
3108 #line 1023 "program_parse.y"
3109 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3114 /* Line 1455 of yacc.c */
3115 #line 1024 "program_parse.y"
3116 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3121 /* Line 1455 of yacc.c */
3122 #line 1025 "program_parse.y"
3123 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3128 /* Line 1455 of yacc.c */
3129 #line 1026 "program_parse.y"
3130 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3135 /* Line 1455 of yacc.c */
3136 #line 1027 "program_parse.y"
3137 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3142 /* Line 1455 of yacc.c */
3143 #line 1028 "program_parse.y"
3144 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3149 /* Line 1455 of yacc.c */
3150 #line 1029 "program_parse.y"
3151 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3156 /* Line 1455 of yacc.c */
3157 #line 1033 "program_parse.y"
3159 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3160 (yyval
.state
)[0] = STATE_MATERIAL
;
3161 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3162 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3168 /* Line 1455 of yacc.c */
3169 #line 1042 "program_parse.y"
3171 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3177 /* Line 1455 of yacc.c */
3178 #line 1046 "program_parse.y"
3180 (yyval
.integer
) = STATE_EMISSION
;
3186 /* Line 1455 of yacc.c */
3187 #line 1050 "program_parse.y"
3189 (yyval
.integer
) = STATE_SHININESS
;
3195 /* Line 1455 of yacc.c */
3196 #line 1056 "program_parse.y"
3198 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3199 (yyval
.state
)[0] = STATE_LIGHT
;
3200 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3201 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3207 /* Line 1455 of yacc.c */
3208 #line 1065 "program_parse.y"
3210 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3216 /* Line 1455 of yacc.c */
3217 #line 1069 "program_parse.y"
3219 (yyval
.integer
) = STATE_POSITION
;
3225 /* Line 1455 of yacc.c */
3226 #line 1073 "program_parse.y"
3228 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3229 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3233 (yyval
.integer
) = STATE_ATTENUATION
;
3239 /* Line 1455 of yacc.c */
3240 #line 1082 "program_parse.y"
3242 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3248 /* Line 1455 of yacc.c */
3249 #line 1086 "program_parse.y"
3251 (yyval
.integer
) = STATE_HALF_VECTOR
;
3257 /* Line 1455 of yacc.c */
3258 #line 1092 "program_parse.y"
3260 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3266 /* Line 1455 of yacc.c */
3267 #line 1098 "program_parse.y"
3269 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3270 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3276 /* Line 1455 of yacc.c */
3277 #line 1105 "program_parse.y"
3279 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3280 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3286 /* Line 1455 of yacc.c */
3287 #line 1110 "program_parse.y"
3289 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3290 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3291 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3297 /* Line 1455 of yacc.c */
3298 #line 1118 "program_parse.y"
3300 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3301 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3302 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3303 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3304 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3310 /* Line 1455 of yacc.c */
3311 #line 1130 "program_parse.y"
3313 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3314 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3315 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3321 /* Line 1455 of yacc.c */
3322 #line 1138 "program_parse.y"
3324 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3330 /* Line 1455 of yacc.c */
3331 #line 1144 "program_parse.y"
3333 (yyval
.integer
) = STATE_AMBIENT
;
3339 /* Line 1455 of yacc.c */
3340 #line 1148 "program_parse.y"
3342 (yyval
.integer
) = STATE_DIFFUSE
;
3348 /* Line 1455 of yacc.c */
3349 #line 1152 "program_parse.y"
3351 (yyval
.integer
) = STATE_SPECULAR
;
3357 /* Line 1455 of yacc.c */
3358 #line 1158 "program_parse.y"
3360 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3361 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3365 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3371 /* Line 1455 of yacc.c */
3372 #line 1169 "program_parse.y"
3374 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3375 (yyval
.state
)[0] = STATE_TEXGEN
;
3376 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3377 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3383 /* Line 1455 of yacc.c */
3384 #line 1178 "program_parse.y"
3386 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3392 /* Line 1455 of yacc.c */
3393 #line 1182 "program_parse.y"
3395 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3401 /* Line 1455 of yacc.c */
3402 #line 1187 "program_parse.y"
3404 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3410 /* Line 1455 of yacc.c */
3411 #line 1191 "program_parse.y"
3413 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3419 /* Line 1455 of yacc.c */
3420 #line 1195 "program_parse.y"
3422 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3428 /* Line 1455 of yacc.c */
3429 #line 1199 "program_parse.y"
3431 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3437 /* Line 1455 of yacc.c */
3438 #line 1205 "program_parse.y"
3440 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3441 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3447 /* Line 1455 of yacc.c */
3448 #line 1212 "program_parse.y"
3450 (yyval
.integer
) = STATE_FOG_COLOR
;
3456 /* Line 1455 of yacc.c */
3457 #line 1216 "program_parse.y"
3459 (yyval
.integer
) = STATE_FOG_PARAMS
;
3465 /* Line 1455 of yacc.c */
3466 #line 1222 "program_parse.y"
3468 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3469 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3470 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3476 /* Line 1455 of yacc.c */
3477 #line 1230 "program_parse.y"
3479 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3480 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3484 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3490 /* Line 1455 of yacc.c */
3491 #line 1241 "program_parse.y"
3493 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3494 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3500 /* Line 1455 of yacc.c */
3501 #line 1248 "program_parse.y"
3503 (yyval
.integer
) = STATE_POINT_SIZE
;
3509 /* Line 1455 of yacc.c */
3510 #line 1252 "program_parse.y"
3512 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3518 /* Line 1455 of yacc.c */
3519 #line 1258 "program_parse.y"
3521 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
3522 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
3523 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3524 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3525 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
3531 /* Line 1455 of yacc.c */
3532 #line 1268 "program_parse.y"
3534 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
3535 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
3536 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
3537 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
3538 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
3544 /* Line 1455 of yacc.c */
3545 #line 1278 "program_parse.y"
3547 (yyval
.state
)[2] = 0;
3548 (yyval
.state
)[3] = 3;
3554 /* Line 1455 of yacc.c */
3555 #line 1283 "program_parse.y"
3557 /* It seems logical that the matrix row range specifier would have
3558 * to specify a range or more than one row (i.e., $5 > $3).
3559 * However, the ARB_vertex_program spec says "a program will fail
3560 * to load if <a> is greater than <b>." This means that $3 == $5
3563 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
3564 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
3568 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
3569 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
3575 /* Line 1455 of yacc.c */
3576 #line 1301 "program_parse.y"
3578 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
3579 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
3580 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3586 /* Line 1455 of yacc.c */
3587 #line 1309 "program_parse.y"
3589 (yyval
.integer
) = 0;
3595 /* Line 1455 of yacc.c */
3596 #line 1313 "program_parse.y"
3598 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3604 /* Line 1455 of yacc.c */
3605 #line 1319 "program_parse.y"
3607 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
3613 /* Line 1455 of yacc.c */
3614 #line 1323 "program_parse.y"
3616 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
3622 /* Line 1455 of yacc.c */
3623 #line 1327 "program_parse.y"
3625 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
3631 /* Line 1455 of yacc.c */
3632 #line 1333 "program_parse.y"
3634 if ((yyvsp
[(1) - (1)].integer
) > 3) {
3635 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
3639 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3645 /* Line 1455 of yacc.c */
3646 #line 1344 "program_parse.y"
3648 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
3649 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3655 /* Line 1455 of yacc.c */
3656 #line 1349 "program_parse.y"
3658 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
3659 (yyval
.state
)[1] = 0;
3665 /* Line 1455 of yacc.c */
3666 #line 1354 "program_parse.y"
3668 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
3669 (yyval
.state
)[1] = 0;
3675 /* Line 1455 of yacc.c */
3676 #line 1359 "program_parse.y"
3678 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
3679 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3685 /* Line 1455 of yacc.c */
3686 #line 1364 "program_parse.y"
3688 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3695 /* Line 1455 of yacc.c */
3696 #line 1369 "program_parse.y"
3698 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
3699 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
3705 /* Line 1455 of yacc.c */
3706 #line 1376 "program_parse.y"
3708 (yyval
.integer
) = 0;
3714 /* Line 1455 of yacc.c */
3715 #line 1380 "program_parse.y"
3717 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3723 /* Line 1455 of yacc.c */
3724 #line 1385 "program_parse.y"
3726 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
3729 if ((yyvsp
[(1) - (1)].integer
) != 0) {
3730 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
3734 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3740 /* Line 1455 of yacc.c */
3741 #line 1398 "program_parse.y"
3743 /* Since GL_ARB_matrix_palette isn't supported, just let any value
3744 * through here. The error will be generated later.
3746 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3752 /* Line 1455 of yacc.c */
3753 #line 1406 "program_parse.y"
3755 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
3756 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
3760 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3766 /* Line 1455 of yacc.c */
3767 #line 1423 "program_parse.y"
3769 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3770 (yyval
.state
)[0] = state
->state_param_enum
;
3771 (yyval
.state
)[1] = STATE_ENV
;
3772 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
3773 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
3779 /* Line 1455 of yacc.c */
3780 #line 1433 "program_parse.y"
3782 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
3783 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
3789 /* Line 1455 of yacc.c */
3790 #line 1438 "program_parse.y"
3792 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
3793 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
3799 /* Line 1455 of yacc.c */
3800 #line 1445 "program_parse.y"
3802 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3803 (yyval
.state
)[0] = state
->state_param_enum
;
3804 (yyval
.state
)[1] = STATE_ENV
;
3805 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3806 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3812 /* Line 1455 of yacc.c */
3813 #line 1455 "program_parse.y"
3815 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3816 (yyval
.state
)[0] = state
->state_param_enum
;
3817 (yyval
.state
)[1] = STATE_LOCAL
;
3818 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
3819 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
3825 /* Line 1455 of yacc.c */
3826 #line 1464 "program_parse.y"
3828 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
3829 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
3835 /* Line 1455 of yacc.c */
3836 #line 1469 "program_parse.y"
3838 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
3839 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
3845 /* Line 1455 of yacc.c */
3846 #line 1476 "program_parse.y"
3848 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3849 (yyval
.state
)[0] = state
->state_param_enum
;
3850 (yyval
.state
)[1] = STATE_LOCAL
;
3851 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3852 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3858 /* Line 1455 of yacc.c */
3859 #line 1486 "program_parse.y"
3861 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
3862 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
3865 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3871 /* Line 1455 of yacc.c */
3872 #line 1496 "program_parse.y"
3874 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
3875 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
3878 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3884 /* Line 1455 of yacc.c */
3885 #line 1511 "program_parse.y"
3887 (yyval
.vector
).count
= 1;
3888 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
3894 /* Line 1455 of yacc.c */
3895 #line 1518 "program_parse.y"
3897 (yyval
.vector
).count
= 1;
3898 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
3904 /* Line 1455 of yacc.c */
3905 #line 1523 "program_parse.y"
3907 (yyval
.vector
).count
= 1;
3908 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
3914 /* Line 1455 of yacc.c */
3915 #line 1530 "program_parse.y"
3917 (yyval
.vector
).count
= 1;
3918 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
3919 (yyval
.vector
).data
[1] = 0.0f
;
3920 (yyval
.vector
).data
[2] = 0.0f
;
3921 (yyval
.vector
).data
[3] = 0.0f
;
3927 /* Line 1455 of yacc.c */
3928 #line 1538 "program_parse.y"
3930 (yyval
.vector
).count
= 2;
3931 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
3932 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
3933 (yyval
.vector
).data
[2] = 0.0f
;
3934 (yyval
.vector
).data
[3] = 0.0f
;
3940 /* Line 1455 of yacc.c */
3941 #line 1547 "program_parse.y"
3943 (yyval
.vector
).count
= 3;
3944 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
3945 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
3946 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
3947 (yyval
.vector
).data
[3] = 0.0f
;
3953 /* Line 1455 of yacc.c */
3954 #line 1556 "program_parse.y"
3956 (yyval
.vector
).count
= 4;
3957 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
3958 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
3959 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
3960 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
3966 /* Line 1455 of yacc.c */
3967 #line 1566 "program_parse.y"
3969 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
3975 /* Line 1455 of yacc.c */
3976 #line 1570 "program_parse.y"
3978 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
3984 /* Line 1455 of yacc.c */
3985 #line 1575 "program_parse.y"
3986 { (yyval
.negate
) = FALSE
; ;}
3991 /* Line 1455 of yacc.c */
3992 #line 1576 "program_parse.y"
3993 { (yyval
.negate
) = TRUE
; ;}
3998 /* Line 1455 of yacc.c */
3999 #line 1577 "program_parse.y"
4000 { (yyval
.negate
) = FALSE
; ;}
4005 /* Line 1455 of yacc.c */
4006 #line 1580 "program_parse.y"
4007 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4012 /* Line 1455 of yacc.c */
4013 #line 1583 "program_parse.y"
4014 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4019 /* Line 1455 of yacc.c */
4020 #line 1587 "program_parse.y"
4022 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4030 /* Line 1455 of yacc.c */
4031 #line 1593 "program_parse.y"
4033 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4041 /* Line 1455 of yacc.c */
4042 #line 1601 "program_parse.y"
4044 struct asm_symbol
*const s
=
4045 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_output
, & (yylsp
[(2) - (4)]));
4050 s
->output_binding
= (yyvsp
[(4) - (4)].result
);
4057 /* Line 1455 of yacc.c */
4058 #line 1614 "program_parse.y"
4060 if (state
->mode
== ARB_vertex
) {
4061 (yyval
.result
) = VERT_RESULT_HPOS
;
4063 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4071 /* Line 1455 of yacc.c */
4072 #line 1623 "program_parse.y"
4074 if (state
->mode
== ARB_vertex
) {
4075 (yyval
.result
) = VERT_RESULT_FOGC
;
4077 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4085 /* Line 1455 of yacc.c */
4086 #line 1632 "program_parse.y"
4088 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4094 /* Line 1455 of yacc.c */
4095 #line 1636 "program_parse.y"
4097 if (state
->mode
== ARB_vertex
) {
4098 (yyval
.result
) = VERT_RESULT_PSIZ
;
4100 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4108 /* Line 1455 of yacc.c */
4109 #line 1645 "program_parse.y"
4111 if (state
->mode
== ARB_vertex
) {
4112 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4114 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4122 /* Line 1455 of yacc.c */
4123 #line 1654 "program_parse.y"
4125 if (state
->mode
== ARB_fragment
) {
4126 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4128 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4136 /* Line 1455 of yacc.c */
4137 #line 1665 "program_parse.y"
4139 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4145 /* Line 1455 of yacc.c */
4146 #line 1671 "program_parse.y"
4148 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4150 : FRAG_RESULT_COLOR
;
4156 /* Line 1455 of yacc.c */
4157 #line 1677 "program_parse.y"
4159 if (state
->mode
== ARB_vertex
) {
4160 (yyval
.integer
) = VERT_RESULT_COL0
;
4162 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4170 /* Line 1455 of yacc.c */
4171 #line 1686 "program_parse.y"
4173 if (state
->mode
== ARB_vertex
) {
4174 (yyval
.integer
) = VERT_RESULT_BFC0
;
4176 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4184 /* Line 1455 of yacc.c */
4185 #line 1697 "program_parse.y"
4187 (yyval
.integer
) = 0;
4193 /* Line 1455 of yacc.c */
4194 #line 1701 "program_parse.y"
4196 if (state
->mode
== ARB_vertex
) {
4197 (yyval
.integer
) = 0;
4199 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4207 /* Line 1455 of yacc.c */
4208 #line 1710 "program_parse.y"
4210 if (state
->mode
== ARB_vertex
) {
4211 (yyval
.integer
) = 1;
4213 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4221 /* Line 1455 of yacc.c */
4222 #line 1720 "program_parse.y"
4223 { (yyval
.integer
) = 0; ;}
4228 /* Line 1455 of yacc.c */
4229 #line 1721 "program_parse.y"
4230 { (yyval
.integer
) = 0; ;}
4235 /* Line 1455 of yacc.c */
4236 #line 1722 "program_parse.y"
4237 { (yyval
.integer
) = 1; ;}
4242 /* Line 1455 of yacc.c */
4243 #line 1725 "program_parse.y"
4244 { (yyval
.integer
) = 0; ;}
4249 /* Line 1455 of yacc.c */
4250 #line 1726 "program_parse.y"
4251 { (yyval
.integer
) = 0; ;}
4256 /* Line 1455 of yacc.c */
4257 #line 1727 "program_parse.y"
4258 { (yyval
.integer
) = 1; ;}
4263 /* Line 1455 of yacc.c */
4264 #line 1730 "program_parse.y"
4265 { (yyval
.integer
) = 0; ;}
4270 /* Line 1455 of yacc.c */
4271 #line 1731 "program_parse.y"
4272 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4277 /* Line 1455 of yacc.c */
4278 #line 1734 "program_parse.y"
4279 { (yyval
.integer
) = 0; ;}
4284 /* Line 1455 of yacc.c */
4285 #line 1735 "program_parse.y"
4286 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4291 /* Line 1455 of yacc.c */
4292 #line 1738 "program_parse.y"
4293 { (yyval
.integer
) = 0; ;}
4298 /* Line 1455 of yacc.c */
4299 #line 1739 "program_parse.y"
4300 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4305 /* Line 1455 of yacc.c */
4306 #line 1743 "program_parse.y"
4308 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4309 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4313 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4319 /* Line 1455 of yacc.c */
4320 #line 1754 "program_parse.y"
4322 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4323 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4327 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4333 /* Line 1455 of yacc.c */
4334 #line 1765 "program_parse.y"
4336 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4337 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4341 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4347 /* Line 1455 of yacc.c */
4348 #line 1776 "program_parse.y"
4350 struct asm_symbol
*exist
= (struct asm_symbol
*)
4351 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4352 struct asm_symbol
*target
= (struct asm_symbol
*)
4353 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4356 if (exist
!= NULL
) {
4357 yyerror(& (yylsp
[(2) - (4)]), state
, "redeclared identifier");
4359 } else if (target
== NULL
) {
4360 yyerror(& (yylsp
[(4) - (4)]), state
,
4361 "undefined variable binding in ALIAS statement");
4364 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4371 /* Line 1455 of yacc.c */
4372 #line 4373 "program_parse.tab.c"
4375 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4379 YY_STACK_PRINT (yyss
, yyssp
);
4384 /* Now `shift' the result of the reduction. Determine what state
4385 that goes to, based on the state we popped back to and the rule
4386 number reduced by. */
4390 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4391 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4392 yystate
= yytable
[yystate
];
4394 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4399 /*------------------------------------.
4400 | yyerrlab -- here on detecting error |
4401 `------------------------------------*/
4403 /* If not already recovering from an error, report this error. */
4407 #if ! YYERROR_VERBOSE
4408 yyerror (&yylloc
, state
, YY_("syntax error"));
4411 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4412 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4414 YYSIZE_T yyalloc
= 2 * yysize
;
4415 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4416 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4417 if (yymsg
!= yymsgbuf
)
4418 YYSTACK_FREE (yymsg
);
4419 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4421 yymsg_alloc
= yyalloc
;
4425 yymsg_alloc
= sizeof yymsgbuf
;
4429 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4431 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4432 yyerror (&yylloc
, state
, yymsg
);
4436 yyerror (&yylloc
, state
, YY_("syntax error"));
4438 goto yyexhaustedlab
;
4444 yyerror_range
[0] = yylloc
;
4446 if (yyerrstatus
== 3)
4448 /* If just tried and failed to reuse lookahead token after an
4449 error, discard it. */
4451 if (yychar
<= YYEOF
)
4453 /* Return failure if at end of input. */
4454 if (yychar
== YYEOF
)
4459 yydestruct ("Error: discarding",
4460 yytoken
, &yylval
, &yylloc
, state
);
4465 /* Else will try to reuse lookahead token after shifting the error
4470 /*---------------------------------------------------.
4471 | yyerrorlab -- error raised explicitly by YYERROR. |
4472 `---------------------------------------------------*/
4475 /* Pacify compilers like GCC when the user code never invokes
4476 YYERROR and the label yyerrorlab therefore never appears in user
4478 if (/*CONSTCOND*/ 0)
4481 yyerror_range
[0] = yylsp
[1-yylen
];
4482 /* Do not reclaim the symbols of the rule which action triggered
4486 YY_STACK_PRINT (yyss
, yyssp
);
4491 /*-------------------------------------------------------------.
4492 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4493 `-------------------------------------------------------------*/
4495 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4499 yyn
= yypact
[yystate
];
4500 if (yyn
!= YYPACT_NINF
)
4503 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4511 /* Pop the current state because it cannot handle the error token. */
4515 yyerror_range
[0] = *yylsp
;
4516 yydestruct ("Error: popping",
4517 yystos
[yystate
], yyvsp
, yylsp
, state
);
4520 YY_STACK_PRINT (yyss
, yyssp
);
4525 yyerror_range
[1] = yylloc
;
4526 /* Using YYLLOC is tempting, but would change the location of
4527 the lookahead. YYLOC is available though. */
4528 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
4531 /* Shift the error token. */
4532 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4538 /*-------------------------------------.
4539 | yyacceptlab -- YYACCEPT comes here. |
4540 `-------------------------------------*/
4545 /*-----------------------------------.
4546 | yyabortlab -- YYABORT comes here. |
4547 `-----------------------------------*/
4552 #if !defined(yyoverflow) || YYERROR_VERBOSE
4553 /*-------------------------------------------------.
4554 | yyexhaustedlab -- memory exhaustion comes here. |
4555 `-------------------------------------------------*/
4557 yyerror (&yylloc
, state
, YY_("memory exhausted"));
4563 if (yychar
!= YYEMPTY
)
4564 yydestruct ("Cleanup: discarding lookahead",
4565 yytoken
, &yylval
, &yylloc
, state
);
4566 /* Do not reclaim the symbols of the rule which action triggered
4567 this YYABORT or YYACCEPT. */
4569 YY_STACK_PRINT (yyss
, yyssp
);
4570 while (yyssp
!= yyss
)
4572 yydestruct ("Cleanup: popping",
4573 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
4578 YYSTACK_FREE (yyss
);
4581 if (yymsg
!= yymsgbuf
)
4582 YYSTACK_FREE (yymsg
);
4584 /* Make sure YYID is used. */
4585 return YYID (yyresult
);
4590 /* Line 1675 of yacc.c */
4591 #line 1796 "program_parse.y"
4594 struct asm_instruction
*
4595 asm_instruction_ctor(gl_inst_opcode op
,
4596 const struct prog_dst_register
*dst
,
4597 const struct asm_src_register
*src0
,
4598 const struct asm_src_register
*src1
,
4599 const struct asm_src_register
*src2
)
4601 struct asm_instruction
*inst
= calloc(1, sizeof(struct asm_instruction
));
4604 _mesa_init_instructions(& inst
->Base
, 1);
4605 inst
->Base
.Opcode
= op
;
4606 inst
->Base
.DstReg
= *dst
;
4608 inst
->Base
.SrcReg
[0] = src0
->Base
;
4609 inst
->SrcReg
[0] = *src0
;
4612 inst
->Base
.SrcReg
[1] = src1
->Base
;
4613 inst
->SrcReg
[1] = *src1
;
4615 init_src_reg(& inst
->SrcReg
[1]);
4619 inst
->Base
.SrcReg
[2] = src2
->Base
;
4620 inst
->SrcReg
[2] = *src2
;
4622 init_src_reg(& inst
->SrcReg
[2]);
4631 init_dst_reg(struct prog_dst_register
*r
)
4633 memset(r
, 0, sizeof(*r
));
4634 r
->File
= PROGRAM_UNDEFINED
;
4635 r
->WriteMask
= WRITEMASK_XYZW
;
4636 r
->CondMask
= COND_TR
;
4637 r
->CondSwizzle
= SWIZZLE_NOOP
;
4642 init_src_reg(struct asm_src_register
*r
)
4644 memset(r
, 0, sizeof(*r
));
4645 r
->Base
.File
= PROGRAM_UNDEFINED
;
4646 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
4652 * Validate the set of inputs used by a program
4654 * Validates that legal sets of inputs are used by the program. In this case
4655 * "used" included both reading the input or binding the input to a name using
4656 * the \c ATTRIB command.
4659 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
4662 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
4664 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
4666 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
4667 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
4676 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
4677 struct YYLTYPE
*locp
)
4679 struct asm_symbol
*s
= NULL
;
4680 struct asm_symbol
*exist
= (struct asm_symbol
*)
4681 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
4684 if (exist
!= NULL
) {
4685 yyerror(locp
, state
, "redeclared identifier");
4687 s
= calloc(1, sizeof(struct asm_symbol
));
4693 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
4694 yyerror(locp
, state
, "too many temporaries declared");
4699 s
->temp_binding
= state
->prog
->NumTemporaries
;
4700 state
->prog
->NumTemporaries
++;
4704 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
4705 yyerror(locp
, state
, "too many address registers declared");
4710 /* FINISHME: Add support for multiple address registers.
4712 state
->prog
->NumAddressRegs
++;
4719 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
4720 s
->next
= state
->sym
;
4728 int add_state_reference(struct gl_program_parameter_list
*param_list
,
4729 const gl_state_index tokens
[STATE_LENGTH
])
4731 const GLuint size
= 4; /* XXX fix */
4735 name
= _mesa_program_state_string(tokens
);
4736 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
4738 NULL
, (gl_state_index
*) tokens
, 0x0);
4739 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
4741 /* free name string here since we duplicated it in add_parameter() */
4749 initialize_symbol_from_state(struct gl_program
*prog
,
4750 struct asm_symbol
*param_var
,
4751 const gl_state_index tokens
[STATE_LENGTH
])
4754 gl_state_index state_tokens
[STATE_LENGTH
];
4757 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
4759 param_var
->type
= at_param
;
4760 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
4762 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
4763 * unroll it and call add_state_reference() for each row
4765 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
4766 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
4767 state_tokens
[0] == STATE_MVP_MATRIX
||
4768 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
4769 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
4770 && (state_tokens
[2] != state_tokens
[3])) {
4772 const int first_row
= state_tokens
[2];
4773 const int last_row
= state_tokens
[3];
4775 for (row
= first_row
; row
<= last_row
; row
++) {
4776 state_tokens
[2] = state_tokens
[3] = row
;
4778 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4779 if (param_var
->param_binding_begin
== ~0U)
4780 param_var
->param_binding_begin
= idx
;
4781 param_var
->param_binding_length
++;
4785 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4786 if (param_var
->param_binding_begin
== ~0U)
4787 param_var
->param_binding_begin
= idx
;
4788 param_var
->param_binding_length
++;
4796 initialize_symbol_from_param(struct gl_program
*prog
,
4797 struct asm_symbol
*param_var
,
4798 const gl_state_index tokens
[STATE_LENGTH
])
4801 gl_state_index state_tokens
[STATE_LENGTH
];
4804 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
4806 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
4807 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
4808 assert((state_tokens
[1] == STATE_ENV
)
4809 || (state_tokens
[1] == STATE_LOCAL
));
4811 param_var
->type
= at_param
;
4812 param_var
->param_binding_type
= (state_tokens
[1] == STATE_ENV
)
4813 ? PROGRAM_ENV_PARAM
: PROGRAM_LOCAL_PARAM
;
4815 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
4816 * we need to unroll it and call add_state_reference() for each row
4818 if (state_tokens
[2] != state_tokens
[3]) {
4820 const int first_row
= state_tokens
[2];
4821 const int last_row
= state_tokens
[3];
4823 for (row
= first_row
; row
<= last_row
; row
++) {
4824 state_tokens
[2] = state_tokens
[3] = row
;
4826 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4827 if (param_var
->param_binding_begin
== ~0U)
4828 param_var
->param_binding_begin
= idx
;
4829 param_var
->param_binding_length
++;
4833 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4834 if (param_var
->param_binding_begin
== ~0U)
4835 param_var
->param_binding_begin
= idx
;
4836 param_var
->param_binding_length
++;
4844 initialize_symbol_from_const(struct gl_program
*prog
,
4845 struct asm_symbol
*param_var
,
4846 const struct asm_vector
*vec
)
4848 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
4849 NULL
, vec
->count
, GL_NONE
, vec
->data
,
4852 param_var
->type
= at_param
;
4853 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
4855 if (param_var
->param_binding_begin
== ~0U)
4856 param_var
->param_binding_begin
= idx
;
4857 param_var
->param_binding_length
++;
4864 make_error_string(const char *fmt
, ...)
4870 va_start(args
, fmt
);
4872 /* Call vsnprintf once to determine how large the final string is. Call it
4873 * again to do the actual formatting. from the vsnprintf manual page:
4875 * Upon successful return, these functions return the number of
4876 * characters printed (not including the trailing '\0' used to end
4877 * output to strings).
4879 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
4881 str
= _mesa_malloc(length
);
4883 vsnprintf(str
, length
, fmt
, args
);
4893 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
4898 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
4900 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
4901 _mesa_free(err_str
);
4904 err_str
= make_error_string("line %u, char %u: error: %s\n",
4905 locp
->first_line
, locp
->first_column
, s
);
4906 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
4909 _mesa_free(err_str
);
4915 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
4916 GLsizei len
, struct asm_parser_state
*state
)
4918 struct gl_program_constants limits
;
4919 struct asm_instruction
*inst
;
4922 GLboolean result
= GL_FALSE
;
4924 struct asm_symbol
*sym
;
4927 state
->prog
->Target
= target
;
4928 state
->prog
->Parameters
= _mesa_new_parameter_list();
4930 /* Make a copy of the program string and force it to be NUL-terminated.
4932 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
4934 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4937 _mesa_memcpy (strz
, str
, len
);
4940 state
->prog
->String
= strz
;
4942 state
->st
= _mesa_symbol_table_ctor();
4944 /* All of these limits should come from ctx.
4946 limits
.MaxInstructions
= 128;
4947 limits
.MaxAluInstructions
= 128;
4948 limits
.MaxTexInstructions
= 128;
4949 limits
.MaxTexIndirections
= 128;
4950 limits
.MaxAttribs
= 16;
4951 limits
.MaxTemps
= 128;
4952 limits
.MaxAddressRegs
= 1;
4953 limits
.MaxParameters
= 128;
4954 limits
.MaxLocalParams
= 256;
4955 limits
.MaxEnvParams
= 128;
4956 limits
.MaxNativeInstructions
= 128;
4957 limits
.MaxNativeAluInstructions
= 128;
4958 limits
.MaxNativeTexInstructions
= 128;
4959 limits
.MaxNativeTexIndirections
= 128;
4960 limits
.MaxNativeAttribs
= 16;
4961 limits
.MaxNativeTemps
= 128;
4962 limits
.MaxNativeAddressRegs
= 1;
4963 limits
.MaxNativeParameters
= 128;
4964 limits
.MaxUniformComponents
= 0;
4966 state
->limits
= & limits
;
4968 state
->MaxTextureImageUnits
= 16;
4969 state
->MaxTextureCoordUnits
= 8;
4970 state
->MaxTextureUnits
= 8;
4971 state
->MaxClipPlanes
= 6;
4972 state
->MaxLights
= 8;
4973 state
->MaxProgramMatrices
= 8;
4975 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
4976 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
4978 _mesa_set_program_error(ctx
, -1, NULL
);
4980 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
4982 _mesa_program_lexer_dtor(state
->scanner
);
4985 if (ctx
->Program
.ErrorPos
!= -1) {
4989 if (! _mesa_layout_parameters(state
)) {
4993 loc
.first_column
= 0;
4996 yyerror(& loc
, state
, "invalid PARAM usage");
5002 /* Add one instruction to store the "END" instruction.
5004 state
->prog
->Instructions
=
5005 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5006 inst
= state
->inst_head
;
5007 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5008 struct asm_instruction
*const temp
= inst
->next
;
5010 state
->prog
->Instructions
[i
] = inst
->Base
;
5014 /* Finally, tag on an OPCODE_END instruction */
5016 const GLuint numInst
= state
->prog
->NumInstructions
;
5017 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5018 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5020 state
->prog
->NumInstructions
++;
5022 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5025 * Initialize native counts to logical counts. The device driver may
5026 * change them if program is translated into a hardware program.
5028 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5029 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5030 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5031 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5032 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5037 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5042 state
->inst_head
= NULL
;
5043 state
->inst_tail
= NULL
;
5045 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5048 _mesa_free((void *) sym
->name
);
5053 _mesa_symbol_table_dtor(state
->st
);