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 "prog_parameter.h"
101 #include "prog_parameter_layout.h"
102 #include "prog_statevars.h"
103 #include "prog_instruction.h"
105 #include "symbol_table.h"
106 #include "program_parser.h"
108 extern void *yy_scan_string(char *);
109 extern void yy_delete_buffer(void *);
111 static struct asm_symbol
*declare_variable(struct asm_parser_state
*state
,
112 char *name
, enum asm_type t
, struct YYLTYPE
*locp
);
114 static int initialize_symbol_from_state(struct gl_program
*prog
,
115 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
117 static int initialize_symbol_from_param(struct gl_program
*prog
,
118 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
120 static int initialize_symbol_from_const(struct gl_program
*prog
,
121 struct asm_symbol
*param_var
, const struct asm_vector
*vec
);
123 static int yyparse(struct asm_parser_state
*state
);
125 static void yyerror(struct YYLTYPE
*locp
, struct asm_parser_state
*state
,
128 static int validate_inputs(struct YYLTYPE
*locp
,
129 struct asm_parser_state
*state
);
131 static void init_dst_reg(struct prog_dst_register
*r
);
133 static void init_src_reg(struct asm_src_register
*r
);
135 static struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
136 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
137 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
141 #define TRUE (!FALSE)
144 #define YYLLOC_DEFAULT(Current, Rhs, N) \
147 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
148 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
149 (Current).position = YYRHSLOC(Rhs, 1).position; \
150 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
151 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
153 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
154 (Current).last_line = (Current).first_line; \
155 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
156 (Current).last_column = (Current).first_column; \
157 (Current).position = YYRHSLOC(Rhs, 0).position \
158 + (Current).first_column; \
162 #define YYLEX_PARAM state->scanner
165 /* Line 189 of yacc.c */
166 #line 167 "program_parse.tab.c"
168 /* Enabling traces. */
173 /* Enabling verbose error messages. */
174 #ifdef YYERROR_VERBOSE
175 # undef YYERROR_VERBOSE
176 # define YYERROR_VERBOSE 1
178 # define YYERROR_VERBOSE 1
181 /* Enabling the token table. */
182 #ifndef YYTOKEN_TABLE
183 # define YYTOKEN_TABLE 0
190 /* Put the tokens into the symbol table, so that GDB and other debuggers
294 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
295 typedef union YYSTYPE
298 /* Line 214 of yacc.c */
299 #line 100 "program_parse.y"
301 struct asm_instruction
*inst
;
302 struct asm_symbol
*sym
;
303 struct asm_symbol temp_sym
;
304 struct asm_swizzle_mask swiz_mask
;
305 struct asm_src_register src_reg
;
306 struct prog_dst_register dst_reg
;
307 struct prog_instruction temp_inst
;
315 struct asm_vector vector
;
316 gl_inst_opcode opcode
;
320 /* Line 214 of yacc.c */
321 #line 322 "program_parse.tab.c"
323 # define YYSTYPE_IS_TRIVIAL 1
324 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
325 # define YYSTYPE_IS_DECLARED 1
328 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
329 typedef struct YYLTYPE
336 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
337 # define YYLTYPE_IS_DECLARED 1
338 # define YYLTYPE_IS_TRIVIAL 1
342 /* Copy the second part of user declarations. */
344 /* Line 264 of yacc.c */
345 #line 233 "program_parse.y"
347 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
351 /* Line 264 of yacc.c */
352 #line 353 "program_parse.tab.c"
359 typedef YYTYPE_UINT8 yytype_uint8
;
361 typedef unsigned char yytype_uint8
;
365 typedef YYTYPE_INT8 yytype_int8
;
366 #elif (defined __STDC__ || defined __C99__FUNC__ \
367 || defined __cplusplus || defined _MSC_VER)
368 typedef signed char yytype_int8
;
370 typedef short int yytype_int8
;
374 typedef YYTYPE_UINT16 yytype_uint16
;
376 typedef unsigned short int yytype_uint16
;
380 typedef YYTYPE_INT16 yytype_int16
;
382 typedef short int yytype_int16
;
386 # ifdef __SIZE_TYPE__
387 # define YYSIZE_T __SIZE_TYPE__
388 # elif defined size_t
389 # define YYSIZE_T size_t
390 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
391 || defined __cplusplus || defined _MSC_VER)
392 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
393 # define YYSIZE_T size_t
395 # define YYSIZE_T unsigned int
399 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
404 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
405 # define YY_(msgid) dgettext ("bison-runtime", msgid)
409 # define YY_(msgid) msgid
413 /* Suppress unused-variable warnings by "using" E. */
414 #if ! defined lint || defined __GNUC__
415 # define YYUSE(e) ((void) (e))
417 # define YYUSE(e) /* empty */
420 /* Identity function, used to suppress warnings about constant conditions. */
424 #if (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
438 #if ! defined yyoverflow || YYERROR_VERBOSE
440 /* The parser invokes alloca or malloc; define the necessary symbols. */
442 # ifdef YYSTACK_USE_ALLOCA
443 # if YYSTACK_USE_ALLOCA
445 # define YYSTACK_ALLOC __builtin_alloca
446 # elif defined __BUILTIN_VA_ARG_INCR
447 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
449 # define YYSTACK_ALLOC __alloca
450 # elif defined _MSC_VER
451 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
452 # define alloca _alloca
454 # define YYSTACK_ALLOC alloca
455 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
456 || defined __cplusplus || defined _MSC_VER)
457 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
466 # ifdef YYSTACK_ALLOC
467 /* Pacify GCC's `empty if-body' warning. */
468 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
469 # ifndef YYSTACK_ALLOC_MAXIMUM
470 /* The OS might guarantee only one guard page at the bottom of the stack,
471 and a page size can be as small as 4096 bytes. So we cannot safely
472 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
473 to allow for a few compiler-allocated temporary stack slots. */
474 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
477 # define YYSTACK_ALLOC YYMALLOC
478 # define YYSTACK_FREE YYFREE
479 # ifndef YYSTACK_ALLOC_MAXIMUM
480 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
482 # if (defined __cplusplus && ! defined _STDLIB_H \
483 && ! ((defined YYMALLOC || defined malloc) \
484 && (defined YYFREE || defined free)))
485 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
491 # define YYMALLOC malloc
492 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
493 || defined __cplusplus || defined _MSC_VER)
494 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
499 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
500 || defined __cplusplus || defined _MSC_VER)
501 void free (void *); /* INFRINGES ON USER NAME SPACE */
505 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
508 #if (! defined yyoverflow \
509 && (! defined __cplusplus \
510 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
511 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
513 /* A type that is properly aligned for any stack member. */
516 yytype_int16 yyss_alloc
;
521 /* The size of the maximum gap between one aligned stack and the next. */
522 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
524 /* The size of an array large to enough to hold all stacks, each with
526 # define YYSTACK_BYTES(N) \
527 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
528 + 2 * YYSTACK_GAP_MAXIMUM)
530 /* Copy COUNT objects from FROM to TO. The source and destination do
533 # if defined __GNUC__ && 1 < __GNUC__
534 # define YYCOPY(To, From, Count) \
535 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
537 # define YYCOPY(To, From, Count) \
541 for (yyi = 0; yyi < (Count); yyi++) \
542 (To)[yyi] = (From)[yyi]; \
548 /* Relocate STACK from its old location to the new one. The
549 local variables YYSIZE and YYSTACKSIZE give the old and new number of
550 elements in the stack, and YYPTR gives the new location of the
551 stack. Advance YYPTR to a properly aligned location for the next
553 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
556 YYSIZE_T yynewbytes; \
557 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
558 Stack = &yyptr->Stack_alloc; \
559 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
560 yyptr += yynewbytes / sizeof (*yyptr); \
566 /* YYFINAL -- State number of the termination state. */
568 /* YYLAST -- Last index in YYTABLE. */
571 /* YYNTOKENS -- Number of terminals. */
572 #define YYNTOKENS 108
573 /* YYNNTS -- Number of nonterminals. */
575 /* YYNRULES -- Number of rules. */
577 /* YYNRULES -- Number of states. */
578 #define YYNSTATES 424
580 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
582 #define YYMAXUTOK 353
584 #define YYTRANSLATE(YYX) \
585 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
587 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
588 static const yytype_uint8 yytranslate
[] =
590 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 103, 100, 104, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 99,
596 2, 105, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 101, 2, 102, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 106, 2, 107, 2, 2, 2, 2,
603 2, 2, 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, 2, 2, 2, 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, 2, 2, 2, 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, 1, 2, 3, 4,
616 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
617 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
618 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
619 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
620 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
621 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
622 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
623 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
624 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
629 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
631 static const yytype_uint16 yyprhs
[] =
633 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
634 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
635 46, 48, 50, 52, 57, 62, 67, 74, 81, 90,
636 99, 102, 105, 107, 109, 111, 113, 115, 122, 126,
637 130, 133, 136, 144, 147, 149, 151, 153, 155, 160,
638 162, 164, 166, 168, 170, 172, 174, 178, 179, 182,
639 185, 187, 189, 191, 193, 195, 197, 199, 201, 203,
640 204, 206, 208, 210, 212, 213, 215, 217, 219, 221,
641 223, 225, 230, 233, 236, 238, 241, 243, 246, 248,
642 251, 256, 261, 263, 264, 268, 270, 272, 275, 277,
643 280, 282, 284, 288, 295, 296, 298, 301, 306, 308,
644 312, 314, 316, 318, 320, 322, 324, 326, 328, 330,
645 332, 335, 338, 341, 344, 347, 350, 353, 356, 359,
646 362, 365, 369, 371, 373, 375, 381, 383, 385, 387,
647 390, 392, 394, 397, 399, 402, 409, 411, 415, 417,
648 419, 421, 423, 425, 430, 432, 434, 436, 438, 440,
649 442, 445, 447, 449, 455, 457, 460, 462, 464, 470,
650 473, 474, 481, 485, 486, 488, 490, 492, 494, 496,
651 499, 501, 503, 506, 511, 516, 517, 519, 521, 523,
652 525, 527, 529, 531, 533, 539, 541, 545, 551, 557,
653 559, 563, 569, 571, 573, 575, 577, 579, 581, 583,
654 585, 587, 591, 597, 605, 615, 618, 621, 623, 625,
655 626, 627, 631, 632, 636, 640, 642, 647, 650, 653,
656 656, 659, 663, 666, 670, 671, 673, 675, 676, 678,
657 680, 681, 683, 685, 686, 688, 690, 691, 695, 696,
658 700, 701, 705, 707, 709, 711
661 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
662 static const yytype_int16 yyrhs
[] =
664 109, 0, -1, 110, 111, 113, 12, -1, 3, -1,
665 4, -1, 111, 112, -1, -1, 8, 91, 99, -1,
666 113, 114, -1, -1, 115, 99, -1, 151, 99, -1,
667 116, -1, 117, -1, 118, -1, 119, -1, 120, -1,
668 121, -1, 122, -1, 123, -1, 128, -1, 124, -1,
669 125, -1, 19, 132, 100, 129, -1, 18, 131, 100,
670 130, -1, 16, 131, 100, 129, -1, 14, 131, 100,
671 129, 100, 129, -1, 13, 131, 100, 130, 100, 130,
672 -1, 17, 131, 100, 130, 100, 130, 100, 130, -1,
673 15, 131, 100, 130, 100, 126, 100, 127, -1, 20,
674 130, -1, 82, 235, -1, 83, -1, 84, -1, 85,
675 -1, 86, -1, 87, -1, 21, 131, 100, 136, 100,
676 133, -1, 221, 136, 148, -1, 221, 136, 149, -1,
677 137, 150, -1, 145, 147, -1, 134, 100, 134, 100,
678 134, 100, 134, -1, 221, 135, -1, 22, -1, 91,
679 -1, 91, -1, 153, -1, 138, 101, 139, 102, -1,
680 167, -1, 228, -1, 91, -1, 91, -1, 140, -1,
681 141, -1, 22, -1, 145, 146, 142, -1, -1, 103,
682 143, -1, 104, 144, -1, 22, -1, 22, -1, 91,
683 -1, 95, -1, 95, -1, 95, -1, 95, -1, 92,
684 -1, 96, -1, -1, 92, -1, 93, -1, 94, -1,
685 95, -1, -1, 152, -1, 159, -1, 222, -1, 224,
686 -1, 227, -1, 240, -1, 7, 91, 105, 153, -1,
687 88, 154, -1, 37, 158, -1, 59, -1, 90, 156,
688 -1, 52, -1, 28, 233, -1, 36, -1, 73, 234,
689 -1, 49, 101, 157, 102, -1, 89, 101, 155, 102,
690 -1, 22, -1, -1, 101, 157, 102, -1, 22, -1,
691 59, -1, 28, 233, -1, 36, -1, 73, 234, -1,
692 160, -1, 161, -1, 10, 91, 163, -1, 10, 91,
693 101, 162, 102, 164, -1, -1, 22, -1, 105, 166,
694 -1, 105, 106, 165, 107, -1, 168, -1, 165, 100,
695 168, -1, 170, -1, 205, -1, 215, -1, 170, -1,
696 205, -1, 216, -1, 169, -1, 206, -1, 215, -1,
697 170, -1, 72, 194, -1, 72, 171, -1, 72, 173,
698 -1, 72, 176, -1, 72, 178, -1, 72, 184, -1,
699 72, 180, -1, 72, 187, -1, 72, 189, -1, 72,
700 191, -1, 72, 193, -1, 46, 232, 172, -1, 182,
701 -1, 32, -1, 68, -1, 42, 101, 183, 102, 174,
702 -1, 182, -1, 59, -1, 25, -1, 71, 175, -1,
703 39, -1, 31, -1, 43, 177, -1, 24, -1, 232,
704 66, -1, 44, 101, 183, 102, 232, 179, -1, 182,
705 -1, 74, 236, 181, -1, 28, -1, 24, -1, 30,
706 -1, 70, -1, 22, -1, 75, 234, 185, 186, -1,
707 34, -1, 53, -1, 78, -1, 79, -1, 77, -1,
708 76, -1, 35, 188, -1, 28, -1, 55, -1, 27,
709 101, 190, 102, 56, -1, 22, -1, 57, 192, -1,
710 69, -1, 25, -1, 196, 65, 101, 199, 102, -1,
711 196, 195, -1, -1, 65, 101, 199, 97, 199, 102,
712 -1, 48, 200, 197, -1, -1, 198, -1, 40, -1,
713 81, -1, 41, -1, 22, -1, 50, 201, -1, 62,
714 -1, 51, -1, 80, 234, -1, 54, 101, 203, 102,
715 -1, 47, 101, 204, 102, -1, -1, 202, -1, 22,
716 -1, 22, -1, 22, -1, 209, -1, 212, -1, 207,
717 -1, 210, -1, 61, 33, 101, 208, 102, -1, 213,
718 -1, 213, 97, 213, -1, 61, 33, 101, 213, 102,
719 -1, 61, 45, 101, 211, 102, -1, 214, -1, 214,
720 97, 214, -1, 61, 45, 101, 214, 102, -1, 22,
721 -1, 22, -1, 217, -1, 219, -1, 218, -1, 219,
722 -1, 220, -1, 23, -1, 22, -1, 106, 220, 107,
723 -1, 106, 220, 100, 220, 107, -1, 106, 220, 100,
724 220, 100, 220, 107, -1, 106, 220, 100, 220, 100,
725 220, 100, 220, 107, -1, 221, 23, -1, 221, 22,
726 -1, 103, -1, 104, -1, -1, -1, 11, 223, 226,
727 -1, -1, 5, 225, 226, -1, 226, 100, 91, -1,
728 91, -1, 9, 91, 105, 228, -1, 64, 59, -1,
729 64, 36, -1, 64, 229, -1, 64, 58, -1, 64,
730 73, 234, -1, 64, 29, -1, 28, 230, 231, -1,
731 -1, 38, -1, 26, -1, -1, 60, -1, 67, -1,
732 -1, 38, -1, 26, -1, -1, 60, -1, 67, -1,
733 -1, 101, 237, 102, -1, -1, 101, 238, 102, -1,
734 -1, 101, 239, 102, -1, 22, -1, 22, -1, 22,
735 -1, 6, 91, 105, 91, -1
738 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
739 static const yytype_uint16 yyrline
[] =
741 0, 240, 240, 243, 251, 260, 261, 264, 282, 283,
742 286, 301, 304, 305, 308, 309, 310, 311, 312, 313,
743 314, 317, 318, 321, 327, 334, 341, 349, 356, 364,
744 375, 381, 387, 388, 389, 390, 391, 394, 406, 419,
745 432, 454, 463, 472, 479, 488, 516, 558, 569, 590,
746 600, 606, 630, 647, 647, 649, 656, 668, 669, 670,
747 673, 685, 697, 715, 726, 738, 740, 741, 742, 743,
748 746, 746, 746, 746, 747, 750, 751, 752, 753, 754,
749 755, 758, 776, 780, 786, 790, 794, 798, 802, 806,
750 810, 814, 820, 831, 831, 832, 834, 838, 842, 846,
751 852, 852, 854, 870, 893, 896, 907, 913, 919, 920,
752 927, 933, 939, 947, 953, 959, 967, 973, 979, 987,
753 988, 991, 992, 993, 994, 995, 996, 997, 998, 999,
754 1000, 1003, 1012, 1016, 1020, 1026, 1035, 1039, 1043, 1047,
755 1051, 1057, 1063, 1070, 1075, 1083, 1093, 1095, 1103, 1109,
756 1113, 1117, 1123, 1134, 1143, 1147, 1152, 1156, 1160, 1164,
757 1170, 1177, 1181, 1187, 1195, 1206, 1213, 1217, 1223, 1233,
758 1244, 1248, 1266, 1275, 1278, 1284, 1288, 1292, 1298, 1309,
759 1314, 1319, 1324, 1329, 1333, 1341, 1344, 1349, 1362, 1370,
760 1383, 1383, 1385, 1385, 1387, 1397, 1402, 1409, 1419, 1428,
761 1433, 1440, 1450, 1460, 1472, 1472, 1473, 1473, 1475, 1482,
762 1487, 1494, 1499, 1505, 1513, 1524, 1528, 1534, 1535, 1536,
763 1539, 1539, 1542, 1542, 1545, 1551, 1559, 1572, 1581, 1590,
764 1594, 1603, 1612, 1623, 1630, 1635, 1644, 1656, 1659, 1668,
765 1679, 1680, 1681, 1684, 1685, 1686, 1689, 1690, 1693, 1694,
766 1697, 1698, 1701, 1712, 1723, 1734
770 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
771 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
772 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
773 static const char *const yytname
[] =
775 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
776 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
777 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
778 "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK",
779 "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV",
780 "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
781 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
782 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
783 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT", "POINTSIZE", "POSITION",
784 "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
785 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE", "SPECULAR", "SPOT",
786 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
787 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
788 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "VERTEX", "VTXATTRIB",
789 "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE",
790 "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'",
791 "'}'", "$accept", "program", "language", "optionSequence", "option",
792 "statementSequence", "statement", "instruction", "ALU_instruction",
793 "TexInstruction", "ARL_instruction", "VECTORop_instruction",
794 "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction",
795 "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction",
796 "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg",
797 "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle",
798 "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray",
799 "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel",
800 "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg",
801 "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix",
802 "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding",
803 "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum",
804 "fragAttribItem", "PARAM_statement", "PARAM_singleStmt",
805 "PARAM_multipleStmt", "optArraySize", "paramSingleInit",
806 "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl",
807 "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem",
808 "stateSingleItem", "stateMaterialItem", "stateMatProperty",
809 "stateLightItem", "stateLightProperty", "stateSpotProperty",
810 "stateLightModelItem", "stateLModProperty", "stateLightProdItem",
811 "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty",
812 "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem",
813 "stateTexGenType", "stateTexGenCoord", "stateFogItem",
814 "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum",
815 "statePointItem", "statePointProperty", "stateMatrixRow",
816 "stateMatrixRows", "optMatrixRows", "stateMatrixItem",
817 "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum",
818 "stateMatrixName", "stateOptModMatNum", "stateModMatNum",
819 "statePaletteMatNum", "stateProgramMatNum", "programSingleItem",
820 "programMultipleItem", "progEnvParams", "progEnvParamNums",
821 "progEnvParam", "progLocalParams", "progLocalParamNums",
822 "progLocalParam", "progEnvParamNum", "progLocalParamNum",
823 "paramConstDecl", "paramConstUse", "paramConstScalarDecl",
824 "paramConstScalarUse", "paramConstVector", "signedFloatConstant",
825 "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2",
826 "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding",
827 "optResultFaceType", "optResultColorType", "optFaceType", "optColorType",
828 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
829 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
835 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
837 static const yytype_uint16 yytoknum
[] =
839 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
840 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
841 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
842 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
843 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
844 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
845 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
846 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
847 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
848 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
849 44, 91, 93, 43, 45, 61, 123, 125
853 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
854 static const yytype_uint8 yyr1
[] =
856 0, 108, 109, 110, 110, 111, 111, 112, 113, 113,
857 114, 114, 115, 115, 116, 116, 116, 116, 116, 116,
858 116, 117, 117, 118, 119, 120, 121, 122, 123, 124,
859 125, 126, 127, 127, 127, 127, 127, 128, 129, 130,
860 131, 132, 133, 134, 135, 135, 136, 136, 136, 136,
861 137, 137, 138, 139, 139, 140, 141, 142, 142, 142,
862 143, 144, 145, 146, 147, 148, 149, 149, 149, 149,
863 150, 150, 150, 150, 150, 151, 151, 151, 151, 151,
864 151, 152, 153, 153, 154, 154, 154, 154, 154, 154,
865 154, 154, 155, 156, 156, 157, 158, 158, 158, 158,
866 159, 159, 160, 161, 162, 162, 163, 164, 165, 165,
867 166, 166, 166, 167, 167, 167, 168, 168, 168, 169,
868 169, 170, 170, 170, 170, 170, 170, 170, 170, 170,
869 170, 171, 172, 172, 172, 173, 174, 174, 174, 174,
870 174, 175, 176, 177, 177, 178, 179, 180, 181, 182,
871 182, 182, 183, 184, 185, 185, 186, 186, 186, 186,
872 187, 188, 188, 189, 190, 191, 192, 192, 193, 194,
873 195, 195, 196, 197, 197, 198, 198, 198, 199, 200,
874 200, 200, 200, 200, 200, 201, 201, 202, 203, 204,
875 205, 205, 206, 206, 207, 208, 208, 209, 210, 211,
876 211, 212, 213, 214, 215, 215, 216, 216, 217, 218,
877 218, 219, 219, 219, 219, 220, 220, 221, 221, 221,
878 223, 222, 225, 224, 226, 226, 227, 228, 228, 228,
879 228, 228, 228, 229, 230, 230, 230, 231, 231, 231,
880 232, 232, 232, 233, 233, 233, 234, 234, 235, 235,
881 236, 236, 237, 238, 239, 240
884 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
885 static const yytype_uint8 yyr2
[] =
887 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
888 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
889 1, 1, 1, 4, 4, 4, 6, 6, 8, 8,
890 2, 2, 1, 1, 1, 1, 1, 6, 3, 3,
891 2, 2, 7, 2, 1, 1, 1, 1, 4, 1,
892 1, 1, 1, 1, 1, 1, 3, 0, 2, 2,
893 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
894 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
895 1, 4, 2, 2, 1, 2, 1, 2, 1, 2,
896 4, 4, 1, 0, 3, 1, 1, 2, 1, 2,
897 1, 1, 3, 6, 0, 1, 2, 4, 1, 3,
898 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
899 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
900 2, 3, 1, 1, 1, 5, 1, 1, 1, 2,
901 1, 1, 2, 1, 2, 6, 1, 3, 1, 1,
902 1, 1, 1, 4, 1, 1, 1, 1, 1, 1,
903 2, 1, 1, 5, 1, 2, 1, 1, 5, 2,
904 0, 6, 3, 0, 1, 1, 1, 1, 1, 2,
905 1, 1, 2, 4, 4, 0, 1, 1, 1, 1,
906 1, 1, 1, 1, 5, 1, 3, 5, 5, 1,
907 3, 5, 1, 1, 1, 1, 1, 1, 1, 1,
908 1, 3, 5, 7, 9, 2, 2, 1, 1, 0,
909 0, 3, 0, 3, 3, 1, 4, 2, 2, 2,
910 2, 3, 2, 3, 0, 1, 1, 0, 1, 1,
911 0, 1, 1, 0, 1, 1, 0, 3, 0, 3,
915 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
916 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
917 means the default is an error. */
918 static const yytype_uint8 yydefact
[] =
920 0, 3, 4, 0, 6, 1, 9, 0, 5, 0,
921 0, 222, 0, 0, 0, 0, 220, 2, 0, 0,
922 0, 0, 0, 0, 0, 219, 0, 8, 0, 12,
923 13, 14, 15, 16, 17, 18, 19, 21, 22, 20,
924 0, 75, 76, 100, 101, 77, 78, 79, 80, 7,
925 0, 0, 0, 0, 0, 0, 0, 51, 0, 74,
926 50, 0, 0, 0, 0, 0, 62, 0, 0, 217,
927 218, 30, 0, 0, 10, 11, 225, 223, 0, 0,
928 0, 104, 219, 102, 221, 234, 232, 228, 230, 227,
929 246, 229, 219, 70, 71, 72, 73, 40, 219, 219,
930 219, 219, 219, 219, 64, 41, 210, 209, 0, 0,
931 0, 0, 46, 219, 69, 0, 47, 49, 113, 114,
932 190, 191, 115, 206, 207, 0, 0, 255, 81, 226,
933 105, 0, 106, 110, 111, 112, 204, 205, 208, 0,
934 236, 235, 237, 0, 231, 0, 0, 0, 0, 25,
935 0, 24, 23, 243, 98, 96, 246, 83, 0, 0,
936 0, 0, 0, 240, 0, 240, 0, 0, 250, 246,
937 121, 122, 123, 124, 126, 125, 127, 128, 129, 130,
938 0, 243, 88, 0, 86, 84, 246, 0, 93, 82,
939 0, 67, 66, 68, 39, 0, 0, 224, 0, 216,
940 215, 238, 239, 233, 252, 0, 219, 219, 0, 0,
941 219, 244, 245, 97, 99, 0, 0, 0, 161, 162,
942 160, 0, 143, 242, 241, 142, 0, 0, 0, 0,
943 185, 181, 0, 180, 246, 173, 167, 166, 165, 0,
944 0, 0, 0, 87, 0, 89, 0, 0, 85, 219,
945 211, 55, 0, 53, 54, 0, 219, 0, 103, 247,
946 27, 26, 65, 38, 248, 0, 0, 202, 0, 203,
947 0, 164, 0, 152, 0, 144, 0, 149, 150, 133,
948 134, 151, 131, 132, 0, 187, 179, 186, 0, 182,
949 175, 177, 176, 172, 174, 254, 0, 148, 147, 154,
950 155, 0, 0, 95, 0, 92, 0, 0, 0, 48,
951 63, 57, 37, 0, 0, 219, 0, 31, 0, 219,
952 197, 201, 0, 0, 240, 189, 0, 188, 0, 251,
953 159, 158, 156, 157, 153, 178, 0, 90, 91, 94,
954 219, 212, 0, 0, 56, 219, 44, 45, 43, 0,
955 0, 0, 108, 116, 119, 117, 192, 193, 118, 253,
956 0, 32, 33, 34, 35, 36, 29, 28, 163, 138,
957 140, 137, 0, 135, 136, 0, 184, 183, 168, 0,
958 60, 58, 61, 59, 0, 0, 0, 120, 170, 219,
959 107, 249, 141, 139, 145, 146, 219, 213, 219, 0,
960 0, 0, 169, 109, 0, 0, 0, 195, 0, 199,
961 0, 214, 219, 194, 0, 198, 0, 0, 42, 196,
965 /* YYDEFGOTO[NTERM-NUM]. */
966 static const yytype_int16 yydefgoto
[] =
968 -1, 3, 4, 6, 8, 9, 27, 28, 29, 30,
969 31, 32, 33, 34, 35, 36, 37, 38, 265, 366,
970 39, 146, 71, 58, 67, 312, 313, 348, 114, 59,
971 115, 252, 253, 254, 344, 381, 383, 68, 311, 105,
972 263, 194, 97, 40, 41, 116, 189, 306, 248, 304,
973 157, 42, 43, 44, 131, 83, 258, 351, 132, 117,
974 352, 353, 118, 170, 282, 171, 373, 393, 172, 225,
975 173, 394, 174, 298, 283, 274, 175, 301, 334, 176,
976 220, 177, 272, 178, 238, 179, 387, 402, 180, 293,
977 294, 336, 235, 286, 287, 328, 326, 119, 355, 356,
978 406, 120, 357, 408, 121, 268, 270, 358, 122, 136,
979 123, 124, 138, 72, 45, 55, 46, 50, 77, 47,
980 60, 91, 142, 203, 226, 213, 144, 317, 240, 205,
984 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
986 #define YYPACT_NINF -371
987 static const yytype_int16 yypact
[] =
989 159, -371, -371, 34, -371, -371, 66, 11, -371, 140,
990 -22, -371, 25, 37, 51, 53, -371, -371, -28, -28,
991 -28, -28, -28, -28, 74, 102, -28, -371, 80, -371,
992 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
993 82, -371, -371, -371, -371, -371, -371, -371, -371, -371,
994 120, -6, 107, 108, 91, 120, 61, -371, 93, 105,
995 -371, 114, 115, 116, 117, 118, -371, 119, 87, -371,
996 -371, -371, -15, 121, -371, -371, -371, 122, 129, -17,
997 160, 201, -3, -371, 122, 21, -371, -371, -371, -371,
998 124, -371, 102, -371, -371, -371, -371, -371, 102, 102,
999 102, 102, 102, 102, -371, -371, -371, -371, 68, 72,
1000 8, -11, 126, 102, 99, 127, -371, -371, -371, -371,
1001 -371, -371, -371, -371, -371, -15, 135, -371, -371, -371,
1002 -371, 130, -371, -371, -371, -371, -371, -371, -371, 185,
1003 -371, -371, 48, 207, -371, 136, 137, -15, 138, -371,
1004 139, -371, -371, 64, -371, -371, 124, -371, 141, 142,
1005 143, 9, 144, 88, 145, 83, 86, 24, 146, 124,
1006 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1007 175, 64, -371, 147, -371, -371, 124, 148, 150, -371,
1008 73, -371, -371, -371, -371, -10, 152, -371, 151, -371,
1009 -371, -371, -371, -371, -371, 153, 102, 102, 155, 171,
1010 102, -371, -371, -371, -371, 219, 232, 235, -371, -371,
1011 -371, 237, -371, -371, -371, -371, 194, 237, 0, 161,
1012 239, -371, 163, -371, 124, -14, -371, -371, -371, 243,
1013 238, 58, 166, -371, 246, -371, 247, 246, -371, 102,
1014 -371, -371, 168, -371, -371, 176, 102, 167, -371, -371,
1015 -371, -371, -371, -371, 173, 172, 177, -371, 174, -371,
1016 178, -371, 179, -371, 180, -371, 181, -371, -371, -371,
1017 -371, -371, -371, -371, 253, -371, -371, -371, 256, -371,
1018 -371, -371, -371, -371, -371, -371, 182, -371, -371, -371,
1019 -371, 125, 257, -371, 183, -371, 186, 187, 76, -371,
1020 -371, 106, -371, 190, -7, 26, 265, -371, 103, 102,
1021 -371, -371, 236, 36, 83, -371, 189, -371, 191, -371,
1022 -371, -371, -371, -371, -371, -371, 192, -371, -371, -371,
1023 102, -371, 273, 274, -371, 102, -371, -371, -371, 90,
1024 8, 77, -371, -371, -371, -371, -371, -371, -371, -371,
1025 195, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1026 -371, -371, 267, -371, -371, 15, -371, -371, -371, 78,
1027 -371, -371, -371, -371, 199, 200, 202, -371, 240, 26,
1028 -371, -371, -371, -371, -371, -371, 102, -371, 102, 219,
1029 232, 203, -371, -371, 193, 206, 208, 205, 209, 215,
1030 257, -371, 102, -371, 219, -371, 232, 41, -371, -371,
1031 -371, 257, 211, -371
1034 /* YYPGOTO[NTERM-NUM]. */
1035 static const yytype_int16 yypgoto
[] =
1037 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1038 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1039 -371, -94, -88, 149, -371, -371, -326, -371, -92, -371,
1040 -371, -371, -371, -371, -371, -371, -371, 123, -371, -371,
1041 -371, -371, -371, -371, -371, 241, -371, -371, -371, 70,
1042 -371, -371, -371, -371, -371, -371, -371, -371, -371, -371,
1043 -74, -371, -81, -371, -371, -371, -371, -371, -371, -371,
1044 -371, -371, -371, -371, -295, 92, -371, -371, -371, -371,
1045 -371, -371, -371, -371, -371, -371, -371, -371, -29, -371,
1046 -371, -368, -371, -371, -371, -371, -371, 242, -371, -371,
1047 -371, -371, -371, -371, -371, -370, -306, 244, -371, -371,
1048 -371, -80, -110, -82, -371, -371, -371, -371, 268, -371,
1049 245, -371, -371, -371, -160, 154, -146, -371, -371, -371,
1053 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1054 positive, shift that token. If negative, reduce the rule which
1055 number is the opposite. If zero, do what YYDEFACT says.
1056 If YYTABLE_NINF, syntax error. */
1057 #define YYTABLE_NINF -53
1058 static const yytype_int16 yytable
[] =
1060 139, 133, 137, 190, 145, 228, 149, 106, 107, 152,
1061 214, 148, 251, 150, 151, 346, 147, 181, 147, 384,
1062 108, 147, 108, 241, 277, 182, 290, 291, 374, 407,
1063 278, 139, 279, 196, 5, 160, 56, 218, 183, 277,
1064 245, 184, 417, 161, 419, 278, 109, 140, 185, 236,
1065 162, 163, 164, 422, 165, 208, 166, 110, 109, 141,
1066 277, 369, 186, 57, 219, 167, 278, 292, 280, 110,
1067 281, 111, 405, 111, 7, 370, 112, 49, 187, 188,
1068 395, 66, 168, 169, 347, 281, 418, 349, 289, 85,
1069 86, 113, 299, 237, 409, 371, 153, 87, 350, 78,
1070 69, 70, 10, 113, 154, 158, 281, 372, 201, 223,
1071 420, 300, 222, 261, 223, 202, 51, 159, 260, 88,
1072 89, 224, 266, 385, 211, 147, 224, 155, 52, 69,
1073 70, 212, 113, 229, 90, 386, 230, 231, 421, 308,
1074 232, 156, 53, 378, 54, 11, 12, 13, 233, 14,
1075 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1076 25, 26, 1, 2, 375, 66, 234, 139, 61, 62,
1077 63, 64, 65, 249, 314, 73, 340, 389, 396, 74,
1078 250, 75, 104, 341, 390, 397, 361, 362, 363, 364,
1079 365, 191, 81, 92, 192, 193, 82, 93, 94, 95,
1080 96, 330, 331, 332, 333, 69, 70, 199, 200, 342,
1081 343, 76, 79, 80, 98, 99, 100, 101, 102, 103,
1082 127, 125, 126, 130, 56, 143, 197, -52, 195, 204,
1083 379, 367, 198, 139, 354, 137, 206, 207, 209, 210,
1084 242, 267, 215, 216, 217, 221, 227, 239, 244, 246,
1085 262, 247, 256, 264, 269, 259, 257, 271, 139, 273,
1086 275, 285, 284, 314, 288, 295, 297, 302, 303, 305,
1087 309, 310, 318, 315, 316, 325, 320, 319, 327, 335,
1088 321, 322, 323, 324, 329, 337, 404, 359, 338, 339,
1089 345, 376, 368, 377, 378, 380, 382, 391, 392, 398,
1090 411, 399, 414, 400, 410, 401, 412, 139, 354, 137,
1091 413, 415, 416, 423, 139, 403, 314, 307, 255, 276,
1092 128, 388, 0, 84, 134, 129, 135, 0, 0, 0,
1093 314, 0, 0, 0, 0, 243
1096 static const yytype_int16 yycheck
[] =
1098 82, 82, 82, 113, 92, 165, 100, 22, 23, 103,
1099 156, 99, 22, 101, 102, 22, 98, 28, 100, 345,
1100 37, 103, 37, 169, 24, 36, 40, 41, 323, 399,
1101 30, 113, 32, 125, 0, 27, 64, 28, 49, 24,
1102 186, 52, 410, 35, 414, 30, 61, 26, 59, 25,
1103 42, 43, 44, 421, 46, 147, 48, 72, 61, 38,
1104 24, 25, 73, 91, 55, 57, 30, 81, 68, 72,
1105 70, 88, 398, 88, 8, 39, 91, 99, 89, 90,
1106 375, 91, 74, 75, 91, 70, 412, 61, 234, 28,
1107 29, 106, 34, 69, 400, 59, 28, 36, 72, 105,
1108 103, 104, 91, 106, 36, 33, 70, 71, 60, 26,
1109 416, 53, 24, 207, 26, 67, 91, 45, 206, 58,
1110 59, 38, 210, 33, 60, 207, 38, 59, 91, 103,
1111 104, 67, 106, 47, 73, 45, 50, 51, 97, 249,
1112 54, 73, 91, 102, 91, 5, 6, 7, 62, 9,
1113 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1114 20, 21, 3, 4, 324, 91, 80, 249, 19, 20,
1115 21, 22, 23, 100, 256, 26, 100, 100, 100, 99,
1116 107, 99, 95, 107, 107, 107, 83, 84, 85, 86,
1117 87, 92, 101, 100, 95, 96, 105, 92, 93, 94,
1118 95, 76, 77, 78, 79, 103, 104, 22, 23, 103,
1119 104, 91, 105, 105, 100, 100, 100, 100, 100, 100,
1120 91, 100, 100, 22, 64, 101, 91, 101, 101, 22,
1121 340, 319, 102, 315, 315, 315, 100, 100, 100, 100,
1122 65, 22, 101, 101, 101, 101, 101, 101, 101, 101,
1123 95, 101, 100, 82, 22, 102, 105, 22, 340, 22,
1124 66, 22, 101, 345, 101, 22, 28, 101, 22, 22,
1125 102, 95, 100, 106, 101, 22, 102, 100, 22, 22,
1126 102, 102, 102, 102, 102, 102, 396, 22, 102, 102,
1127 100, 102, 56, 102, 102, 22, 22, 102, 31, 100,
1128 107, 101, 97, 101, 101, 65, 100, 389, 389, 389,
1129 102, 102, 97, 102, 396, 389, 398, 247, 195, 227,
1130 79, 350, -1, 55, 82, 80, 82, -1, -1, -1,
1131 412, -1, -1, -1, -1, 181
1134 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1135 symbol of state STATE-NUM. */
1136 static const yytype_uint8 yystos
[] =
1138 0, 3, 4, 109, 110, 0, 111, 8, 112, 113,
1139 91, 5, 6, 7, 9, 10, 11, 12, 13, 14,
1140 15, 16, 17, 18, 19, 20, 21, 114, 115, 116,
1141 117, 118, 119, 120, 121, 122, 123, 124, 125, 128,
1142 151, 152, 159, 160, 161, 222, 224, 227, 240, 99,
1143 225, 91, 91, 91, 91, 223, 64, 91, 131, 137,
1144 228, 131, 131, 131, 131, 131, 91, 132, 145, 103,
1145 104, 130, 221, 131, 99, 99, 91, 226, 105, 105,
1146 105, 101, 105, 163, 226, 28, 29, 36, 58, 59,
1147 73, 229, 100, 92, 93, 94, 95, 150, 100, 100,
1148 100, 100, 100, 100, 95, 147, 22, 23, 37, 61,
1149 72, 88, 91, 106, 136, 138, 153, 167, 170, 205,
1150 209, 212, 216, 218, 219, 100, 100, 91, 153, 228,
1151 22, 162, 166, 170, 205, 215, 217, 219, 220, 221,
1152 26, 38, 230, 101, 234, 130, 129, 221, 130, 129,
1153 130, 130, 129, 28, 36, 59, 73, 158, 33, 45,
1154 27, 35, 42, 43, 44, 46, 48, 57, 74, 75,
1155 171, 173, 176, 178, 180, 184, 187, 189, 191, 193,
1156 196, 28, 36, 49, 52, 59, 73, 89, 90, 154,
1157 220, 92, 95, 96, 149, 101, 136, 91, 102, 22,
1158 23, 60, 67, 231, 22, 237, 100, 100, 136, 100,
1159 100, 60, 67, 233, 234, 101, 101, 101, 28, 55,
1160 188, 101, 24, 26, 38, 177, 232, 101, 232, 47,
1161 50, 51, 54, 62, 80, 200, 25, 69, 192, 101,
1162 236, 234, 65, 233, 101, 234, 101, 101, 156, 100,
1163 107, 22, 139, 140, 141, 145, 100, 105, 164, 102,
1164 130, 129, 95, 148, 82, 126, 130, 22, 213, 22,
1165 214, 22, 190, 22, 183, 66, 183, 24, 30, 32,
1166 68, 70, 172, 182, 101, 22, 201, 202, 101, 234,
1167 40, 41, 81, 197, 198, 22, 239, 28, 181, 34,
1168 53, 185, 101, 22, 157, 22, 155, 157, 220, 102,
1169 95, 146, 133, 134, 221, 106, 101, 235, 100, 100,
1170 102, 102, 102, 102, 102, 22, 204, 22, 203, 102,
1171 76, 77, 78, 79, 186, 22, 199, 102, 102, 102,
1172 100, 107, 103, 104, 142, 100, 22, 91, 135, 61,
1173 72, 165, 168, 169, 170, 206, 207, 210, 215, 22,
1174 238, 83, 84, 85, 86, 87, 127, 130, 56, 25,
1175 39, 59, 71, 174, 182, 232, 102, 102, 102, 220,
1176 22, 143, 22, 144, 134, 33, 45, 194, 196, 100,
1177 107, 102, 31, 175, 179, 182, 100, 107, 100, 101,
1178 101, 65, 195, 168, 220, 134, 208, 213, 211, 214,
1179 101, 107, 100, 102, 97, 102, 97, 199, 134, 213,
1183 #define yyerrok (yyerrstatus = 0)
1184 #define yyclearin (yychar = YYEMPTY)
1185 #define YYEMPTY (-2)
1188 #define YYACCEPT goto yyacceptlab
1189 #define YYABORT goto yyabortlab
1190 #define YYERROR goto yyerrorlab
1193 /* Like YYERROR except do call yyerror. This remains here temporarily
1194 to ease the transition to the new meaning of YYERROR, for GCC.
1195 Once GCC version 2 has supplanted version 1, this can go. */
1197 #define YYFAIL goto yyerrlab
1199 #define YYRECOVERING() (!!yyerrstatus)
1201 #define YYBACKUP(Token, Value) \
1203 if (yychar == YYEMPTY && yylen == 1) \
1207 yytoken = YYTRANSLATE (yychar); \
1213 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1220 #define YYERRCODE 256
1223 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1224 If N is 0, then set CURRENT to the empty location which ends
1225 the previous symbol: RHS[0] (always defined). */
1227 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1228 #ifndef YYLLOC_DEFAULT
1229 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1233 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1234 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1235 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1236 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1240 (Current).first_line = (Current).last_line = \
1241 YYRHSLOC (Rhs, 0).last_line; \
1242 (Current).first_column = (Current).last_column = \
1243 YYRHSLOC (Rhs, 0).last_column; \
1249 /* YY_LOCATION_PRINT -- Print the location on the stream.
1250 This macro was not mandated originally: define only if we know
1251 we won't break user code: when these are the locations we know. */
1253 #ifndef YY_LOCATION_PRINT
1254 # if YYLTYPE_IS_TRIVIAL
1255 # define YY_LOCATION_PRINT(File, Loc) \
1256 fprintf (File, "%d.%d-%d.%d", \
1257 (Loc).first_line, (Loc).first_column, \
1258 (Loc).last_line, (Loc).last_column)
1260 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1265 /* YYLEX -- calling `yylex' with the right arguments. */
1268 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1270 # define YYLEX yylex (&yylval, &yylloc, scanner)
1273 /* Enable debugging if requested. */
1277 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1278 # define YYFPRINTF fprintf
1281 # define YYDPRINTF(Args) \
1287 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1291 YYFPRINTF (stderr, "%s ", Title); \
1292 yy_symbol_print (stderr, \
1293 Type, Value, Location, state); \
1294 YYFPRINTF (stderr, "\n"); \
1299 /*--------------------------------.
1300 | Print this symbol on YYOUTPUT. |
1301 `--------------------------------*/
1304 #if (defined __STDC__ || defined __C99__FUNC__ \
1305 || defined __cplusplus || defined _MSC_VER)
1307 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1310 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1313 YYSTYPE
const * const yyvaluep
;
1314 YYLTYPE
const * const yylocationp
;
1315 struct asm_parser_state
*state
;
1320 YYUSE (yylocationp
);
1323 if (yytype
< YYNTOKENS
)
1324 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1336 /*--------------------------------.
1337 | Print this symbol on YYOUTPUT. |
1338 `--------------------------------*/
1340 #if (defined __STDC__ || defined __C99__FUNC__ \
1341 || defined __cplusplus || defined _MSC_VER)
1343 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1346 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1349 YYSTYPE
const * const yyvaluep
;
1350 YYLTYPE
const * const yylocationp
;
1351 struct asm_parser_state
*state
;
1354 if (yytype
< YYNTOKENS
)
1355 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1357 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1359 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1360 YYFPRINTF (yyoutput
, ": ");
1361 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1362 YYFPRINTF (yyoutput
, ")");
1365 /*------------------------------------------------------------------.
1366 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1368 `------------------------------------------------------------------*/
1370 #if (defined __STDC__ || defined __C99__FUNC__ \
1371 || defined __cplusplus || defined _MSC_VER)
1373 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1376 yy_stack_print (yybottom
, yytop
)
1377 yytype_int16
*yybottom
;
1378 yytype_int16
*yytop
;
1381 YYFPRINTF (stderr
, "Stack now");
1382 for (; yybottom
<= yytop
; yybottom
++)
1384 int yybot
= *yybottom
;
1385 YYFPRINTF (stderr
, " %d", yybot
);
1387 YYFPRINTF (stderr
, "\n");
1390 # define YY_STACK_PRINT(Bottom, Top) \
1393 yy_stack_print ((Bottom), (Top)); \
1397 /*------------------------------------------------.
1398 | Report that the YYRULE is going to be reduced. |
1399 `------------------------------------------------*/
1401 #if (defined __STDC__ || defined __C99__FUNC__ \
1402 || defined __cplusplus || defined _MSC_VER)
1404 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1407 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1411 struct asm_parser_state
*state
;
1414 int yynrhs
= yyr2
[yyrule
];
1416 unsigned long int yylno
= yyrline
[yyrule
];
1417 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1419 /* The symbols being reduced. */
1420 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1422 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1423 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1424 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1425 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1426 YYFPRINTF (stderr
, "\n");
1430 # define YY_REDUCE_PRINT(Rule) \
1433 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1436 /* Nonzero means print parse trace. It is left uninitialized so that
1437 multiple parsers can coexist. */
1439 #else /* !YYDEBUG */
1440 # define YYDPRINTF(Args)
1441 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1442 # define YY_STACK_PRINT(Bottom, Top)
1443 # define YY_REDUCE_PRINT(Rule)
1444 #endif /* !YYDEBUG */
1447 /* YYINITDEPTH -- initial size of the parser's stacks. */
1449 # define YYINITDEPTH 200
1452 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1453 if the built-in stack extension method is used).
1455 Do not make this value too large; the results are undefined if
1456 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1457 evaluated with infinite-precision integer arithmetic. */
1460 # define YYMAXDEPTH 10000
1468 # if defined __GLIBC__ && defined _STRING_H
1469 # define yystrlen strlen
1471 /* Return the length of YYSTR. */
1472 #if (defined __STDC__ || defined __C99__FUNC__ \
1473 || defined __cplusplus || defined _MSC_VER)
1475 yystrlen (const char *yystr
)
1483 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1491 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1492 # define yystpcpy stpcpy
1494 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1496 #if (defined __STDC__ || defined __C99__FUNC__ \
1497 || defined __cplusplus || defined _MSC_VER)
1499 yystpcpy (char *yydest
, const char *yysrc
)
1502 yystpcpy (yydest
, yysrc
)
1508 const char *yys
= yysrc
;
1510 while ((*yyd
++ = *yys
++) != '\0')
1519 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1520 quotes and backslashes, so that it's suitable for yyerror. The
1521 heuristic is that double-quoting is unnecessary unless the string
1522 contains an apostrophe, a comma, or backslash (other than
1523 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1524 null, do not copy; instead, return the length of what the result
1527 yytnamerr (char *yyres
, const char *yystr
)
1532 char const *yyp
= yystr
;
1539 goto do_not_strip_quotes
;
1543 goto do_not_strip_quotes
;
1556 do_not_strip_quotes
: ;
1560 return yystrlen (yystr
);
1562 return yystpcpy (yyres
, yystr
) - yyres
;
1566 /* Copy into YYRESULT an error message about the unexpected token
1567 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1568 including the terminating null byte. If YYRESULT is null, do not
1569 copy anything; just return the number of bytes that would be
1570 copied. As a special case, return 0 if an ordinary "syntax error"
1571 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1572 size calculation. */
1574 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1576 int yyn
= yypact
[yystate
];
1578 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1582 int yytype
= YYTRANSLATE (yychar
);
1583 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1584 YYSIZE_T yysize
= yysize0
;
1586 int yysize_overflow
= 0;
1587 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1588 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1592 /* This is so xgettext sees the translatable formats that are
1593 constructed on the fly. */
1594 YY_("syntax error, unexpected %s");
1595 YY_("syntax error, unexpected %s, expecting %s");
1596 YY_("syntax error, unexpected %s, expecting %s or %s");
1597 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1598 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1602 static char const yyunexpected
[] = "syntax error, unexpected %s";
1603 static char const yyexpecting
[] = ", expecting %s";
1604 static char const yyor
[] = " or %s";
1605 char yyformat
[sizeof yyunexpected
1606 + sizeof yyexpecting
- 1
1607 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1608 * (sizeof yyor
- 1))];
1609 char const *yyprefix
= yyexpecting
;
1611 /* Start YYX at -YYN if negative to avoid negative indexes in
1613 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1615 /* Stay within bounds of both yycheck and yytname. */
1616 int yychecklim
= YYLAST
- yyn
+ 1;
1617 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1620 yyarg
[0] = yytname
[yytype
];
1621 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1623 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1624 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1626 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1630 yyformat
[sizeof yyunexpected
- 1] = '\0';
1633 yyarg
[yycount
++] = yytname
[yyx
];
1634 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1635 yysize_overflow
|= (yysize1
< yysize
);
1637 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1641 yyf
= YY_(yyformat
);
1642 yysize1
= yysize
+ yystrlen (yyf
);
1643 yysize_overflow
|= (yysize1
< yysize
);
1646 if (yysize_overflow
)
1647 return YYSIZE_MAXIMUM
;
1651 /* Avoid sprintf, as that infringes on the user's name space.
1652 Don't have undefined behavior even if the translation
1653 produced a string with the wrong number of "%s"s. */
1654 char *yyp
= yyresult
;
1656 while ((*yyp
= *yyf
) != '\0')
1658 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1660 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1673 #endif /* YYERROR_VERBOSE */
1676 /*-----------------------------------------------.
1677 | Release the memory associated to this symbol. |
1678 `-----------------------------------------------*/
1681 #if (defined __STDC__ || defined __C99__FUNC__ \
1682 || defined __cplusplus || defined _MSC_VER)
1684 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1687 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1691 YYLTYPE
*yylocationp
;
1692 struct asm_parser_state
*state
;
1696 YYUSE (yylocationp
);
1701 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1711 /* Prevent warnings from -Wmissing-prototypes. */
1712 #ifdef YYPARSE_PARAM
1713 #if defined __STDC__ || defined __cplusplus
1714 int yyparse (void *YYPARSE_PARAM
);
1718 #else /* ! YYPARSE_PARAM */
1719 #if defined __STDC__ || defined __cplusplus
1720 int yyparse (struct asm_parser_state
*state
);
1724 #endif /* ! YYPARSE_PARAM */
1730 /*-------------------------.
1731 | yyparse or yypush_parse. |
1732 `-------------------------*/
1734 #ifdef YYPARSE_PARAM
1735 #if (defined __STDC__ || defined __C99__FUNC__ \
1736 || defined __cplusplus || defined _MSC_VER)
1738 yyparse (void *YYPARSE_PARAM
)
1741 yyparse (YYPARSE_PARAM
)
1742 void *YYPARSE_PARAM
;
1744 #else /* ! YYPARSE_PARAM */
1745 #if (defined __STDC__ || defined __C99__FUNC__ \
1746 || defined __cplusplus || defined _MSC_VER)
1748 yyparse (struct asm_parser_state
*state
)
1752 struct asm_parser_state
*state
;
1756 /* The lookahead symbol. */
1759 /* The semantic value of the lookahead symbol. */
1762 /* Location data for the lookahead symbol. */
1765 /* Number of syntax errors so far. */
1769 /* Number of tokens to shift before error messages enabled. */
1772 /* The stacks and their tools:
1773 `yyss': related to states.
1774 `yyvs': related to semantic values.
1775 `yyls': related to locations.
1777 Refer to the stacks thru separate pointers, to allow yyoverflow
1778 to reallocate them elsewhere. */
1780 /* The state stack. */
1781 yytype_int16 yyssa
[YYINITDEPTH
];
1783 yytype_int16
*yyssp
;
1785 /* The semantic value stack. */
1786 YYSTYPE yyvsa
[YYINITDEPTH
];
1790 /* The location stack. */
1791 YYLTYPE yylsa
[YYINITDEPTH
];
1795 /* The locations where the error started and ended. */
1796 YYLTYPE yyerror_range
[2];
1798 YYSIZE_T yystacksize
;
1802 /* Lookahead token as an internal (translated) token number. */
1804 /* The variables used to return semantic value and location from the
1810 /* Buffer for error messages, and its allocated size. */
1812 char *yymsg
= yymsgbuf
;
1813 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1816 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1818 /* The number of symbols on the RHS of the reduced rule.
1819 Keep to zero when no symbol should be popped. */
1826 yystacksize
= YYINITDEPTH
;
1828 YYDPRINTF ((stderr
, "Starting parse\n"));
1833 yychar
= YYEMPTY
; /* Cause a token to be read. */
1835 /* Initialize stack pointers.
1836 Waste one element of value and location stack
1837 so that they stay on the same level as the state stack.
1838 The wasted elements are never initialized. */
1843 #if YYLTYPE_IS_TRIVIAL
1844 /* Initialize the default location before parsing starts. */
1845 yylloc
.first_line
= yylloc
.last_line
= 1;
1846 yylloc
.first_column
= yylloc
.last_column
= 1;
1851 /*------------------------------------------------------------.
1852 | yynewstate -- Push a new state, which is found in yystate. |
1853 `------------------------------------------------------------*/
1855 /* In all cases, when you get here, the value and location stacks
1856 have just been pushed. So pushing a state here evens the stacks. */
1862 if (yyss
+ yystacksize
- 1 <= yyssp
)
1864 /* Get the current used size of the three stacks, in elements. */
1865 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1869 /* Give user a chance to reallocate the stack. Use copies of
1870 these so that the &'s don't force the real ones into
1872 YYSTYPE
*yyvs1
= yyvs
;
1873 yytype_int16
*yyss1
= yyss
;
1874 YYLTYPE
*yyls1
= yyls
;
1876 /* Each stack pointer address is followed by the size of the
1877 data in use in that stack, in bytes. This used to be a
1878 conditional around just the two extra args, but that might
1879 be undefined if yyoverflow is a macro. */
1880 yyoverflow (YY_("memory exhausted"),
1881 &yyss1
, yysize
* sizeof (*yyssp
),
1882 &yyvs1
, yysize
* sizeof (*yyvsp
),
1883 &yyls1
, yysize
* sizeof (*yylsp
),
1890 #else /* no yyoverflow */
1891 # ifndef YYSTACK_RELOCATE
1892 goto yyexhaustedlab
;
1894 /* Extend the stack our own way. */
1895 if (YYMAXDEPTH
<= yystacksize
)
1896 goto yyexhaustedlab
;
1898 if (YYMAXDEPTH
< yystacksize
)
1899 yystacksize
= YYMAXDEPTH
;
1902 yytype_int16
*yyss1
= yyss
;
1903 union yyalloc
*yyptr
=
1904 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1906 goto yyexhaustedlab
;
1907 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1908 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1909 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1910 # undef YYSTACK_RELOCATE
1912 YYSTACK_FREE (yyss1
);
1915 #endif /* no yyoverflow */
1917 yyssp
= yyss
+ yysize
- 1;
1918 yyvsp
= yyvs
+ yysize
- 1;
1919 yylsp
= yyls
+ yysize
- 1;
1921 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1922 (unsigned long int) yystacksize
));
1924 if (yyss
+ yystacksize
- 1 <= yyssp
)
1928 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1930 if (yystate
== YYFINAL
)
1940 /* Do appropriate processing given the current state. Read a
1941 lookahead token if we need one and don't already have one. */
1943 /* First try to decide what to do without reference to lookahead token. */
1944 yyn
= yypact
[yystate
];
1945 if (yyn
== YYPACT_NINF
)
1948 /* Not known => get a lookahead token if don't already have one. */
1950 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1951 if (yychar
== YYEMPTY
)
1953 YYDPRINTF ((stderr
, "Reading a token: "));
1957 if (yychar
<= YYEOF
)
1959 yychar
= yytoken
= YYEOF
;
1960 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1964 yytoken
= YYTRANSLATE (yychar
);
1965 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1968 /* If the proper action on seeing token YYTOKEN is to reduce or to
1969 detect an error, take that action. */
1971 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1976 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1982 /* Count tokens shifted since error; after three, turn off error
1987 /* Shift the lookahead token. */
1988 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1990 /* Discard the shifted token. */
1999 /*-----------------------------------------------------------.
2000 | yydefault -- do the default action for the current state. |
2001 `-----------------------------------------------------------*/
2003 yyn
= yydefact
[yystate
];
2009 /*-----------------------------.
2010 | yyreduce -- Do a reduction. |
2011 `-----------------------------*/
2013 /* yyn is the number of a rule to reduce with. */
2016 /* If YYLEN is nonzero, implement the default value of the action:
2019 Otherwise, the following line sets YYVAL to garbage.
2020 This behavior is undocumented and Bison
2021 users should not rely upon it. Assigning to YYVAL
2022 unconditionally makes the parser a bit smaller, and it avoids a
2023 GCC warning that YYVAL may be used uninitialized. */
2024 yyval
= yyvsp
[1-yylen
];
2026 /* Default location. */
2027 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2028 YY_REDUCE_PRINT (yyn
);
2033 /* Line 1455 of yacc.c */
2034 #line 244 "program_parse.y"
2036 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2037 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2040 state
->mode
= ARB_vertex
;
2046 /* Line 1455 of yacc.c */
2047 #line 252 "program_parse.y"
2049 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2050 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2052 state
->mode
= ARB_fragment
;
2058 /* Line 1455 of yacc.c */
2059 #line 265 "program_parse.y"
2063 if (state
->mode
== ARB_vertex
) {
2064 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2065 } else if (state
->mode
== ARB_fragment
) {
2066 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2071 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid option string");
2079 /* Line 1455 of yacc.c */
2080 #line 287 "program_parse.y"
2082 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2083 if (state
->inst_tail
== NULL
) {
2084 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2086 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2089 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2090 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2092 state
->prog
->NumInstructions
++;
2099 /* Line 1455 of yacc.c */
2100 #line 322 "program_parse.y"
2102 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2108 /* Line 1455 of yacc.c */
2109 #line 328 "program_parse.y"
2111 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2112 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2118 /* Line 1455 of yacc.c */
2119 #line 335 "program_parse.y"
2121 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2122 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2128 /* Line 1455 of yacc.c */
2129 #line 342 "program_parse.y"
2131 (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
);
2132 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2138 /* Line 1455 of yacc.c */
2139 #line 350 "program_parse.y"
2141 (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
);
2142 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2148 /* Line 1455 of yacc.c */
2149 #line 358 "program_parse.y"
2151 (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
));
2152 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2158 /* Line 1455 of yacc.c */
2159 #line 365 "program_parse.y"
2161 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (8)].temp_inst
).Opcode
, & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2162 if ((yyval
.inst
) != NULL
) {
2163 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2164 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2165 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2172 /* Line 1455 of yacc.c */
2173 #line 376 "program_parse.y"
2175 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2181 /* Line 1455 of yacc.c */
2182 #line 382 "program_parse.y"
2184 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2190 /* Line 1455 of yacc.c */
2191 #line 387 "program_parse.y"
2192 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2197 /* Line 1455 of yacc.c */
2198 #line 388 "program_parse.y"
2199 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2204 /* Line 1455 of yacc.c */
2205 #line 389 "program_parse.y"
2206 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2211 /* Line 1455 of yacc.c */
2212 #line 390 "program_parse.y"
2213 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2218 /* Line 1455 of yacc.c */
2219 #line 391 "program_parse.y"
2220 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2225 /* Line 1455 of yacc.c */
2226 #line 395 "program_parse.y"
2228 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2229 * FIXME: to the existing swizzle?
2231 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2233 (yyval
.inst
) = asm_instruction_ctor(OPCODE_SWZ
, & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2234 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2240 /* Line 1455 of yacc.c */
2241 #line 407 "program_parse.y"
2243 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2245 if ((yyvsp
[(1) - (3)].negate
)) {
2246 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2249 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2250 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2256 /* Line 1455 of yacc.c */
2257 #line 420 "program_parse.y"
2259 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2261 if ((yyvsp
[(1) - (3)].negate
)) {
2262 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2265 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2266 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2272 /* Line 1455 of yacc.c */
2273 #line 433 "program_parse.y"
2275 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
2276 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2278 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2279 /* Technically speaking, this should check that it is in
2280 * vertex program mode. However, PositionInvariant can never be
2281 * set in fragment program mode, so it is somewhat irrelevant.
2283 if (state
->option
.PositionInvariant
2284 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2285 yyerror(& (yylsp
[(1) - (2)]), state
, "position-invariant programs cannot "
2290 state
->prog
->OutputsWritten
|= (1U << (yyval
.dst_reg
).Index
);
2297 /* Line 1455 of yacc.c */
2298 #line 455 "program_parse.y"
2300 init_dst_reg(& (yyval
.dst_reg
));
2301 (yyval
.dst_reg
).File
= PROGRAM_ADDRESS
;
2302 (yyval
.dst_reg
).Index
= 0;
2303 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2309 /* Line 1455 of yacc.c */
2310 #line 464 "program_parse.y"
2312 (yyval
.swiz_mask
).swizzle
= MAKE_SWIZZLE4((yyvsp
[(1) - (7)].swiz_mask
).swizzle
, (yyvsp
[(3) - (7)].swiz_mask
).swizzle
,
2313 (yyvsp
[(5) - (7)].swiz_mask
).swizzle
, (yyvsp
[(7) - (7)].swiz_mask
).swizzle
);
2314 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].swiz_mask
).mask
) | ((yyvsp
[(3) - (7)].swiz_mask
).mask
<< 1) | ((yyvsp
[(5) - (7)].swiz_mask
).mask
<< 2)
2315 | ((yyvsp
[(7) - (7)].swiz_mask
).mask
<< 3);
2321 /* Line 1455 of yacc.c */
2322 #line 473 "program_parse.y"
2324 (yyval
.swiz_mask
).swizzle
= (yyvsp
[(2) - (2)].integer
);
2325 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2331 /* Line 1455 of yacc.c */
2332 #line 480 "program_parse.y"
2334 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2335 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2339 (yyval
.integer
) = ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2345 /* Line 1455 of yacc.c */
2346 #line 489 "program_parse.y"
2348 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2349 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2353 switch ((yyvsp
[(1) - (1)].string
)[0]) {
2355 (yyval
.integer
) = SWIZZLE_X
;
2358 (yyval
.integer
) = SWIZZLE_Y
;
2361 (yyval
.integer
) = SWIZZLE_Z
;
2364 (yyval
.integer
) = SWIZZLE_W
;
2367 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2376 /* Line 1455 of yacc.c */
2377 #line 517 "program_parse.y"
2379 struct asm_symbol
*const s
= (struct asm_symbol
*)
2380 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2383 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2385 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2386 && (s
->type
!= at_attrib
)) {
2387 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2389 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2390 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2394 init_src_reg(& (yyval
.src_reg
));
2397 (yyval
.src_reg
).Base
.File
= PROGRAM_TEMPORARY
;
2398 (yyval
.src_reg
).Base
.Index
= s
->temp_binding
;
2401 (yyval
.src_reg
).Base
.File
= s
->param_binding_type
;
2402 (yyval
.src_reg
).Base
.Index
= s
->param_binding_begin
;
2405 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2406 (yyval
.src_reg
).Base
.Index
= s
->attrib_binding
;
2407 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2409 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2423 /* Line 1455 of yacc.c */
2424 #line 559 "program_parse.y"
2426 init_src_reg(& (yyval
.src_reg
));
2427 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2428 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].attrib
);
2429 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2431 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2439 /* Line 1455 of yacc.c */
2440 #line 570 "program_parse.y"
2442 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2443 && ((yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2444 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2448 init_src_reg(& (yyval
.src_reg
));
2449 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2451 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2452 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2454 (yyval
.src_reg
).Base
.RelAddr
= 1;
2455 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2456 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2458 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2465 /* Line 1455 of yacc.c */
2466 #line 591 "program_parse.y"
2468 init_src_reg(& (yyval
.src_reg
));
2469 (yyval
.src_reg
).Base
.File
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2470 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2472 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
;
2478 /* Line 1455 of yacc.c */
2479 #line 601 "program_parse.y"
2481 init_dst_reg(& (yyval
.dst_reg
));
2482 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2483 (yyval
.dst_reg
).Index
= (yyvsp
[(1) - (1)].result
);
2489 /* Line 1455 of yacc.c */
2490 #line 607 "program_parse.y"
2492 struct asm_symbol
*const s
= (struct asm_symbol
*)
2493 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2496 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2498 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2499 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2503 init_dst_reg(& (yyval
.dst_reg
));
2504 if (s
->type
== at_temp
) {
2505 (yyval
.dst_reg
).File
= PROGRAM_TEMPORARY
;
2506 (yyval
.dst_reg
).Index
= s
->temp_binding
;
2508 (yyval
.dst_reg
).File
= s
->param_binding_type
;
2509 (yyval
.dst_reg
).Index
= s
->param_binding_begin
;
2516 /* Line 1455 of yacc.c */
2517 #line 631 "program_parse.y"
2519 struct asm_symbol
*const s
= (struct asm_symbol
*)
2520 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2523 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2525 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2526 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2536 /* Line 1455 of yacc.c */
2537 #line 650 "program_parse.y"
2539 init_src_reg(& (yyval
.src_reg
));
2540 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2546 /* Line 1455 of yacc.c */
2547 #line 657 "program_parse.y"
2549 /* FINISHME: Add support for multiple address registers.
2551 /* FINISHME: Add support for 4-component address registers.
2553 init_src_reg(& (yyval
.src_reg
));
2554 (yyval
.src_reg
).Base
.RelAddr
= 1;
2555 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2561 /* Line 1455 of yacc.c */
2562 #line 668 "program_parse.y"
2563 { (yyval
.integer
) = 0; ;}
2568 /* Line 1455 of yacc.c */
2569 #line 669 "program_parse.y"
2570 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2575 /* Line 1455 of yacc.c */
2576 #line 670 "program_parse.y"
2577 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2582 /* Line 1455 of yacc.c */
2583 #line 674 "program_parse.y"
2585 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2586 yyerror(& (yylsp
[(1) - (1)]), state
,
2587 "relative address offset too large (positive)");
2590 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2597 /* Line 1455 of yacc.c */
2598 #line 686 "program_parse.y"
2600 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2601 yyerror(& (yylsp
[(1) - (1)]), state
,
2602 "relative address offset too large (negative)");
2605 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2612 /* Line 1455 of yacc.c */
2613 #line 698 "program_parse.y"
2615 struct asm_symbol
*const s
= (struct asm_symbol
*)
2616 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2619 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
2621 } else if (s
->type
!= at_address
) {
2622 yyerror(& (yylsp
[(1) - (1)]), state
,
2623 "invalid variable for indexed array access");
2633 /* Line 1455 of yacc.c */
2634 #line 716 "program_parse.y"
2636 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2637 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
2640 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2647 /* Line 1455 of yacc.c */
2648 #line 727 "program_parse.y"
2650 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2651 yyerror(& (yylsp
[(1) - (1)]), state
,
2652 "address register write mask must be \".x\"");
2655 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2662 /* Line 1455 of yacc.c */
2663 #line 743 "program_parse.y"
2664 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2669 /* Line 1455 of yacc.c */
2670 #line 747 "program_parse.y"
2671 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2676 /* Line 1455 of yacc.c */
2677 #line 759 "program_parse.y"
2679 struct asm_symbol
*const s
=
2680 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
2685 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
2686 state
->InputsBound
|= (1U << s
->attrib_binding
);
2688 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
2697 /* Line 1455 of yacc.c */
2698 #line 777 "program_parse.y"
2700 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2706 /* Line 1455 of yacc.c */
2707 #line 781 "program_parse.y"
2709 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2715 /* Line 1455 of yacc.c */
2716 #line 787 "program_parse.y"
2718 (yyval
.attrib
) = VERT_ATTRIB_POS
;
2724 /* Line 1455 of yacc.c */
2725 #line 791 "program_parse.y"
2727 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
2733 /* Line 1455 of yacc.c */
2734 #line 795 "program_parse.y"
2736 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
2742 /* Line 1455 of yacc.c */
2743 #line 799 "program_parse.y"
2745 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
2751 /* Line 1455 of yacc.c */
2752 #line 803 "program_parse.y"
2754 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
2760 /* Line 1455 of yacc.c */
2761 #line 807 "program_parse.y"
2763 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
2769 /* Line 1455 of yacc.c */
2770 #line 811 "program_parse.y"
2778 /* Line 1455 of yacc.c */
2779 #line 815 "program_parse.y"
2781 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
2787 /* Line 1455 of yacc.c */
2788 #line 821 "program_parse.y"
2790 if ((yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
2791 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
2795 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2801 /* Line 1455 of yacc.c */
2802 #line 835 "program_parse.y"
2804 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
2810 /* Line 1455 of yacc.c */
2811 #line 839 "program_parse.y"
2813 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
2819 /* Line 1455 of yacc.c */
2820 #line 843 "program_parse.y"
2822 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
2828 /* Line 1455 of yacc.c */
2829 #line 847 "program_parse.y"
2831 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
2837 /* Line 1455 of yacc.c */
2838 #line 855 "program_parse.y"
2840 struct asm_symbol
*const s
=
2841 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
2846 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
2847 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
2848 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
2849 s
->param_is_array
= 0;
2856 /* Line 1455 of yacc.c */
2857 #line 871 "program_parse.y"
2859 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
2860 yyerror(& (yylsp
[(4) - (6)]), state
,
2861 "parameter array size and number of bindings must match");
2864 struct asm_symbol
*const s
=
2865 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
2870 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
2871 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
2872 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
2873 s
->param_is_array
= 1;
2881 /* Line 1455 of yacc.c */
2882 #line 893 "program_parse.y"
2884 (yyval
.integer
) = 0;
2890 /* Line 1455 of yacc.c */
2891 #line 897 "program_parse.y"
2893 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxParameters
)) {
2894 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
2897 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2904 /* Line 1455 of yacc.c */
2905 #line 908 "program_parse.y"
2907 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
2913 /* Line 1455 of yacc.c */
2914 #line 914 "program_parse.y"
2916 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
2922 /* Line 1455 of yacc.c */
2923 #line 921 "program_parse.y"
2925 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
2926 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
2932 /* Line 1455 of yacc.c */
2933 #line 928 "program_parse.y"
2935 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2936 (yyval
.temp_sym
).param_binding_begin
= ~0;
2937 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2943 /* Line 1455 of yacc.c */
2944 #line 934 "program_parse.y"
2946 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2947 (yyval
.temp_sym
).param_binding_begin
= ~0;
2948 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2954 /* Line 1455 of yacc.c */
2955 #line 940 "program_parse.y"
2957 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2958 (yyval
.temp_sym
).param_binding_begin
= ~0;
2959 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
2965 /* Line 1455 of yacc.c */
2966 #line 948 "program_parse.y"
2968 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2969 (yyval
.temp_sym
).param_binding_begin
= ~0;
2970 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2976 /* Line 1455 of yacc.c */
2977 #line 954 "program_parse.y"
2979 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2980 (yyval
.temp_sym
).param_binding_begin
= ~0;
2981 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
2987 /* Line 1455 of yacc.c */
2988 #line 960 "program_parse.y"
2990 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
2991 (yyval
.temp_sym
).param_binding_begin
= ~0;
2992 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
2998 /* Line 1455 of yacc.c */
2999 #line 968 "program_parse.y"
3001 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3002 (yyval
.temp_sym
).param_binding_begin
= ~0;
3003 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3009 /* Line 1455 of yacc.c */
3010 #line 974 "program_parse.y"
3012 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3013 (yyval
.temp_sym
).param_binding_begin
= ~0;
3014 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3020 /* Line 1455 of yacc.c */
3021 #line 980 "program_parse.y"
3023 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3024 (yyval
.temp_sym
).param_binding_begin
= ~0;
3025 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3031 /* Line 1455 of yacc.c */
3032 #line 987 "program_parse.y"
3033 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3038 /* Line 1455 of yacc.c */
3039 #line 988 "program_parse.y"
3040 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3045 /* Line 1455 of yacc.c */
3046 #line 991 "program_parse.y"
3047 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3052 /* Line 1455 of yacc.c */
3053 #line 992 "program_parse.y"
3054 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3059 /* Line 1455 of yacc.c */
3060 #line 993 "program_parse.y"
3061 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3066 /* Line 1455 of yacc.c */
3067 #line 994 "program_parse.y"
3068 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3073 /* Line 1455 of yacc.c */
3074 #line 995 "program_parse.y"
3075 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3080 /* Line 1455 of yacc.c */
3081 #line 996 "program_parse.y"
3082 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3087 /* Line 1455 of yacc.c */
3088 #line 997 "program_parse.y"
3089 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3094 /* Line 1455 of yacc.c */
3095 #line 998 "program_parse.y"
3096 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3101 /* Line 1455 of yacc.c */
3102 #line 999 "program_parse.y"
3103 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3108 /* Line 1455 of yacc.c */
3109 #line 1000 "program_parse.y"
3110 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3115 /* Line 1455 of yacc.c */
3116 #line 1004 "program_parse.y"
3118 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3119 (yyval
.state
)[0] = STATE_MATERIAL
;
3120 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3121 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3127 /* Line 1455 of yacc.c */
3128 #line 1013 "program_parse.y"
3130 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3136 /* Line 1455 of yacc.c */
3137 #line 1017 "program_parse.y"
3139 (yyval
.integer
) = STATE_EMISSION
;
3145 /* Line 1455 of yacc.c */
3146 #line 1021 "program_parse.y"
3148 (yyval
.integer
) = STATE_SHININESS
;
3154 /* Line 1455 of yacc.c */
3155 #line 1027 "program_parse.y"
3157 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3158 (yyval
.state
)[0] = STATE_LIGHT
;
3159 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3160 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3166 /* Line 1455 of yacc.c */
3167 #line 1036 "program_parse.y"
3169 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3175 /* Line 1455 of yacc.c */
3176 #line 1040 "program_parse.y"
3178 (yyval
.integer
) = STATE_POSITION
;
3184 /* Line 1455 of yacc.c */
3185 #line 1044 "program_parse.y"
3187 (yyval
.integer
) = STATE_ATTENUATION
;
3193 /* Line 1455 of yacc.c */
3194 #line 1048 "program_parse.y"
3196 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3202 /* Line 1455 of yacc.c */
3203 #line 1052 "program_parse.y"
3205 (yyval
.integer
) = STATE_HALF_VECTOR
;
3211 /* Line 1455 of yacc.c */
3212 #line 1058 "program_parse.y"
3214 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3220 /* Line 1455 of yacc.c */
3221 #line 1064 "program_parse.y"
3223 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3224 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3230 /* Line 1455 of yacc.c */
3231 #line 1071 "program_parse.y"
3233 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3234 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3240 /* Line 1455 of yacc.c */
3241 #line 1076 "program_parse.y"
3243 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3244 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3245 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3251 /* Line 1455 of yacc.c */
3252 #line 1084 "program_parse.y"
3254 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3255 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3256 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3257 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3258 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3264 /* Line 1455 of yacc.c */
3265 #line 1096 "program_parse.y"
3267 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3268 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3269 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3275 /* Line 1455 of yacc.c */
3276 #line 1104 "program_parse.y"
3278 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3284 /* Line 1455 of yacc.c */
3285 #line 1110 "program_parse.y"
3287 (yyval
.integer
) = STATE_AMBIENT
;
3293 /* Line 1455 of yacc.c */
3294 #line 1114 "program_parse.y"
3296 (yyval
.integer
) = STATE_DIFFUSE
;
3302 /* Line 1455 of yacc.c */
3303 #line 1118 "program_parse.y"
3305 (yyval
.integer
) = STATE_SPECULAR
;
3311 /* Line 1455 of yacc.c */
3312 #line 1124 "program_parse.y"
3314 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3315 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3319 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3325 /* Line 1455 of yacc.c */
3326 #line 1135 "program_parse.y"
3328 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3329 (yyval
.state
)[0] = STATE_TEXGEN
;
3330 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3331 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3337 /* Line 1455 of yacc.c */
3338 #line 1144 "program_parse.y"
3340 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3346 /* Line 1455 of yacc.c */
3347 #line 1148 "program_parse.y"
3349 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3355 /* Line 1455 of yacc.c */
3356 #line 1153 "program_parse.y"
3358 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3364 /* Line 1455 of yacc.c */
3365 #line 1157 "program_parse.y"
3367 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3373 /* Line 1455 of yacc.c */
3374 #line 1161 "program_parse.y"
3376 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3382 /* Line 1455 of yacc.c */
3383 #line 1165 "program_parse.y"
3385 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3391 /* Line 1455 of yacc.c */
3392 #line 1171 "program_parse.y"
3394 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3395 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3401 /* Line 1455 of yacc.c */
3402 #line 1178 "program_parse.y"
3404 (yyval
.integer
) = STATE_FOG_COLOR
;
3410 /* Line 1455 of yacc.c */
3411 #line 1182 "program_parse.y"
3413 (yyval
.integer
) = STATE_FOG_PARAMS
;
3419 /* Line 1455 of yacc.c */
3420 #line 1188 "program_parse.y"
3422 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3423 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3424 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3430 /* Line 1455 of yacc.c */
3431 #line 1196 "program_parse.y"
3433 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3434 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3438 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3444 /* Line 1455 of yacc.c */
3445 #line 1207 "program_parse.y"
3447 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3448 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3454 /* Line 1455 of yacc.c */
3455 #line 1214 "program_parse.y"
3457 (yyval
.integer
) = STATE_POINT_SIZE
;
3463 /* Line 1455 of yacc.c */
3464 #line 1218 "program_parse.y"
3466 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3472 /* Line 1455 of yacc.c */
3473 #line 1224 "program_parse.y"
3475 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
3476 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
3477 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3478 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3479 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
3485 /* Line 1455 of yacc.c */
3486 #line 1234 "program_parse.y"
3488 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
3489 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
3490 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
3491 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
3492 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
3498 /* Line 1455 of yacc.c */
3499 #line 1244 "program_parse.y"
3501 (yyval
.state
)[2] = 0;
3502 (yyval
.state
)[3] = 3;
3508 /* Line 1455 of yacc.c */
3509 #line 1249 "program_parse.y"
3511 /* It seems logical that the matrix row range specifier would have
3512 * to specify a range or more than one row (i.e., $5 > $3).
3513 * However, the ARB_vertex_program spec says "a program will fail
3514 * to load if <a> is greater than <b>." This means that $3 == $5
3517 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
3518 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
3522 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
3523 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
3529 /* Line 1455 of yacc.c */
3530 #line 1267 "program_parse.y"
3532 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
3533 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
3534 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3540 /* Line 1455 of yacc.c */
3541 #line 1275 "program_parse.y"
3543 (yyval
.integer
) = 0;
3549 /* Line 1455 of yacc.c */
3550 #line 1279 "program_parse.y"
3552 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3558 /* Line 1455 of yacc.c */
3559 #line 1285 "program_parse.y"
3561 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
3567 /* Line 1455 of yacc.c */
3568 #line 1289 "program_parse.y"
3570 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
3576 /* Line 1455 of yacc.c */
3577 #line 1293 "program_parse.y"
3579 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
3585 /* Line 1455 of yacc.c */
3586 #line 1299 "program_parse.y"
3588 if ((yyvsp
[(1) - (1)].integer
) > 3) {
3589 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
3593 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3599 /* Line 1455 of yacc.c */
3600 #line 1310 "program_parse.y"
3602 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
3603 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3609 /* Line 1455 of yacc.c */
3610 #line 1315 "program_parse.y"
3612 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
3613 (yyval
.state
)[1] = 0;
3619 /* Line 1455 of yacc.c */
3620 #line 1320 "program_parse.y"
3622 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
3623 (yyval
.state
)[1] = 0;
3629 /* Line 1455 of yacc.c */
3630 #line 1325 "program_parse.y"
3632 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
3633 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3639 /* Line 1455 of yacc.c */
3640 #line 1330 "program_parse.y"
3648 /* Line 1455 of yacc.c */
3649 #line 1334 "program_parse.y"
3651 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
3652 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
3658 /* Line 1455 of yacc.c */
3659 #line 1341 "program_parse.y"
3661 (yyval
.integer
) = 0;
3667 /* Line 1455 of yacc.c */
3668 #line 1345 "program_parse.y"
3670 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3676 /* Line 1455 of yacc.c */
3677 #line 1350 "program_parse.y"
3679 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
3682 if ((yyvsp
[(1) - (1)].integer
) != 0) {
3683 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
3687 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3693 /* Line 1455 of yacc.c */
3694 #line 1363 "program_parse.y"
3696 /* Since GL_ARB_matrix_palette isn't supported, just let any value
3697 * through here. The error will be generated later.
3699 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3705 /* Line 1455 of yacc.c */
3706 #line 1371 "program_parse.y"
3708 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
3709 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
3713 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3719 /* Line 1455 of yacc.c */
3720 #line 1388 "program_parse.y"
3722 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3723 (yyval
.state
)[0] = state
->state_param_enum
;
3724 (yyval
.state
)[1] = STATE_ENV
;
3725 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
3726 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
3732 /* Line 1455 of yacc.c */
3733 #line 1398 "program_parse.y"
3735 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
3736 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
3742 /* Line 1455 of yacc.c */
3743 #line 1403 "program_parse.y"
3745 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
3746 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
3752 /* Line 1455 of yacc.c */
3753 #line 1410 "program_parse.y"
3755 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3756 (yyval
.state
)[0] = state
->state_param_enum
;
3757 (yyval
.state
)[1] = STATE_ENV
;
3758 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3759 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3765 /* Line 1455 of yacc.c */
3766 #line 1420 "program_parse.y"
3768 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3769 (yyval
.state
)[0] = state
->state_param_enum
;
3770 (yyval
.state
)[1] = STATE_LOCAL
;
3771 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
3772 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
3778 /* Line 1455 of yacc.c */
3779 #line 1429 "program_parse.y"
3781 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
3782 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
3788 /* Line 1455 of yacc.c */
3789 #line 1434 "program_parse.y"
3791 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
3792 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
3798 /* Line 1455 of yacc.c */
3799 #line 1441 "program_parse.y"
3801 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3802 (yyval
.state
)[0] = state
->state_param_enum
;
3803 (yyval
.state
)[1] = STATE_LOCAL
;
3804 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3805 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3811 /* Line 1455 of yacc.c */
3812 #line 1451 "program_parse.y"
3814 if ((yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
3815 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
3818 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3824 /* Line 1455 of yacc.c */
3825 #line 1461 "program_parse.y"
3827 if ((yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
3828 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
3831 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3837 /* Line 1455 of yacc.c */
3838 #line 1476 "program_parse.y"
3840 (yyval
.vector
).count
= 1;
3841 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
3847 /* Line 1455 of yacc.c */
3848 #line 1483 "program_parse.y"
3850 (yyval
.vector
).count
= 1;
3851 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
3857 /* Line 1455 of yacc.c */
3858 #line 1488 "program_parse.y"
3860 (yyval
.vector
).count
= 1;
3861 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
3867 /* Line 1455 of yacc.c */
3868 #line 1495 "program_parse.y"
3870 (yyval
.vector
).count
= 1;
3871 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
3877 /* Line 1455 of yacc.c */
3878 #line 1500 "program_parse.y"
3880 (yyval
.vector
).count
= 2;
3881 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
3882 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
3888 /* Line 1455 of yacc.c */
3889 #line 1507 "program_parse.y"
3891 (yyval
.vector
).count
= 3;
3892 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
3893 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
3894 (yyval
.vector
).data
[1] = (yyvsp
[(6) - (7)].real
);
3900 /* Line 1455 of yacc.c */
3901 #line 1515 "program_parse.y"
3903 (yyval
.vector
).count
= 4;
3904 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
3905 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
3906 (yyval
.vector
).data
[1] = (yyvsp
[(6) - (9)].real
);
3907 (yyval
.vector
).data
[1] = (yyvsp
[(8) - (9)].real
);
3913 /* Line 1455 of yacc.c */
3914 #line 1525 "program_parse.y"
3916 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
3922 /* Line 1455 of yacc.c */
3923 #line 1529 "program_parse.y"
3925 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
3931 /* Line 1455 of yacc.c */
3932 #line 1534 "program_parse.y"
3933 { (yyval
.negate
) = FALSE
; ;}
3938 /* Line 1455 of yacc.c */
3939 #line 1535 "program_parse.y"
3940 { (yyval
.negate
) = TRUE
; ;}
3945 /* Line 1455 of yacc.c */
3946 #line 1536 "program_parse.y"
3947 { (yyval
.negate
) = FALSE
; ;}
3952 /* Line 1455 of yacc.c */
3953 #line 1539 "program_parse.y"
3954 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
3959 /* Line 1455 of yacc.c */
3960 #line 1542 "program_parse.y"
3961 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
3966 /* Line 1455 of yacc.c */
3967 #line 1546 "program_parse.y"
3969 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
3977 /* Line 1455 of yacc.c */
3978 #line 1552 "program_parse.y"
3980 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
3988 /* Line 1455 of yacc.c */
3989 #line 1560 "program_parse.y"
3991 struct asm_symbol
*const s
=
3992 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_output
, & (yylsp
[(2) - (4)]));
3997 s
->output_binding
= (yyvsp
[(4) - (4)].result
);
4004 /* Line 1455 of yacc.c */
4005 #line 1573 "program_parse.y"
4007 if (state
->mode
== ARB_vertex
) {
4008 (yyval
.result
) = VERT_RESULT_HPOS
;
4010 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4018 /* Line 1455 of yacc.c */
4019 #line 1582 "program_parse.y"
4021 if (state
->mode
== ARB_vertex
) {
4022 (yyval
.result
) = VERT_RESULT_FOGC
;
4024 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4032 /* Line 1455 of yacc.c */
4033 #line 1591 "program_parse.y"
4035 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4041 /* Line 1455 of yacc.c */
4042 #line 1595 "program_parse.y"
4044 if (state
->mode
== ARB_vertex
) {
4045 (yyval
.result
) = VERT_RESULT_PSIZ
;
4047 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4055 /* Line 1455 of yacc.c */
4056 #line 1604 "program_parse.y"
4058 if (state
->mode
== ARB_vertex
) {
4059 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4061 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4069 /* Line 1455 of yacc.c */
4070 #line 1613 "program_parse.y"
4072 if (state
->mode
== ARB_fragment
) {
4073 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4075 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4083 /* Line 1455 of yacc.c */
4084 #line 1624 "program_parse.y"
4086 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4092 /* Line 1455 of yacc.c */
4093 #line 1630 "program_parse.y"
4095 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4097 : FRAG_RESULT_COLOR
;
4103 /* Line 1455 of yacc.c */
4104 #line 1636 "program_parse.y"
4106 if (state
->mode
== ARB_vertex
) {
4107 (yyval
.integer
) = VERT_RESULT_COL0
;
4109 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4117 /* Line 1455 of yacc.c */
4118 #line 1645 "program_parse.y"
4120 if (state
->mode
== ARB_vertex
) {
4121 (yyval
.integer
) = VERT_RESULT_BFC0
;
4123 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4131 /* Line 1455 of yacc.c */
4132 #line 1656 "program_parse.y"
4134 (yyval
.integer
) = 0;
4140 /* Line 1455 of yacc.c */
4141 #line 1660 "program_parse.y"
4143 if (state
->mode
== ARB_vertex
) {
4144 (yyval
.integer
) = 0;
4146 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4154 /* Line 1455 of yacc.c */
4155 #line 1669 "program_parse.y"
4157 if (state
->mode
== ARB_vertex
) {
4158 (yyval
.integer
) = 1;
4160 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4168 /* Line 1455 of yacc.c */
4169 #line 1679 "program_parse.y"
4170 { (yyval
.integer
) = 0; ;}
4175 /* Line 1455 of yacc.c */
4176 #line 1680 "program_parse.y"
4177 { (yyval
.integer
) = 0; ;}
4182 /* Line 1455 of yacc.c */
4183 #line 1681 "program_parse.y"
4184 { (yyval
.integer
) = 1; ;}
4189 /* Line 1455 of yacc.c */
4190 #line 1684 "program_parse.y"
4191 { (yyval
.integer
) = 0; ;}
4196 /* Line 1455 of yacc.c */
4197 #line 1685 "program_parse.y"
4198 { (yyval
.integer
) = 0; ;}
4203 /* Line 1455 of yacc.c */
4204 #line 1686 "program_parse.y"
4205 { (yyval
.integer
) = 1; ;}
4210 /* Line 1455 of yacc.c */
4211 #line 1689 "program_parse.y"
4212 { (yyval
.integer
) = 0; ;}
4217 /* Line 1455 of yacc.c */
4218 #line 1690 "program_parse.y"
4219 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4224 /* Line 1455 of yacc.c */
4225 #line 1693 "program_parse.y"
4226 { (yyval
.integer
) = 0; ;}
4231 /* Line 1455 of yacc.c */
4232 #line 1694 "program_parse.y"
4233 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4238 /* Line 1455 of yacc.c */
4239 #line 1697 "program_parse.y"
4240 { (yyval
.integer
) = 0; ;}
4245 /* Line 1455 of yacc.c */
4246 #line 1698 "program_parse.y"
4247 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4252 /* Line 1455 of yacc.c */
4253 #line 1702 "program_parse.y"
4255 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4256 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4260 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4266 /* Line 1455 of yacc.c */
4267 #line 1713 "program_parse.y"
4269 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4270 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4274 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4280 /* Line 1455 of yacc.c */
4281 #line 1724 "program_parse.y"
4283 if ((yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4284 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4288 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4294 /* Line 1455 of yacc.c */
4295 #line 1735 "program_parse.y"
4297 struct asm_symbol
*exist
= (struct asm_symbol
*)
4298 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4299 struct asm_symbol
*target
= (struct asm_symbol
*)
4300 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4303 if (exist
!= NULL
) {
4304 yyerror(& (yylsp
[(2) - (4)]), state
, "redeclared identifier");
4306 } else if (target
== NULL
) {
4307 yyerror(& (yylsp
[(4) - (4)]), state
,
4308 "undefined variable binding in ALIAS statement");
4311 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4318 /* Line 1455 of yacc.c */
4319 #line 4320 "program_parse.tab.c"
4322 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4326 YY_STACK_PRINT (yyss
, yyssp
);
4331 /* Now `shift' the result of the reduction. Determine what state
4332 that goes to, based on the state we popped back to and the rule
4333 number reduced by. */
4337 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4338 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4339 yystate
= yytable
[yystate
];
4341 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4346 /*------------------------------------.
4347 | yyerrlab -- here on detecting error |
4348 `------------------------------------*/
4350 /* If not already recovering from an error, report this error. */
4354 #if ! YYERROR_VERBOSE
4355 yyerror (&yylloc
, state
, YY_("syntax error"));
4358 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4359 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4361 YYSIZE_T yyalloc
= 2 * yysize
;
4362 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4363 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4364 if (yymsg
!= yymsgbuf
)
4365 YYSTACK_FREE (yymsg
);
4366 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4368 yymsg_alloc
= yyalloc
;
4372 yymsg_alloc
= sizeof yymsgbuf
;
4376 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4378 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4379 yyerror (&yylloc
, state
, yymsg
);
4383 yyerror (&yylloc
, state
, YY_("syntax error"));
4385 goto yyexhaustedlab
;
4391 yyerror_range
[0] = yylloc
;
4393 if (yyerrstatus
== 3)
4395 /* If just tried and failed to reuse lookahead token after an
4396 error, discard it. */
4398 if (yychar
<= YYEOF
)
4400 /* Return failure if at end of input. */
4401 if (yychar
== YYEOF
)
4406 yydestruct ("Error: discarding",
4407 yytoken
, &yylval
, &yylloc
, state
);
4412 /* Else will try to reuse lookahead token after shifting the error
4417 /*---------------------------------------------------.
4418 | yyerrorlab -- error raised explicitly by YYERROR. |
4419 `---------------------------------------------------*/
4422 /* Pacify compilers like GCC when the user code never invokes
4423 YYERROR and the label yyerrorlab therefore never appears in user
4425 if (/*CONSTCOND*/ 0)
4428 yyerror_range
[0] = yylsp
[1-yylen
];
4429 /* Do not reclaim the symbols of the rule which action triggered
4433 YY_STACK_PRINT (yyss
, yyssp
);
4438 /*-------------------------------------------------------------.
4439 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4440 `-------------------------------------------------------------*/
4442 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4446 yyn
= yypact
[yystate
];
4447 if (yyn
!= YYPACT_NINF
)
4450 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4458 /* Pop the current state because it cannot handle the error token. */
4462 yyerror_range
[0] = *yylsp
;
4463 yydestruct ("Error: popping",
4464 yystos
[yystate
], yyvsp
, yylsp
, state
);
4467 YY_STACK_PRINT (yyss
, yyssp
);
4472 yyerror_range
[1] = yylloc
;
4473 /* Using YYLLOC is tempting, but would change the location of
4474 the lookahead. YYLOC is available though. */
4475 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
4478 /* Shift the error token. */
4479 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4485 /*-------------------------------------.
4486 | yyacceptlab -- YYACCEPT comes here. |
4487 `-------------------------------------*/
4492 /*-----------------------------------.
4493 | yyabortlab -- YYABORT comes here. |
4494 `-----------------------------------*/
4499 #if !defined(yyoverflow) || YYERROR_VERBOSE
4500 /*-------------------------------------------------.
4501 | yyexhaustedlab -- memory exhaustion comes here. |
4502 `-------------------------------------------------*/
4504 yyerror (&yylloc
, state
, YY_("memory exhausted"));
4510 if (yychar
!= YYEMPTY
)
4511 yydestruct ("Cleanup: discarding lookahead",
4512 yytoken
, &yylval
, &yylloc
, state
);
4513 /* Do not reclaim the symbols of the rule which action triggered
4514 this YYABORT or YYACCEPT. */
4516 YY_STACK_PRINT (yyss
, yyssp
);
4517 while (yyssp
!= yyss
)
4519 yydestruct ("Cleanup: popping",
4520 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
4525 YYSTACK_FREE (yyss
);
4528 if (yymsg
!= yymsgbuf
)
4529 YYSTACK_FREE (yymsg
);
4531 /* Make sure YYID is used. */
4532 return YYID (yyresult
);
4537 /* Line 1675 of yacc.c */
4538 #line 1755 "program_parse.y"
4541 struct asm_instruction
*
4542 asm_instruction_ctor(gl_inst_opcode op
,
4543 const struct prog_dst_register
*dst
,
4544 const struct asm_src_register
*src0
,
4545 const struct asm_src_register
*src1
,
4546 const struct asm_src_register
*src2
)
4548 struct asm_instruction
*inst
= calloc(1, sizeof(struct asm_instruction
));
4551 _mesa_init_instructions(inst
, 1);
4552 inst
->Base
.Opcode
= op
;
4553 inst
->Base
.DstReg
= *dst
;
4555 inst
->Base
.SrcReg
[0] = src0
->Base
;
4556 inst
->SrcReg
[0] = *src0
;
4559 inst
->Base
.SrcReg
[1] = src1
->Base
;
4560 inst
->SrcReg
[1] = *src1
;
4562 init_src_reg(& inst
->SrcReg
[1]);
4566 inst
->Base
.SrcReg
[2] = src2
->Base
;
4567 inst
->SrcReg
[2] = *src2
;
4569 init_src_reg(& inst
->SrcReg
[2]);
4578 init_dst_reg(struct prog_dst_register
*r
)
4580 memset(r
, 0, sizeof(*r
));
4581 r
->File
= PROGRAM_UNDEFINED
;
4582 r
->WriteMask
= WRITEMASK_XYZW
;
4583 r
->CondMask
= COND_TR
;
4584 r
->CondSwizzle
= SWIZZLE_NOOP
;
4589 init_src_reg(struct asm_src_register
*r
)
4591 memset(r
, 0, sizeof(*r
));
4592 r
->Base
.File
= PROGRAM_UNDEFINED
;
4593 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
4599 * Validate the set of inputs used by a program
4601 * Validates that legal sets of inputs are used by the program. In this case
4602 * "used" included both reading the input or binding the input to a name using
4603 * the \c ATTRIB command.
4606 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
4609 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
4611 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
4613 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
4614 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
4623 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
4624 struct YYLTYPE
*locp
)
4626 struct asm_symbol
*s
= NULL
;
4627 struct asm_symbol
*exist
= (struct asm_symbol
*)
4628 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
4631 if (exist
!= NULL
) {
4632 yyerror(locp
, state
, "redeclared identifier");
4634 s
= calloc(1, sizeof(struct asm_symbol
));
4640 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
4641 yyerror(locp
, state
, "too many temporaries declared");
4646 s
->temp_binding
= state
->prog
->NumTemporaries
;
4647 state
->prog
->NumTemporaries
++;
4651 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
4652 yyerror(locp
, state
, "too many address registers declared");
4657 /* FINISHME: Add support for multiple address registers.
4659 state
->prog
->NumAddressRegs
++;
4666 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
4673 int add_state_reference(struct gl_program_parameter_list
*param_list
,
4674 const gl_state_index tokens
[STATE_LENGTH
])
4676 const GLuint size
= 4; /* XXX fix */
4680 name
= _mesa_program_state_string(tokens
);
4681 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
4683 NULL
, (gl_state_index
*) tokens
, 0x0);
4684 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
4686 /* free name string here since we duplicated it in add_parameter() */
4694 initialize_symbol_from_state(struct gl_program
*prog
,
4695 struct asm_symbol
*param_var
,
4696 const gl_state_index tokens
[STATE_LENGTH
])
4699 gl_state_index state_tokens
[STATE_LENGTH
];
4702 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
4704 param_var
->type
= at_param
;
4706 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
4707 * unroll it and call add_state_reference() for each row
4709 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
4710 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
4711 state_tokens
[0] == STATE_MVP_MATRIX
||
4712 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
4713 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
4714 && (state_tokens
[2] != state_tokens
[3])) {
4716 const int first_row
= state_tokens
[2];
4717 const int last_row
= state_tokens
[3];
4719 for (row
= first_row
; row
<= last_row
; row
++) {
4720 state_tokens
[2] = state_tokens
[3] = row
;
4722 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4723 if (param_var
->param_binding_begin
== ~0U)
4724 param_var
->param_binding_begin
= idx
;
4725 param_var
->param_binding_length
++;
4729 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4730 if (param_var
->param_binding_begin
== ~0U)
4731 param_var
->param_binding_begin
= idx
;
4732 param_var
->param_binding_length
++;
4740 initialize_symbol_from_param(struct gl_program
*prog
,
4741 struct asm_symbol
*param_var
,
4742 const gl_state_index tokens
[STATE_LENGTH
])
4745 gl_state_index state_tokens
[STATE_LENGTH
];
4748 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
4750 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
4751 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
4752 assert((state_tokens
[1] == STATE_ENV
)
4753 || (state_tokens
[1] == STATE_LOCAL
));
4755 param_var
->type
= at_param
;
4757 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
4758 * we need to unroll it and call add_state_reference() for each row
4760 if (state_tokens
[2] != state_tokens
[3]) {
4762 const int first_row
= state_tokens
[2];
4763 const int last_row
= state_tokens
[3];
4765 for (row
= first_row
; row
<= last_row
; row
++) {
4766 state_tokens
[2] = state_tokens
[3] = row
;
4768 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4769 if (param_var
->param_binding_begin
== ~0U)
4770 param_var
->param_binding_begin
= idx
;
4771 param_var
->param_binding_length
++;
4775 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4776 if (param_var
->param_binding_begin
== ~0U)
4777 param_var
->param_binding_begin
= idx
;
4778 param_var
->param_binding_length
++;
4786 initialize_symbol_from_const(struct gl_program
*prog
,
4787 struct asm_symbol
*param_var
,
4788 const struct asm_vector
*vec
)
4790 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
4791 NULL
, vec
->count
, GL_NONE
, vec
->data
,
4794 param_var
->type
= at_param
;
4796 if (param_var
->param_binding_begin
== ~0U)
4797 param_var
->param_binding_begin
= idx
;
4798 param_var
->param_binding_length
++;
4805 make_error_string(const char *fmt
, ...)
4811 va_start(args
, fmt
);
4813 /* Call vsnprintf once to determine how large the final string is. Call it
4814 * again to do the actual formatting. from the vsnprintf manual page:
4816 * Upon successful return, these functions return the number of
4817 * characters printed (not including the trailing '\0' used to end
4818 * output to strings).
4820 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
4822 str
= _mesa_malloc(length
);
4824 vsnprintf(str
, length
, fmt
, args
);
4834 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
4839 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
4841 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
4842 _mesa_free(err_str
);
4845 err_str
= make_error_string("line %u, char %u: error: %s\n",
4846 locp
->first_line
, locp
->first_column
, s
);
4847 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
4850 _mesa_free(err_str
);
4856 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
4857 GLsizei len
, struct asm_parser_state
*state
)
4859 struct gl_program_constants limits
;
4860 struct asm_instruction
*inst
;
4865 state
->prog
->Target
= target
;
4866 state
->prog
->Parameters
= _mesa_new_parameter_list();
4868 /* Make a copy of the program string and force it to be NUL-terminated.
4870 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
4872 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4875 _mesa_memcpy (strz
, str
, len
);
4878 state
->prog
->String
= strz
;
4880 state
->st
= _mesa_symbol_table_ctor();
4882 /* All of these limits should come from ctx.
4884 limits
.MaxInstructions
= 128;
4885 limits
.MaxAluInstructions
= 128;
4886 limits
.MaxTexInstructions
= 128;
4887 limits
.MaxTexIndirections
= 128;
4888 limits
.MaxAttribs
= 16;
4889 limits
.MaxTemps
= 128;
4890 limits
.MaxAddressRegs
= 1;
4891 limits
.MaxParameters
= 128;
4892 limits
.MaxLocalParams
= 256;
4893 limits
.MaxEnvParams
= 128;
4894 limits
.MaxNativeInstructions
= 128;
4895 limits
.MaxNativeAluInstructions
= 128;
4896 limits
.MaxNativeTexInstructions
= 128;
4897 limits
.MaxNativeTexIndirections
= 128;
4898 limits
.MaxNativeAttribs
= 16;
4899 limits
.MaxNativeTemps
= 128;
4900 limits
.MaxNativeAddressRegs
= 1;
4901 limits
.MaxNativeParameters
= 128;
4902 limits
.MaxUniformComponents
= 0;
4904 state
->limits
= & limits
;
4906 state
->MaxTextureImageUnits
= 16;
4907 state
->MaxTextureCoordUnits
= 8;
4908 state
->MaxTextureUnits
= 8;
4909 state
->MaxClipPlanes
= 6;
4910 state
->MaxLights
= 8;
4911 state
->MaxProgramMatrices
= 8;
4913 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
4914 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
4916 _mesa_set_program_error(ctx
, -1, NULL
);
4918 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
4920 _mesa_program_lexer_dtor(state
->scanner
);
4923 if (ctx
->Program
.ErrorPos
!= -1) {
4927 if (! _mesa_layout_parameters(state
)) {
4931 loc
.first_column
= 0;
4934 yyerror(& loc
, state
, "invalid PARAM usage");
4940 /* Add one instruction to store the "END" instruction.
4942 state
->prog
->Instructions
=
4943 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
4944 inst
= state
->inst_head
;
4945 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
4946 struct asm_instruction
*const temp
= inst
->next
;
4948 state
->prog
->Instructions
[i
] = inst
->Base
;
4954 /* Finally, tag on an OPCODE_END instruction */
4956 const GLuint numInst
= state
->prog
->NumInstructions
;
4957 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
4958 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
4960 state
->prog
->NumInstructions
++;
4962 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
4965 * Initialize native counts to logical counts. The device driver may
4966 * change them if program is translated into a hardware program.
4968 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
4969 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
4970 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
4971 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
4972 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;