2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 1
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 1 "program_parse.y"
74 * Copyright © 2009 Intel Corporation
76 * Permission is hereby granted, free of charge, to any person obtaining a
77 * copy of this software and associated documentation files (the "Software"),
78 * to deal in the Software without restriction, including without limitation
79 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
80 * and/or sell copies of the Software, and to permit persons to whom the
81 * Software is furnished to do so, subject to the following conditions:
83 * The above copyright notice and this permission notice (including the next
84 * paragraph) shall be included in all copies or substantial portions of the
87 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
90 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93 * DEALINGS IN THE SOFTWARE.
99 #include "main/mtypes.h"
100 #include "main/imports.h"
102 #include "prog_parameter.h"
103 #include "prog_parameter_layout.h"
104 #include "prog_statevars.h"
105 #include "prog_instruction.h"
107 #include "symbol_table.h"
108 #include "program_parser.h"
110 extern void *yy_scan_string(char *);
111 extern void yy_delete_buffer(void *);
113 static struct asm_symbol
*declare_variable(struct asm_parser_state
*state
,
114 char *name
, enum asm_type t
, struct YYLTYPE
*locp
);
116 static int add_state_reference(struct gl_program_parameter_list
*param_list
,
117 const gl_state_index tokens
[STATE_LENGTH
]);
119 static int initialize_symbol_from_state(struct gl_program
*prog
,
120 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
122 static int initialize_symbol_from_param(struct gl_program
*prog
,
123 struct asm_symbol
*param_var
, const gl_state_index tokens
[STATE_LENGTH
]);
125 static int initialize_symbol_from_const(struct gl_program
*prog
,
126 struct asm_symbol
*param_var
, const struct asm_vector
*vec
);
128 static int yyparse(struct asm_parser_state
*state
);
130 static char *make_error_string(const char *fmt
, ...);
132 static void yyerror(struct YYLTYPE
*locp
, struct asm_parser_state
*state
,
135 static int validate_inputs(struct YYLTYPE
*locp
,
136 struct asm_parser_state
*state
);
138 static void init_dst_reg(struct prog_dst_register
*r
);
140 static void init_src_reg(struct asm_src_register
*r
);
142 static struct asm_instruction
*asm_instruction_ctor(gl_inst_opcode op
,
143 const struct prog_dst_register
*dst
, const struct asm_src_register
*src0
,
144 const struct asm_src_register
*src1
, const struct asm_src_register
*src2
);
148 #define TRUE (!FALSE)
151 #define YYLLOC_DEFAULT(Current, Rhs, N) \
154 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
155 (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
156 (Current).position = YYRHSLOC(Rhs, 1).position; \
157 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
158 (Current).last_column = YYRHSLOC(Rhs, N).last_column; \
160 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
161 (Current).last_line = (Current).first_line; \
162 (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \
163 (Current).last_column = (Current).first_column; \
164 (Current).position = YYRHSLOC(Rhs, 0).position \
165 + (Current).first_column; \
169 #define YYLEX_PARAM state->scanner
172 /* Line 189 of yacc.c */
173 #line 174 "program_parse.tab.c"
175 /* Enabling traces. */
180 /* Enabling verbose error messages. */
181 #ifdef YYERROR_VERBOSE
182 # undef YYERROR_VERBOSE
183 # define YYERROR_VERBOSE 1
185 # define YYERROR_VERBOSE 1
188 /* Enabling the token table. */
189 #ifndef YYTOKEN_TABLE
190 # define YYTOKEN_TABLE 0
197 /* Put the tokens into the symbol table, so that GDB and other debuggers
287 TEX_SHADOWRECT
= 345,
290 TEX_ARRAYSHADOW1D
= 348,
291 TEX_ARRAYSHADOW2D
= 349,
308 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
309 typedef union YYSTYPE
312 /* Line 214 of yacc.c */
313 #line 107 "program_parse.y"
315 struct asm_instruction
*inst
;
316 struct asm_symbol
*sym
;
317 struct asm_symbol temp_sym
;
318 struct asm_swizzle_mask swiz_mask
;
319 struct asm_src_register src_reg
;
320 struct prog_dst_register dst_reg
;
321 struct prog_instruction temp_inst
;
329 struct asm_vector vector
;
330 gl_inst_opcode opcode
;
334 unsigned rgba_valid
:1;
335 unsigned xyzw_valid
:1;
341 /* Line 214 of yacc.c */
342 #line 343 "program_parse.tab.c"
344 # define YYSTYPE_IS_TRIVIAL 1
345 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
346 # define YYSTYPE_IS_DECLARED 1
349 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
350 typedef struct YYLTYPE
357 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
358 # define YYLTYPE_IS_DECLARED 1
359 # define YYLTYPE_IS_TRIVIAL 1
363 /* Copy the second part of user declarations. */
365 /* Line 264 of yacc.c */
366 #line 249 "program_parse.y"
368 extern int yylex(YYSTYPE
*yylval_param
, YYLTYPE
*yylloc_param
,
372 /* Line 264 of yacc.c */
373 #line 374 "program_parse.tab.c"
380 typedef YYTYPE_UINT8 yytype_uint8
;
382 typedef unsigned char yytype_uint8
;
386 typedef YYTYPE_INT8 yytype_int8
;
387 #elif (defined __STDC__ || defined __C99__FUNC__ \
388 || defined __cplusplus || defined _MSC_VER)
389 typedef signed char yytype_int8
;
391 typedef short int yytype_int8
;
395 typedef YYTYPE_UINT16 yytype_uint16
;
397 typedef unsigned short int yytype_uint16
;
401 typedef YYTYPE_INT16 yytype_int16
;
403 typedef short int yytype_int16
;
407 # ifdef __SIZE_TYPE__
408 # define YYSIZE_T __SIZE_TYPE__
409 # elif defined size_t
410 # define YYSIZE_T size_t
411 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
412 || defined __cplusplus || defined _MSC_VER)
413 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
414 # define YYSIZE_T size_t
416 # define YYSIZE_T unsigned int
420 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
425 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
426 # define YY_(msgid) dgettext ("bison-runtime", msgid)
430 # define YY_(msgid) msgid
434 /* Suppress unused-variable warnings by "using" E. */
435 #if ! defined lint || defined __GNUC__
436 # define YYUSE(e) ((void) (e))
438 # define YYUSE(e) /* empty */
441 /* Identity function, used to suppress warnings about constant conditions. */
445 #if (defined __STDC__ || defined __C99__FUNC__ \
446 || defined __cplusplus || defined _MSC_VER)
459 #if ! defined yyoverflow || YYERROR_VERBOSE
461 /* The parser invokes alloca or malloc; define the necessary symbols. */
463 # ifdef YYSTACK_USE_ALLOCA
464 # if YYSTACK_USE_ALLOCA
466 # define YYSTACK_ALLOC __builtin_alloca
467 # elif defined __BUILTIN_VA_ARG_INCR
468 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
470 # define YYSTACK_ALLOC __alloca
471 # elif defined _MSC_VER
472 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
473 # define alloca _alloca
475 # define YYSTACK_ALLOC alloca
476 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
477 || defined __cplusplus || defined _MSC_VER)
478 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
487 # ifdef YYSTACK_ALLOC
488 /* Pacify GCC's `empty if-body' warning. */
489 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
490 # ifndef YYSTACK_ALLOC_MAXIMUM
491 /* The OS might guarantee only one guard page at the bottom of the stack,
492 and a page size can be as small as 4096 bytes. So we cannot safely
493 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
494 to allow for a few compiler-allocated temporary stack slots. */
495 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
498 # define YYSTACK_ALLOC YYMALLOC
499 # define YYSTACK_FREE YYFREE
500 # ifndef YYSTACK_ALLOC_MAXIMUM
501 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
503 # if (defined __cplusplus && ! defined _STDLIB_H \
504 && ! ((defined YYMALLOC || defined malloc) \
505 && (defined YYFREE || defined free)))
506 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
512 # define YYMALLOC malloc
513 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
514 || defined __cplusplus || defined _MSC_VER)
515 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
520 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
521 || defined __cplusplus || defined _MSC_VER)
522 void free (void *); /* INFRINGES ON USER NAME SPACE */
526 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
529 #if (! defined yyoverflow \
530 && (! defined __cplusplus \
531 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
532 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
534 /* A type that is properly aligned for any stack member. */
537 yytype_int16 yyss_alloc
;
542 /* The size of the maximum gap between one aligned stack and the next. */
543 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
545 /* The size of an array large to enough to hold all stacks, each with
547 # define YYSTACK_BYTES(N) \
548 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
549 + 2 * YYSTACK_GAP_MAXIMUM)
551 /* Copy COUNT objects from FROM to TO. The source and destination do
554 # if defined __GNUC__ && 1 < __GNUC__
555 # define YYCOPY(To, From, Count) \
556 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
558 # define YYCOPY(To, From, Count) \
562 for (yyi = 0; yyi < (Count); yyi++) \
563 (To)[yyi] = (From)[yyi]; \
569 /* Relocate STACK from its old location to the new one. The
570 local variables YYSIZE and YYSTACKSIZE give the old and new number of
571 elements in the stack, and YYPTR gives the new location of the
572 stack. Advance YYPTR to a properly aligned location for the next
574 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
577 YYSIZE_T yynewbytes; \
578 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
579 Stack = &yyptr->Stack_alloc; \
580 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
581 yyptr += yynewbytes / sizeof (*yyptr); \
587 /* YYFINAL -- State number of the termination state. */
589 /* YYLAST -- Last index in YYTABLE. */
592 /* YYNTOKENS -- Number of terminals. */
593 #define YYNTOKENS 115
594 /* YYNNTS -- Number of nonterminals. */
596 /* YYNRULES -- Number of rules. */
598 /* YYNRULES -- Number of states. */
599 #define YYNSTATES 436
601 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
603 #define YYMAXUTOK 360
605 #define YYTRANSLATE(YYX) \
606 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
608 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
609 static const yytype_uint8 yytranslate
[] =
611 0, 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, 110, 107, 111, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 106,
617 2, 112, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 108, 2, 109, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 113, 2, 114, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
637 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
638 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
639 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
640 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
641 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
642 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
643 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
644 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
645 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
646 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
651 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
653 static const yytype_uint16 yyprhs
[] =
655 0, 0, 3, 8, 10, 12, 15, 16, 20, 23,
656 24, 27, 30, 32, 34, 36, 38, 40, 42, 44,
657 46, 48, 50, 52, 57, 62, 67, 74, 81, 90,
658 99, 102, 105, 107, 109, 111, 113, 115, 117, 119,
659 121, 123, 125, 127, 129, 136, 140, 144, 147, 150,
660 158, 161, 163, 165, 167, 169, 174, 176, 178, 180,
661 182, 184, 186, 188, 192, 193, 196, 199, 201, 203,
662 205, 207, 209, 211, 213, 215, 217, 218, 220, 222,
663 224, 226, 227, 229, 231, 233, 235, 237, 239, 244,
664 247, 250, 252, 255, 257, 260, 262, 265, 270, 275,
665 277, 278, 282, 284, 286, 289, 291, 294, 296, 298,
666 302, 309, 310, 312, 315, 320, 322, 326, 328, 330,
667 332, 334, 336, 338, 340, 342, 344, 346, 349, 352,
668 355, 358, 361, 364, 367, 370, 373, 376, 379, 382,
669 386, 388, 390, 392, 398, 400, 402, 404, 407, 409,
670 411, 414, 416, 419, 426, 428, 432, 434, 436, 438,
671 440, 442, 447, 449, 451, 453, 455, 457, 459, 462,
672 464, 466, 472, 474, 477, 479, 481, 487, 490, 491,
673 498, 502, 503, 505, 507, 509, 511, 513, 516, 518,
674 520, 523, 528, 533, 534, 538, 540, 542, 544, 547,
675 549, 551, 553, 555, 561, 563, 567, 573, 579, 581,
676 585, 591, 593, 595, 597, 599, 601, 603, 605, 607,
677 609, 613, 619, 627, 637, 640, 643, 645, 647, 648,
678 649, 653, 654, 658, 662, 664, 669, 672, 675, 678,
679 681, 685, 688, 692, 693, 695, 697, 698, 700, 702,
680 703, 705, 707, 708, 710, 712, 713, 717, 718, 722,
681 723, 727, 729, 731, 733
684 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
685 static const yytype_int16 yyrhs
[] =
687 116, 0, -1, 117, 118, 120, 12, -1, 3, -1,
688 4, -1, 118, 119, -1, -1, 8, 98, 106, -1,
689 120, 121, -1, -1, 122, 106, -1, 158, 106, -1,
690 123, -1, 124, -1, 125, -1, 126, -1, 127, -1,
691 128, -1, 129, -1, 130, -1, 135, -1, 131, -1,
692 132, -1, 19, 139, 107, 136, -1, 18, 138, 107,
693 137, -1, 16, 138, 107, 136, -1, 14, 138, 107,
694 136, 107, 136, -1, 13, 138, 107, 137, 107, 137,
695 -1, 17, 138, 107, 137, 107, 137, 107, 137, -1,
696 15, 138, 107, 137, 107, 133, 107, 134, -1, 20,
697 137, -1, 82, 243, -1, 83, -1, 84, -1, 85,
698 -1, 86, -1, 87, -1, 88, -1, 89, -1, 90,
699 -1, 91, -1, 92, -1, 93, -1, 94, -1, 21,
700 138, 107, 143, 107, 140, -1, 229, 143, 155, -1,
701 229, 143, 156, -1, 144, 157, -1, 152, 154, -1,
702 141, 107, 141, 107, 141, 107, 141, -1, 229, 142,
703 -1, 22, -1, 98, -1, 98, -1, 160, -1, 145,
704 108, 146, 109, -1, 174, -1, 236, -1, 98, -1,
705 98, -1, 147, -1, 148, -1, 22, -1, 152, 153,
706 149, -1, -1, 110, 150, -1, 111, 151, -1, 22,
707 -1, 22, -1, 98, -1, 102, -1, 102, -1, 102,
708 -1, 102, -1, 99, -1, 103, -1, -1, 99, -1,
709 100, -1, 101, -1, 102, -1, -1, 159, -1, 166,
710 -1, 230, -1, 232, -1, 235, -1, 248, -1, 7,
711 98, 112, 160, -1, 95, 161, -1, 37, 165, -1,
712 59, -1, 97, 163, -1, 52, -1, 28, 241, -1,
713 36, -1, 73, 242, -1, 49, 108, 164, 109, -1,
714 96, 108, 162, 109, -1, 22, -1, -1, 108, 164,
715 109, -1, 22, -1, 59, -1, 28, 241, -1, 36,
716 -1, 73, 242, -1, 167, -1, 168, -1, 10, 98,
717 170, -1, 10, 98, 108, 169, 109, 171, -1, -1,
718 22, -1, 112, 173, -1, 112, 113, 172, 114, -1,
719 175, -1, 172, 107, 175, -1, 177, -1, 213, -1,
720 223, -1, 177, -1, 213, -1, 224, -1, 176, -1,
721 214, -1, 223, -1, 177, -1, 72, 201, -1, 72,
722 178, -1, 72, 180, -1, 72, 183, -1, 72, 185,
723 -1, 72, 191, -1, 72, 187, -1, 72, 194, -1,
724 72, 196, -1, 72, 198, -1, 72, 200, -1, 72,
725 212, -1, 46, 240, 179, -1, 189, -1, 32, -1,
726 68, -1, 42, 108, 190, 109, 181, -1, 189, -1,
727 59, -1, 25, -1, 71, 182, -1, 39, -1, 31,
728 -1, 43, 184, -1, 24, -1, 240, 66, -1, 44,
729 108, 190, 109, 240, 186, -1, 189, -1, 74, 244,
730 188, -1, 28, -1, 24, -1, 30, -1, 70, -1,
731 22, -1, 75, 242, 192, 193, -1, 34, -1, 53,
732 -1, 78, -1, 79, -1, 77, -1, 76, -1, 35,
733 195, -1, 28, -1, 55, -1, 27, 108, 197, 109,
734 56, -1, 22, -1, 57, 199, -1, 69, -1, 25,
735 -1, 203, 65, 108, 206, 109, -1, 203, 202, -1,
736 -1, 65, 108, 206, 104, 206, 109, -1, 48, 207,
737 204, -1, -1, 205, -1, 40, -1, 81, -1, 41,
738 -1, 22, -1, 50, 208, -1, 62, -1, 51, -1,
739 80, 242, -1, 54, 108, 210, 109, -1, 47, 108,
740 211, 109, -1, -1, 108, 209, 109, -1, 22, -1,
741 22, -1, 22, -1, 29, 63, -1, 217, -1, 220,
742 -1, 215, -1, 218, -1, 61, 33, 108, 216, 109,
743 -1, 221, -1, 221, 104, 221, -1, 61, 33, 108,
744 221, 109, -1, 61, 45, 108, 219, 109, -1, 222,
745 -1, 222, 104, 222, -1, 61, 45, 108, 222, 109,
746 -1, 22, -1, 22, -1, 225, -1, 227, -1, 226,
747 -1, 227, -1, 228, -1, 23, -1, 22, -1, 113,
748 228, 114, -1, 113, 228, 107, 228, 114, -1, 113,
749 228, 107, 228, 107, 228, 114, -1, 113, 228, 107,
750 228, 107, 228, 107, 228, 114, -1, 229, 23, -1,
751 229, 22, -1, 110, -1, 111, -1, -1, -1, 11,
752 231, 234, -1, -1, 5, 233, 234, -1, 234, 107,
753 98, -1, 98, -1, 9, 98, 112, 236, -1, 64,
754 59, -1, 64, 36, -1, 64, 237, -1, 64, 58,
755 -1, 64, 73, 242, -1, 64, 29, -1, 28, 238,
756 239, -1, -1, 38, -1, 26, -1, -1, 60, -1,
757 67, -1, -1, 38, -1, 26, -1, -1, 60, -1,
758 67, -1, -1, 108, 245, 109, -1, -1, 108, 246,
759 109, -1, -1, 108, 247, 109, -1, 22, -1, 22,
760 -1, 22, -1, 6, 98, 112, 98, -1
763 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
764 static const yytype_uint16 yyrline
[] =
766 0, 256, 256, 259, 267, 279, 280, 283, 305, 306,
767 309, 324, 327, 332, 339, 340, 341, 342, 343, 344,
768 345, 348, 349, 352, 358, 365, 372, 380, 387, 395,
769 440, 447, 453, 454, 455, 456, 457, 458, 459, 460,
770 461, 462, 463, 464, 467, 480, 493, 506, 528, 537,
771 570, 577, 592, 642, 684, 695, 716, 726, 732, 763,
772 780, 780, 782, 789, 801, 802, 803, 806, 818, 830,
773 848, 859, 871, 873, 874, 875, 876, 879, 879, 879,
774 879, 880, 883, 884, 885, 886, 887, 888, 891, 909,
775 913, 919, 923, 927, 931, 940, 949, 953, 958, 964,
776 975, 975, 976, 978, 982, 986, 990, 996, 996, 998,
777 1014, 1037, 1040, 1051, 1057, 1063, 1064, 1071, 1077, 1083,
778 1091, 1097, 1103, 1111, 1117, 1123, 1131, 1132, 1135, 1136,
779 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1148,
780 1157, 1161, 1165, 1171, 1180, 1184, 1188, 1197, 1201, 1207,
781 1213, 1220, 1225, 1233, 1243, 1245, 1253, 1259, 1263, 1267,
782 1273, 1284, 1293, 1297, 1302, 1306, 1310, 1314, 1320, 1327,
783 1331, 1337, 1345, 1356, 1363, 1367, 1373, 1383, 1394, 1398,
784 1416, 1425, 1428, 1434, 1438, 1442, 1448, 1459, 1464, 1469,
785 1474, 1479, 1484, 1492, 1495, 1500, 1513, 1521, 1532, 1540,
786 1540, 1542, 1542, 1544, 1554, 1559, 1566, 1576, 1585, 1590,
787 1597, 1607, 1617, 1629, 1629, 1630, 1630, 1632, 1642, 1650,
788 1660, 1668, 1676, 1685, 1696, 1700, 1706, 1707, 1708, 1711,
789 1711, 1714, 1714, 1717, 1723, 1731, 1744, 1753, 1762, 1766,
790 1775, 1784, 1795, 1802, 1807, 1816, 1828, 1831, 1840, 1851,
791 1852, 1853, 1856, 1857, 1858, 1861, 1862, 1865, 1866, 1869,
792 1870, 1873, 1884, 1895, 1906
796 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
797 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
798 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
799 static const char *const yytname
[] =
801 "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS",
802 "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP",
803 "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL",
804 "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK",
805 "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV",
806 "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE",
807 "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL",
808 "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL",
809 "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT_TOK", "POINTSIZE",
810 "POSITION", "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW",
811 "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE_TOK", "SPECULAR", "SPOT",
812 "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R",
813 "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D",
814 "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D",
815 "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D",
816 "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB",
817 "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE",
818 "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'",
819 "'}'", "$accept", "program", "language", "optionSequence", "option",
820 "statementSequence", "statement", "instruction", "ALU_instruction",
821 "TexInstruction", "ARL_instruction", "VECTORop_instruction",
822 "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction",
823 "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction",
824 "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg",
825 "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle",
826 "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray",
827 "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel",
828 "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg",
829 "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix",
830 "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding",
831 "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum",
832 "fragAttribItem", "PARAM_statement", "PARAM_singleStmt",
833 "PARAM_multipleStmt", "optArraySize", "paramSingleInit",
834 "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl",
835 "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem",
836 "stateSingleItem", "stateMaterialItem", "stateMatProperty",
837 "stateLightItem", "stateLightProperty", "stateSpotProperty",
838 "stateLightModelItem", "stateLModProperty", "stateLightProdItem",
839 "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty",
840 "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem",
841 "stateTexGenType", "stateTexGenCoord", "stateFogItem",
842 "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum",
843 "statePointItem", "statePointProperty", "stateMatrixRow",
844 "stateMatrixRows", "optMatrixRows", "stateMatrixItem",
845 "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum",
846 "stateMatrixName", "stateOptModMatNum", "stateModMatNum",
847 "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem",
848 "programSingleItem", "programMultipleItem", "progEnvParams",
849 "progEnvParamNums", "progEnvParam", "progLocalParams",
850 "progLocalParamNums", "progLocalParam", "progEnvParamNum",
851 "progLocalParamNum", "paramConstDecl", "paramConstUse",
852 "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector",
853 "signedFloatConstant", "optionalSign", "TEMP_statement", "@1",
854 "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement",
855 "resultBinding", "resultColBinding", "optResultFaceType",
856 "optResultColorType", "optFaceType", "optColorType",
857 "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum",
858 "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum",
864 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
866 static const yytype_uint16 yytoknum
[] =
868 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
869 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
870 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
871 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
872 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
873 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
874 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
875 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
876 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
877 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
878 355, 356, 357, 358, 359, 360, 59, 44, 91, 93,
883 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
884 static const yytype_uint8 yyr1
[] =
886 0, 115, 116, 117, 117, 118, 118, 119, 120, 120,
887 121, 121, 122, 122, 123, 123, 123, 123, 123, 123,
888 123, 124, 124, 125, 126, 127, 128, 129, 130, 131,
889 132, 133, 134, 134, 134, 134, 134, 134, 134, 134,
890 134, 134, 134, 134, 135, 136, 137, 138, 139, 140,
891 141, 142, 142, 143, 143, 143, 143, 144, 144, 145,
892 146, 146, 147, 148, 149, 149, 149, 150, 151, 152,
893 153, 154, 155, 156, 156, 156, 156, 157, 157, 157,
894 157, 157, 158, 158, 158, 158, 158, 158, 159, 160,
895 160, 161, 161, 161, 161, 161, 161, 161, 161, 162,
896 163, 163, 164, 165, 165, 165, 165, 166, 166, 167,
897 168, 169, 169, 170, 171, 172, 172, 173, 173, 173,
898 174, 174, 174, 175, 175, 175, 176, 176, 177, 177,
899 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
900 179, 179, 179, 180, 181, 181, 181, 181, 181, 182,
901 183, 184, 184, 185, 186, 187, 188, 189, 189, 189,
902 190, 191, 192, 192, 193, 193, 193, 193, 194, 195,
903 195, 196, 197, 198, 199, 199, 200, 201, 202, 202,
904 203, 204, 204, 205, 205, 205, 206, 207, 207, 207,
905 207, 207, 207, 208, 208, 209, 210, 211, 212, 213,
906 213, 214, 214, 215, 216, 216, 217, 218, 219, 219,
907 220, 221, 222, 223, 223, 224, 224, 225, 226, 226,
908 227, 227, 227, 227, 228, 228, 229, 229, 229, 231,
909 230, 233, 232, 234, 234, 235, 236, 236, 236, 236,
910 236, 236, 237, 238, 238, 238, 239, 239, 239, 240,
911 240, 240, 241, 241, 241, 242, 242, 243, 243, 244,
912 244, 245, 246, 247, 248
915 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
916 static const yytype_uint8 yyr2
[] =
918 0, 2, 4, 1, 1, 2, 0, 3, 2, 0,
919 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
920 1, 1, 1, 4, 4, 4, 6, 6, 8, 8,
921 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
922 1, 1, 1, 1, 6, 3, 3, 2, 2, 7,
923 2, 1, 1, 1, 1, 4, 1, 1, 1, 1,
924 1, 1, 1, 3, 0, 2, 2, 1, 1, 1,
925 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
926 1, 0, 1, 1, 1, 1, 1, 1, 4, 2,
927 2, 1, 2, 1, 2, 1, 2, 4, 4, 1,
928 0, 3, 1, 1, 2, 1, 2, 1, 1, 3,
929 6, 0, 1, 2, 4, 1, 3, 1, 1, 1,
930 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
931 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,
932 1, 1, 1, 5, 1, 1, 1, 2, 1, 1,
933 2, 1, 2, 6, 1, 3, 1, 1, 1, 1,
934 1, 4, 1, 1, 1, 1, 1, 1, 2, 1,
935 1, 5, 1, 2, 1, 1, 5, 2, 0, 6,
936 3, 0, 1, 1, 1, 1, 1, 2, 1, 1,
937 2, 4, 4, 0, 3, 1, 1, 1, 2, 1,
938 1, 1, 1, 5, 1, 3, 5, 5, 1, 3,
939 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
940 3, 5, 7, 9, 2, 2, 1, 1, 0, 0,
941 3, 0, 3, 3, 1, 4, 2, 2, 2, 2,
942 3, 2, 3, 0, 1, 1, 0, 1, 1, 0,
943 1, 1, 0, 1, 1, 0, 3, 0, 3, 0,
947 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
948 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
949 means the default is an error. */
950 static const yytype_uint16 yydefact
[] =
952 0, 3, 4, 0, 6, 1, 9, 0, 5, 0,
953 0, 231, 0, 0, 0, 0, 229, 2, 0, 0,
954 0, 0, 0, 0, 0, 228, 0, 8, 0, 12,
955 13, 14, 15, 16, 17, 18, 19, 21, 22, 20,
956 0, 82, 83, 107, 108, 84, 85, 86, 87, 7,
957 0, 0, 0, 0, 0, 0, 0, 58, 0, 81,
958 57, 0, 0, 0, 0, 0, 69, 0, 0, 226,
959 227, 30, 0, 0, 10, 11, 234, 232, 0, 0,
960 0, 111, 228, 109, 230, 243, 241, 237, 239, 236,
961 255, 238, 228, 77, 78, 79, 80, 47, 228, 228,
962 228, 228, 228, 228, 71, 48, 219, 218, 0, 0,
963 0, 0, 53, 228, 76, 0, 54, 56, 120, 121,
964 199, 200, 122, 215, 216, 0, 0, 264, 88, 235,
965 112, 0, 113, 117, 118, 119, 213, 214, 217, 0,
966 245, 244, 246, 0, 240, 0, 0, 0, 0, 25,
967 0, 24, 23, 252, 105, 103, 255, 90, 0, 0,
968 0, 0, 0, 0, 249, 0, 249, 0, 0, 259,
969 255, 128, 129, 130, 131, 133, 132, 134, 135, 136,
970 137, 0, 138, 252, 95, 0, 93, 91, 255, 0,
971 100, 89, 0, 74, 73, 75, 46, 0, 0, 233,
972 0, 225, 224, 247, 248, 242, 261, 0, 228, 228,
973 0, 0, 228, 253, 254, 104, 106, 0, 0, 0,
974 198, 169, 170, 168, 0, 151, 251, 250, 150, 0,
975 0, 0, 0, 193, 189, 0, 188, 255, 181, 175,
976 174, 173, 0, 0, 0, 0, 94, 0, 96, 0,
977 0, 92, 228, 220, 62, 0, 60, 61, 0, 228,
978 0, 110, 256, 27, 26, 72, 45, 257, 0, 0,
979 211, 0, 212, 0, 172, 0, 160, 0, 152, 0,
980 157, 158, 141, 142, 159, 139, 140, 0, 0, 187,
981 0, 190, 183, 185, 184, 180, 182, 263, 0, 156,
982 155, 162, 163, 0, 0, 102, 0, 99, 0, 0,
983 0, 55, 70, 64, 44, 0, 0, 228, 0, 31,
984 0, 228, 206, 210, 0, 0, 249, 197, 0, 195,
985 0, 196, 0, 260, 167, 166, 164, 165, 161, 186,
986 0, 97, 98, 101, 228, 221, 0, 0, 63, 228,
987 51, 52, 50, 0, 0, 0, 115, 123, 126, 124,
988 201, 202, 125, 262, 0, 32, 33, 34, 35, 36,
989 37, 38, 39, 40, 41, 42, 43, 29, 28, 171,
990 146, 148, 145, 0, 143, 144, 0, 192, 194, 191,
991 176, 0, 67, 65, 68, 66, 0, 0, 0, 127,
992 178, 228, 114, 258, 149, 147, 153, 154, 228, 222,
993 228, 0, 0, 0, 177, 116, 0, 0, 0, 204,
994 0, 208, 0, 223, 228, 203, 0, 207, 0, 0,
995 49, 205, 209, 0, 0, 179
998 /* YYDEFGOTO[NTERM-NUM]. */
999 static const yytype_int16 yydefgoto
[] =
1001 -1, 3, 4, 6, 8, 9, 27, 28, 29, 30,
1002 31, 32, 33, 34, 35, 36, 37, 38, 268, 377,
1003 39, 146, 71, 58, 67, 314, 315, 352, 114, 59,
1004 115, 255, 256, 257, 348, 393, 395, 68, 313, 105,
1005 266, 196, 97, 40, 41, 116, 191, 308, 251, 306,
1006 157, 42, 43, 44, 131, 83, 261, 355, 132, 117,
1007 356, 357, 118, 171, 285, 172, 384, 405, 173, 228,
1008 174, 406, 175, 300, 286, 277, 176, 303, 338, 177,
1009 223, 178, 275, 179, 241, 180, 399, 414, 181, 295,
1010 296, 340, 238, 289, 330, 332, 328, 182, 119, 359,
1011 360, 418, 120, 361, 420, 121, 271, 273, 362, 122,
1012 136, 123, 124, 138, 72, 45, 55, 46, 50, 77,
1013 47, 60, 91, 142, 205, 229, 215, 144, 319, 243,
1017 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1019 #define YYPACT_NINF -369
1020 static const yytype_int16 yypact
[] =
1022 143, -369, -369, 36, -369, -369, 45, -39, -369, 169,
1023 -33, -369, -19, -6, -4, 12, -369, -369, -34, -34,
1024 -34, -34, -34, -34, 15, 62, -34, -369, 26, -369,
1025 -369, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1026 60, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1027 20, 56, 107, 110, 37, 20, -3, -369, 111, 109,
1028 -369, 113, 114, 116, 117, 118, -369, 119, 125, -369,
1029 -369, -369, -15, 121, -369, -369, -369, 122, 132, -18,
1030 167, 210, -11, -369, 122, 63, -369, -369, -369, -369,
1031 130, -369, 62, -369, -369, -369, -369, -369, 62, 62,
1032 62, 62, 62, 62, -369, -369, -369, -369, 9, 72,
1033 87, -1, 131, 62, 104, 134, -369, -369, -369, -369,
1034 -369, -369, -369, -369, -369, -15, 142, -369, -369, -369,
1035 -369, 135, -369, -369, -369, -369, -369, -369, -369, 182,
1036 -369, -369, 52, 219, -369, 138, 139, -15, 140, -369,
1037 141, -369, -369, 61, -369, -369, 130, -369, 144, 145,
1038 146, 180, 11, 147, 85, 148, 99, 89, -2, 149,
1039 130, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1040 -369, 184, -369, 61, -369, 150, -369, -369, 130, 151,
1041 152, -369, 27, -369, -369, -369, -369, -10, 154, -369,
1042 153, -369, -369, -369, -369, -369, -369, 155, 62, 62,
1043 161, 168, 62, -369, -369, -369, -369, 229, 244, 246,
1044 -369, -369, -369, -369, 247, -369, -369, -369, -369, 204,
1045 247, 17, 163, 164, -369, 165, -369, 130, 67, -369,
1046 -369, -369, 252, 248, 18, 170, -369, 253, -369, 255,
1047 253, -369, 62, -369, -369, 171, -369, -369, 177, 62,
1048 172, -369, -369, -369, -369, -369, -369, 173, 175, 176,
1049 -369, 178, -369, 179, -369, 181, -369, 183, -369, 185,
1050 -369, -369, -369, -369, -369, -369, -369, 262, 264, -369,
1051 267, -369, -369, -369, -369, -369, -369, -369, 186, -369,
1052 -369, -369, -369, 136, 269, -369, 187, -369, 188, 190,
1053 43, -369, -369, 106, -369, 193, -5, -7, 271, -369,
1054 108, 62, -369, -369, 245, 4, 99, -369, 194, -369,
1055 195, -369, 196, -369, -369, -369, -369, -369, -369, -369,
1056 197, -369, -369, -369, 62, -369, 280, 285, -369, 62,
1057 -369, -369, -369, 93, 87, 53, -369, -369, -369, -369,
1058 -369, -369, -369, -369, 199, -369, -369, -369, -369, -369,
1059 -369, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1060 -369, -369, -369, 278, -369, -369, 8, -369, -369, -369,
1061 -369, 57, -369, -369, -369, -369, 203, 205, 206, -369,
1062 250, -7, -369, -369, -369, -369, -369, -369, 62, -369,
1063 62, 229, 244, 208, -369, -369, 198, 211, 202, 213,
1064 214, 218, 269, -369, 62, -369, 229, -369, 244, 54,
1065 -369, -369, -369, 269, 215, -369
1068 /* YYPGOTO[NTERM-NUM]. */
1069 static const yytype_int16 yypgoto
[] =
1071 -369, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1072 -369, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1073 -369, -94, -88, 133, -369, -369, -334, -369, -85, -369,
1074 -369, -369, -369, -369, -369, -369, -369, 128, -369, -369,
1075 -369, -369, -369, -369, -369, 251, -369, -369, -369, 77,
1076 -369, -369, -369, -369, -369, -369, -369, -369, -369, -369,
1077 -72, -369, -81, -369, -369, -369, -369, -369, -369, -369,
1078 -369, -369, -369, -369, -305, 101, -369, -369, -369, -369,
1079 -369, -369, -369, -369, -369, -369, -369, -369, -22, -369,
1080 -369, -336, -369, -369, -369, -369, -369, -369, 254, -369,
1081 -369, -369, -369, -369, -369, -369, -342, -368, 256, -369,
1082 -369, -369, -80, -110, -82, -369, -369, -369, -369, 279,
1083 -369, 257, -369, -369, -369, -161, 156, -146, -369, -369,
1084 -369, -369, -369, -369
1087 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1088 positive, shift that token. If negative, reduce the rule which
1089 number is the opposite. If zero, do what YYDEFACT says.
1090 If YYTABLE_NINF, syntax error. */
1091 #define YYTABLE_NINF -60
1092 static const yytype_int16 yytable
[] =
1094 139, 133, 137, 192, 145, 231, 149, 106, 107, 152,
1095 216, 148, 254, 150, 151, 396, 147, 350, 147, 108,
1096 385, 147, 108, 239, 244, 85, 86, 183, 280, 380,
1097 56, 139, 280, 87, 281, 184, 5, 153, 281, 221,
1098 198, 280, 248, 381, 421, 154, 109, 281, 185, 282,
1099 109, 186, 301, 7, 353, 88, 89, 110, 187, 10,
1100 432, 110, 210, 382, 57, 354, 222, 240, 155, 419,
1101 90, 302, 188, 49, 284, 383, 417, 111, 284, 51,
1102 111, 407, 156, 112, 431, 283, 429, 284, 66, 140,
1103 430, 291, 52, 351, 53, 189, 190, 434, 113, 69,
1104 70, 141, 113, 69, 70, 158, 113, 292, 293, 225,
1105 54, 226, 203, 66, 160, 264, 161, 159, 76, 204,
1106 263, 213, 162, 227, 269, 226, 397, 147, 214, 163,
1107 164, 165, 74, 166, 252, 167, 232, 227, 398, 233,
1108 234, 253, 310, 235, 168, 81, 1, 2, 294, 82,
1109 344, 236, 61, 62, 63, 64, 65, 345, 433, 73,
1110 401, 169, 170, 390, 408, 386, 75, 402, 78, 237,
1111 139, 409, 69, 70, 11, 12, 13, 316, 14, 15,
1112 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1113 26, 365, 366, 367, 368, 369, 370, 371, 372, 373,
1114 374, 375, 376, 193, 201, 202, 194, 195, 93, 94,
1115 95, 96, 334, 335, 336, 337, 346, 347, 92, 79,
1116 98, 99, 80, 100, 101, 102, 103, 104, 125, 126,
1117 127, 56, 130, 378, 391, 139, 358, 137, 143, -59,
1118 199, 206, 197, 220, 200, 208, 209, 211, 212, 245,
1119 267, 270, 217, 218, 219, 224, 230, 242, 247, 249,
1120 250, 259, 139, 265, 262, 260, 272, 316, 274, 276,
1121 278, 287, 288, 290, 297, 305, 299, 307, 304, 312,
1122 311, 318, 320, 321, 327, 317, 329, 322, 323, 331,
1123 324, 339, 325, 363, 326, 333, 341, 342, 416, 343,
1124 349, 379, 392, 387, 388, 389, 390, 394, 403, 404,
1125 410, 425, 423, 411, 412, 413, 422, 426, 424, 139,
1126 358, 137, 428, 427, 435, 258, 139, 309, 316, 415,
1127 128, 279, 400, 0, 84, 0, 134, 129, 135, 246,
1131 static const yytype_int16 yycheck
[] =
1133 82, 82, 82, 113, 92, 166, 100, 22, 23, 103,
1134 156, 99, 22, 101, 102, 349, 98, 22, 100, 37,
1135 325, 103, 37, 25, 170, 28, 29, 28, 24, 25,
1136 64, 113, 24, 36, 30, 36, 0, 28, 30, 28,
1137 125, 24, 188, 39, 412, 36, 61, 30, 49, 32,
1138 61, 52, 34, 8, 61, 58, 59, 72, 59, 98,
1139 428, 72, 147, 59, 98, 72, 55, 69, 59, 411,
1140 73, 53, 73, 106, 70, 71, 410, 95, 70, 98,
1141 95, 386, 73, 98, 426, 68, 422, 70, 98, 26,
1142 424, 237, 98, 98, 98, 96, 97, 433, 113, 110,
1143 111, 38, 113, 110, 111, 33, 113, 40, 41, 24,
1144 98, 26, 60, 98, 27, 209, 29, 45, 98, 67,
1145 208, 60, 35, 38, 212, 26, 33, 209, 67, 42,
1146 43, 44, 106, 46, 107, 48, 47, 38, 45, 50,
1147 51, 114, 252, 54, 57, 108, 3, 4, 81, 112,
1148 107, 62, 19, 20, 21, 22, 23, 114, 104, 26,
1149 107, 74, 75, 109, 107, 326, 106, 114, 112, 80,
1150 252, 114, 110, 111, 5, 6, 7, 259, 9, 10,
1151 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1152 21, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1153 92, 93, 94, 99, 22, 23, 102, 103, 99, 100,
1154 101, 102, 76, 77, 78, 79, 110, 111, 107, 112,
1155 107, 107, 112, 107, 107, 107, 107, 102, 107, 107,
1156 98, 64, 22, 321, 344, 317, 317, 317, 108, 108,
1157 98, 22, 108, 63, 109, 107, 107, 107, 107, 65,
1158 82, 22, 108, 108, 108, 108, 108, 108, 108, 108,
1159 108, 107, 344, 102, 109, 112, 22, 349, 22, 22,
1160 66, 108, 108, 108, 22, 22, 28, 22, 108, 102,
1161 109, 108, 107, 107, 22, 113, 22, 109, 109, 22,
1162 109, 22, 109, 22, 109, 109, 109, 109, 408, 109,
1163 107, 56, 22, 109, 109, 109, 109, 22, 109, 31,
1164 107, 109, 114, 108, 108, 65, 108, 104, 107, 401,
1165 401, 401, 104, 109, 109, 197, 408, 250, 410, 401,
1166 79, 230, 354, -1, 55, -1, 82, 80, 82, 183,
1170 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1171 symbol of state STATE-NUM. */
1172 static const yytype_uint8 yystos
[] =
1174 0, 3, 4, 116, 117, 0, 118, 8, 119, 120,
1175 98, 5, 6, 7, 9, 10, 11, 12, 13, 14,
1176 15, 16, 17, 18, 19, 20, 21, 121, 122, 123,
1177 124, 125, 126, 127, 128, 129, 130, 131, 132, 135,
1178 158, 159, 166, 167, 168, 230, 232, 235, 248, 106,
1179 233, 98, 98, 98, 98, 231, 64, 98, 138, 144,
1180 236, 138, 138, 138, 138, 138, 98, 139, 152, 110,
1181 111, 137, 229, 138, 106, 106, 98, 234, 112, 112,
1182 112, 108, 112, 170, 234, 28, 29, 36, 58, 59,
1183 73, 237, 107, 99, 100, 101, 102, 157, 107, 107,
1184 107, 107, 107, 107, 102, 154, 22, 23, 37, 61,
1185 72, 95, 98, 113, 143, 145, 160, 174, 177, 213,
1186 217, 220, 224, 226, 227, 107, 107, 98, 160, 236,
1187 22, 169, 173, 177, 213, 223, 225, 227, 228, 229,
1188 26, 38, 238, 108, 242, 137, 136, 229, 137, 136,
1189 137, 137, 136, 28, 36, 59, 73, 165, 33, 45,
1190 27, 29, 35, 42, 43, 44, 46, 48, 57, 74,
1191 75, 178, 180, 183, 185, 187, 191, 194, 196, 198,
1192 200, 203, 212, 28, 36, 49, 52, 59, 73, 96,
1193 97, 161, 228, 99, 102, 103, 156, 108, 143, 98,
1194 109, 22, 23, 60, 67, 239, 22, 245, 107, 107,
1195 143, 107, 107, 60, 67, 241, 242, 108, 108, 108,
1196 63, 28, 55, 195, 108, 24, 26, 38, 184, 240,
1197 108, 240, 47, 50, 51, 54, 62, 80, 207, 25,
1198 69, 199, 108, 244, 242, 65, 241, 108, 242, 108,
1199 108, 163, 107, 114, 22, 146, 147, 148, 152, 107,
1200 112, 171, 109, 137, 136, 102, 155, 82, 133, 137,
1201 22, 221, 22, 222, 22, 197, 22, 190, 66, 190,
1202 24, 30, 32, 68, 70, 179, 189, 108, 108, 208,
1203 108, 242, 40, 41, 81, 204, 205, 22, 247, 28,
1204 188, 34, 53, 192, 108, 22, 164, 22, 162, 164,
1205 228, 109, 102, 153, 140, 141, 229, 113, 108, 243,
1206 107, 107, 109, 109, 109, 109, 109, 22, 211, 22,
1207 209, 22, 210, 109, 76, 77, 78, 79, 193, 22,
1208 206, 109, 109, 109, 107, 114, 110, 111, 149, 107,
1209 22, 98, 142, 61, 72, 172, 175, 176, 177, 214,
1210 215, 218, 223, 22, 246, 83, 84, 85, 86, 87,
1211 88, 89, 90, 91, 92, 93, 94, 134, 137, 56,
1212 25, 39, 59, 71, 181, 189, 240, 109, 109, 109,
1213 109, 228, 22, 150, 22, 151, 141, 33, 45, 201,
1214 203, 107, 114, 109, 31, 182, 186, 189, 107, 114,
1215 107, 108, 108, 65, 202, 175, 228, 141, 216, 221,
1216 219, 222, 108, 114, 107, 109, 104, 109, 104, 206,
1217 141, 221, 222, 104, 206, 109
1220 #define yyerrok (yyerrstatus = 0)
1221 #define yyclearin (yychar = YYEMPTY)
1222 #define YYEMPTY (-2)
1225 #define YYACCEPT goto yyacceptlab
1226 #define YYABORT goto yyabortlab
1227 #define YYERROR goto yyerrorlab
1230 /* Like YYERROR except do call yyerror. This remains here temporarily
1231 to ease the transition to the new meaning of YYERROR, for GCC.
1232 Once GCC version 2 has supplanted version 1, this can go. */
1234 #define YYFAIL goto yyerrlab
1236 #define YYRECOVERING() (!!yyerrstatus)
1238 #define YYBACKUP(Token, Value) \
1240 if (yychar == YYEMPTY && yylen == 1) \
1244 yytoken = YYTRANSLATE (yychar); \
1250 yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
1257 #define YYERRCODE 256
1260 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1261 If N is 0, then set CURRENT to the empty location which ends
1262 the previous symbol: RHS[0] (always defined). */
1264 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1265 #ifndef YYLLOC_DEFAULT
1266 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1270 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1271 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1272 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1273 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1277 (Current).first_line = (Current).last_line = \
1278 YYRHSLOC (Rhs, 0).last_line; \
1279 (Current).first_column = (Current).last_column = \
1280 YYRHSLOC (Rhs, 0).last_column; \
1286 /* YY_LOCATION_PRINT -- Print the location on the stream.
1287 This macro was not mandated originally: define only if we know
1288 we won't break user code: when these are the locations we know. */
1290 #ifndef YY_LOCATION_PRINT
1291 # if YYLTYPE_IS_TRIVIAL
1292 # define YY_LOCATION_PRINT(File, Loc) \
1293 fprintf (File, "%d.%d-%d.%d", \
1294 (Loc).first_line, (Loc).first_column, \
1295 (Loc).last_line, (Loc).last_column)
1297 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1302 /* YYLEX -- calling `yylex' with the right arguments. */
1305 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1307 # define YYLEX yylex (&yylval, &yylloc, scanner)
1310 /* Enable debugging if requested. */
1314 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1315 # define YYFPRINTF fprintf
1318 # define YYDPRINTF(Args) \
1324 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1328 YYFPRINTF (stderr, "%s ", Title); \
1329 yy_symbol_print (stderr, \
1330 Type, Value, Location, state); \
1331 YYFPRINTF (stderr, "\n"); \
1336 /*--------------------------------.
1337 | Print this symbol on YYOUTPUT. |
1338 `--------------------------------*/
1341 #if (defined __STDC__ || defined __C99__FUNC__ \
1342 || defined __cplusplus || defined _MSC_VER)
1344 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1347 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1350 YYSTYPE
const * const yyvaluep
;
1351 YYLTYPE
const * const yylocationp
;
1352 struct asm_parser_state
*state
;
1357 YYUSE (yylocationp
);
1360 if (yytype
< YYNTOKENS
)
1361 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1373 /*--------------------------------.
1374 | Print this symbol on YYOUTPUT. |
1375 `--------------------------------*/
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1380 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, struct asm_parser_state
*state
)
1383 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
)
1386 YYSTYPE
const * const yyvaluep
;
1387 YYLTYPE
const * const yylocationp
;
1388 struct asm_parser_state
*state
;
1391 if (yytype
< YYNTOKENS
)
1392 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1394 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1396 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
1397 YYFPRINTF (yyoutput
, ": ");
1398 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, state
);
1399 YYFPRINTF (yyoutput
, ")");
1402 /*------------------------------------------------------------------.
1403 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1405 `------------------------------------------------------------------*/
1407 #if (defined __STDC__ || defined __C99__FUNC__ \
1408 || defined __cplusplus || defined _MSC_VER)
1410 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1413 yy_stack_print (yybottom
, yytop
)
1414 yytype_int16
*yybottom
;
1415 yytype_int16
*yytop
;
1418 YYFPRINTF (stderr
, "Stack now");
1419 for (; yybottom
<= yytop
; yybottom
++)
1421 int yybot
= *yybottom
;
1422 YYFPRINTF (stderr
, " %d", yybot
);
1424 YYFPRINTF (stderr
, "\n");
1427 # define YY_STACK_PRINT(Bottom, Top) \
1430 yy_stack_print ((Bottom), (Top)); \
1434 /*------------------------------------------------.
1435 | Report that the YYRULE is going to be reduced. |
1436 `------------------------------------------------*/
1438 #if (defined __STDC__ || defined __C99__FUNC__ \
1439 || defined __cplusplus || defined _MSC_VER)
1441 yy_reduce_print (YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, struct asm_parser_state
*state
)
1444 yy_reduce_print (yyvsp
, yylsp
, yyrule
, state
)
1448 struct asm_parser_state
*state
;
1451 int yynrhs
= yyr2
[yyrule
];
1453 unsigned long int yylno
= yyrline
[yyrule
];
1454 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1456 /* The symbols being reduced. */
1457 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1459 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1460 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1461 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1462 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , state
);
1463 YYFPRINTF (stderr
, "\n");
1467 # define YY_REDUCE_PRINT(Rule) \
1470 yy_reduce_print (yyvsp, yylsp, Rule, state); \
1473 /* Nonzero means print parse trace. It is left uninitialized so that
1474 multiple parsers can coexist. */
1476 #else /* !YYDEBUG */
1477 # define YYDPRINTF(Args)
1478 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1479 # define YY_STACK_PRINT(Bottom, Top)
1480 # define YY_REDUCE_PRINT(Rule)
1481 #endif /* !YYDEBUG */
1484 /* YYINITDEPTH -- initial size of the parser's stacks. */
1486 # define YYINITDEPTH 200
1489 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1490 if the built-in stack extension method is used).
1492 Do not make this value too large; the results are undefined if
1493 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1494 evaluated with infinite-precision integer arithmetic. */
1497 # define YYMAXDEPTH 10000
1505 # if defined __GLIBC__ && defined _STRING_H
1506 # define yystrlen strlen
1508 /* Return the length of YYSTR. */
1509 #if (defined __STDC__ || defined __C99__FUNC__ \
1510 || defined __cplusplus || defined _MSC_VER)
1512 yystrlen (const char *yystr
)
1520 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1528 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1529 # define yystpcpy stpcpy
1531 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1533 #if (defined __STDC__ || defined __C99__FUNC__ \
1534 || defined __cplusplus || defined _MSC_VER)
1536 yystpcpy (char *yydest
, const char *yysrc
)
1539 yystpcpy (yydest
, yysrc
)
1545 const char *yys
= yysrc
;
1547 while ((*yyd
++ = *yys
++) != '\0')
1556 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1557 quotes and backslashes, so that it's suitable for yyerror. The
1558 heuristic is that double-quoting is unnecessary unless the string
1559 contains an apostrophe, a comma, or backslash (other than
1560 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1561 null, do not copy; instead, return the length of what the result
1564 yytnamerr (char *yyres
, const char *yystr
)
1569 char const *yyp
= yystr
;
1576 goto do_not_strip_quotes
;
1580 goto do_not_strip_quotes
;
1593 do_not_strip_quotes
: ;
1597 return yystrlen (yystr
);
1599 return yystpcpy (yyres
, yystr
) - yyres
;
1603 /* Copy into YYRESULT an error message about the unexpected token
1604 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1605 including the terminating null byte. If YYRESULT is null, do not
1606 copy anything; just return the number of bytes that would be
1607 copied. As a special case, return 0 if an ordinary "syntax error"
1608 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1609 size calculation. */
1611 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1613 int yyn
= yypact
[yystate
];
1615 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1619 int yytype
= YYTRANSLATE (yychar
);
1620 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1621 YYSIZE_T yysize
= yysize0
;
1623 int yysize_overflow
= 0;
1624 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1625 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1629 /* This is so xgettext sees the translatable formats that are
1630 constructed on the fly. */
1631 YY_("syntax error, unexpected %s");
1632 YY_("syntax error, unexpected %s, expecting %s");
1633 YY_("syntax error, unexpected %s, expecting %s or %s");
1634 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1635 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1639 static char const yyunexpected
[] = "syntax error, unexpected %s";
1640 static char const yyexpecting
[] = ", expecting %s";
1641 static char const yyor
[] = " or %s";
1642 char yyformat
[sizeof yyunexpected
1643 + sizeof yyexpecting
- 1
1644 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1645 * (sizeof yyor
- 1))];
1646 char const *yyprefix
= yyexpecting
;
1648 /* Start YYX at -YYN if negative to avoid negative indexes in
1650 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1652 /* Stay within bounds of both yycheck and yytname. */
1653 int yychecklim
= YYLAST
- yyn
+ 1;
1654 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1657 yyarg
[0] = yytname
[yytype
];
1658 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1660 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1661 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1663 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1667 yyformat
[sizeof yyunexpected
- 1] = '\0';
1670 yyarg
[yycount
++] = yytname
[yyx
];
1671 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1672 yysize_overflow
|= (yysize1
< yysize
);
1674 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1678 yyf
= YY_(yyformat
);
1679 yysize1
= yysize
+ yystrlen (yyf
);
1680 yysize_overflow
|= (yysize1
< yysize
);
1683 if (yysize_overflow
)
1684 return YYSIZE_MAXIMUM
;
1688 /* Avoid sprintf, as that infringes on the user's name space.
1689 Don't have undefined behavior even if the translation
1690 produced a string with the wrong number of "%s"s. */
1691 char *yyp
= yyresult
;
1693 while ((*yyp
= *yyf
) != '\0')
1695 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1697 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1710 #endif /* YYERROR_VERBOSE */
1713 /*-----------------------------------------------.
1714 | Release the memory associated to this symbol. |
1715 `-----------------------------------------------*/
1718 #if (defined __STDC__ || defined __C99__FUNC__ \
1719 || defined __cplusplus || defined _MSC_VER)
1721 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, struct asm_parser_state
*state
)
1724 yydestruct (yymsg
, yytype
, yyvaluep
, yylocationp
, state
)
1728 YYLTYPE
*yylocationp
;
1729 struct asm_parser_state
*state
;
1733 YYUSE (yylocationp
);
1738 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1748 /* Prevent warnings from -Wmissing-prototypes. */
1749 #ifdef YYPARSE_PARAM
1750 #if defined __STDC__ || defined __cplusplus
1751 int yyparse (void *YYPARSE_PARAM
);
1755 #else /* ! YYPARSE_PARAM */
1756 #if defined __STDC__ || defined __cplusplus
1757 int yyparse (struct asm_parser_state
*state
);
1761 #endif /* ! YYPARSE_PARAM */
1767 /*-------------------------.
1768 | yyparse or yypush_parse. |
1769 `-------------------------*/
1771 #ifdef YYPARSE_PARAM
1772 #if (defined __STDC__ || defined __C99__FUNC__ \
1773 || defined __cplusplus || defined _MSC_VER)
1775 yyparse (void *YYPARSE_PARAM
)
1778 yyparse (YYPARSE_PARAM
)
1779 void *YYPARSE_PARAM
;
1781 #else /* ! YYPARSE_PARAM */
1782 #if (defined __STDC__ || defined __C99__FUNC__ \
1783 || defined __cplusplus || defined _MSC_VER)
1785 yyparse (struct asm_parser_state
*state
)
1789 struct asm_parser_state
*state
;
1793 /* The lookahead symbol. */
1796 /* The semantic value of the lookahead symbol. */
1799 /* Location data for the lookahead symbol. */
1802 /* Number of syntax errors so far. */
1806 /* Number of tokens to shift before error messages enabled. */
1809 /* The stacks and their tools:
1810 `yyss': related to states.
1811 `yyvs': related to semantic values.
1812 `yyls': related to locations.
1814 Refer to the stacks thru separate pointers, to allow yyoverflow
1815 to reallocate them elsewhere. */
1817 /* The state stack. */
1818 yytype_int16 yyssa
[YYINITDEPTH
];
1820 yytype_int16
*yyssp
;
1822 /* The semantic value stack. */
1823 YYSTYPE yyvsa
[YYINITDEPTH
];
1827 /* The location stack. */
1828 YYLTYPE yylsa
[YYINITDEPTH
];
1832 /* The locations where the error started and ended. */
1833 YYLTYPE yyerror_range
[2];
1835 YYSIZE_T yystacksize
;
1839 /* Lookahead token as an internal (translated) token number. */
1841 /* The variables used to return semantic value and location from the
1847 /* Buffer for error messages, and its allocated size. */
1849 char *yymsg
= yymsgbuf
;
1850 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1853 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1855 /* The number of symbols on the RHS of the reduced rule.
1856 Keep to zero when no symbol should be popped. */
1863 yystacksize
= YYINITDEPTH
;
1865 YYDPRINTF ((stderr
, "Starting parse\n"));
1870 yychar
= YYEMPTY
; /* Cause a token to be read. */
1872 /* Initialize stack pointers.
1873 Waste one element of value and location stack
1874 so that they stay on the same level as the state stack.
1875 The wasted elements are never initialized. */
1880 #if YYLTYPE_IS_TRIVIAL
1881 /* Initialize the default location before parsing starts. */
1882 yylloc
.first_line
= yylloc
.last_line
= 1;
1883 yylloc
.first_column
= yylloc
.last_column
= 1;
1888 /*------------------------------------------------------------.
1889 | yynewstate -- Push a new state, which is found in yystate. |
1890 `------------------------------------------------------------*/
1892 /* In all cases, when you get here, the value and location stacks
1893 have just been pushed. So pushing a state here evens the stacks. */
1899 if (yyss
+ yystacksize
- 1 <= yyssp
)
1901 /* Get the current used size of the three stacks, in elements. */
1902 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1906 /* Give user a chance to reallocate the stack. Use copies of
1907 these so that the &'s don't force the real ones into
1909 YYSTYPE
*yyvs1
= yyvs
;
1910 yytype_int16
*yyss1
= yyss
;
1911 YYLTYPE
*yyls1
= yyls
;
1913 /* Each stack pointer address is followed by the size of the
1914 data in use in that stack, in bytes. This used to be a
1915 conditional around just the two extra args, but that might
1916 be undefined if yyoverflow is a macro. */
1917 yyoverflow (YY_("memory exhausted"),
1918 &yyss1
, yysize
* sizeof (*yyssp
),
1919 &yyvs1
, yysize
* sizeof (*yyvsp
),
1920 &yyls1
, yysize
* sizeof (*yylsp
),
1927 #else /* no yyoverflow */
1928 # ifndef YYSTACK_RELOCATE
1929 goto yyexhaustedlab
;
1931 /* Extend the stack our own way. */
1932 if (YYMAXDEPTH
<= yystacksize
)
1933 goto yyexhaustedlab
;
1935 if (YYMAXDEPTH
< yystacksize
)
1936 yystacksize
= YYMAXDEPTH
;
1939 yytype_int16
*yyss1
= yyss
;
1940 union yyalloc
*yyptr
=
1941 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1943 goto yyexhaustedlab
;
1944 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1945 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1946 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1947 # undef YYSTACK_RELOCATE
1949 YYSTACK_FREE (yyss1
);
1952 #endif /* no yyoverflow */
1954 yyssp
= yyss
+ yysize
- 1;
1955 yyvsp
= yyvs
+ yysize
- 1;
1956 yylsp
= yyls
+ yysize
- 1;
1958 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1959 (unsigned long int) yystacksize
));
1961 if (yyss
+ yystacksize
- 1 <= yyssp
)
1965 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1967 if (yystate
== YYFINAL
)
1977 /* Do appropriate processing given the current state. Read a
1978 lookahead token if we need one and don't already have one. */
1980 /* First try to decide what to do without reference to lookahead token. */
1981 yyn
= yypact
[yystate
];
1982 if (yyn
== YYPACT_NINF
)
1985 /* Not known => get a lookahead token if don't already have one. */
1987 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1988 if (yychar
== YYEMPTY
)
1990 YYDPRINTF ((stderr
, "Reading a token: "));
1994 if (yychar
<= YYEOF
)
1996 yychar
= yytoken
= YYEOF
;
1997 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2001 yytoken
= YYTRANSLATE (yychar
);
2002 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2005 /* If the proper action on seeing token YYTOKEN is to reduce or to
2006 detect an error, take that action. */
2008 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2013 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2019 /* Count tokens shifted since error; after three, turn off error
2024 /* Shift the lookahead token. */
2025 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2027 /* Discard the shifted token. */
2036 /*-----------------------------------------------------------.
2037 | yydefault -- do the default action for the current state. |
2038 `-----------------------------------------------------------*/
2040 yyn
= yydefact
[yystate
];
2046 /*-----------------------------.
2047 | yyreduce -- Do a reduction. |
2048 `-----------------------------*/
2050 /* yyn is the number of a rule to reduce with. */
2053 /* If YYLEN is nonzero, implement the default value of the action:
2056 Otherwise, the following line sets YYVAL to garbage.
2057 This behavior is undocumented and Bison
2058 users should not rely upon it. Assigning to YYVAL
2059 unconditionally makes the parser a bit smaller, and it avoids a
2060 GCC warning that YYVAL may be used uninitialized. */
2061 yyval
= yyvsp
[1-yylen
];
2063 /* Default location. */
2064 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
2065 YY_REDUCE_PRINT (yyn
);
2070 /* Line 1455 of yacc.c */
2071 #line 260 "program_parse.y"
2073 if (state
->prog
->Target
!= GL_VERTEX_PROGRAM_ARB
) {
2074 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid fragment program header");
2077 state
->mode
= ARB_vertex
;
2083 /* Line 1455 of yacc.c */
2084 #line 268 "program_parse.y"
2086 if (state
->prog
->Target
!= GL_FRAGMENT_PROGRAM_ARB
) {
2087 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex program header");
2089 state
->mode
= ARB_fragment
;
2091 state
->option
.TexRect
=
2092 (state
->ctx
->Extensions
.NV_texture_rectangle
!= GL_FALSE
);
2098 /* Line 1455 of yacc.c */
2099 #line 284 "program_parse.y"
2103 if (state
->mode
== ARB_vertex
) {
2104 valid
= _mesa_ARBvp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2105 } else if (state
->mode
== ARB_fragment
) {
2106 valid
= _mesa_ARBfp_parse_option(state
, (yyvsp
[(2) - (3)].string
));
2111 const char *const err_str
= (state
->mode
== ARB_vertex
)
2112 ? "invalid ARB vertex program option"
2113 : "invalid ARB fragment program option";
2115 yyerror(& (yylsp
[(2) - (3)]), state
, err_str
);
2123 /* Line 1455 of yacc.c */
2124 #line 310 "program_parse.y"
2126 if ((yyvsp
[(1) - (2)].inst
) != NULL
) {
2127 if (state
->inst_tail
== NULL
) {
2128 state
->inst_head
= (yyvsp
[(1) - (2)].inst
);
2130 state
->inst_tail
->next
= (yyvsp
[(1) - (2)].inst
);
2133 state
->inst_tail
= (yyvsp
[(1) - (2)].inst
);
2134 (yyvsp
[(1) - (2)].inst
)->next
= NULL
;
2136 state
->prog
->NumInstructions
++;
2143 /* Line 1455 of yacc.c */
2144 #line 328 "program_parse.y"
2146 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2147 state
->prog
->NumAluInstructions
++;
2153 /* Line 1455 of yacc.c */
2154 #line 333 "program_parse.y"
2156 (yyval
.inst
) = (yyvsp
[(1) - (1)].inst
);
2157 state
->prog
->NumTexInstructions
++;
2163 /* Line 1455 of yacc.c */
2164 #line 353 "program_parse.y"
2166 (yyval
.inst
) = asm_instruction_ctor(OPCODE_ARL
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2172 /* Line 1455 of yacc.c */
2173 #line 359 "program_parse.y"
2175 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2176 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2182 /* Line 1455 of yacc.c */
2183 #line 366 "program_parse.y"
2185 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (4)].temp_inst
).Opcode
, & (yyvsp
[(2) - (4)].dst_reg
), & (yyvsp
[(4) - (4)].src_reg
), NULL
, NULL
);
2186 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (4)].temp_inst
).SaturateMode
;
2192 /* Line 1455 of yacc.c */
2193 #line 373 "program_parse.y"
2195 (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
);
2196 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2202 /* Line 1455 of yacc.c */
2203 #line 381 "program_parse.y"
2205 (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
);
2206 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2212 /* Line 1455 of yacc.c */
2213 #line 389 "program_parse.y"
2215 (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
));
2216 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2222 /* Line 1455 of yacc.c */
2223 #line 396 "program_parse.y"
2225 (yyval
.inst
) = asm_instruction_ctor((yyvsp
[(1) - (8)].temp_inst
).Opcode
, & (yyvsp
[(2) - (8)].dst_reg
), & (yyvsp
[(4) - (8)].src_reg
), NULL
, NULL
);
2226 if ((yyval
.inst
) != NULL
) {
2227 const GLbitfield tex_mask
= (1U << (yyvsp
[(6) - (8)].integer
));
2228 GLbitfield shadow_tex
= 0;
2229 GLbitfield target_mask
= 0;
2232 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (8)].temp_inst
).SaturateMode
;
2233 (yyval
.inst
)->Base
.TexSrcUnit
= (yyvsp
[(6) - (8)].integer
);
2235 if ((yyvsp
[(8) - (8)].integer
) < 0) {
2236 shadow_tex
= tex_mask
;
2238 (yyval
.inst
)->Base
.TexSrcTarget
= -(yyvsp
[(8) - (8)].integer
);
2239 (yyval
.inst
)->Base
.TexShadow
= 1;
2241 (yyval
.inst
)->Base
.TexSrcTarget
= (yyvsp
[(8) - (8)].integer
);
2244 target_mask
= (1U << (yyval
.inst
)->Base
.TexSrcTarget
);
2246 /* If this texture unit was previously accessed and that access
2247 * had a different texture target, generate an error.
2249 * If this texture unit was previously accessed and that access
2250 * had a different shadow mode, generate an error.
2252 if ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != 0)
2253 && ((state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] != target_mask
)
2254 || ((state
->prog
->ShadowSamplers
& tex_mask
)
2256 yyerror(& (yylsp
[(8) - (8)]), state
,
2257 "multiple targets used on one texture image unit");
2262 state
->prog
->TexturesUsed
[(yyvsp
[(6) - (8)].integer
)] |= target_mask
;
2263 state
->prog
->ShadowSamplers
|= shadow_tex
;
2270 /* Line 1455 of yacc.c */
2271 #line 441 "program_parse.y"
2273 (yyval
.inst
) = asm_instruction_ctor(OPCODE_KIL
, NULL
, & (yyvsp
[(2) - (2)].src_reg
), NULL
, NULL
);
2274 state
->fragment
.UsesKill
= 1;
2280 /* Line 1455 of yacc.c */
2281 #line 448 "program_parse.y"
2283 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
2289 /* Line 1455 of yacc.c */
2290 #line 453 "program_parse.y"
2291 { (yyval
.integer
) = TEXTURE_1D_INDEX
; ;}
2296 /* Line 1455 of yacc.c */
2297 #line 454 "program_parse.y"
2298 { (yyval
.integer
) = TEXTURE_2D_INDEX
; ;}
2303 /* Line 1455 of yacc.c */
2304 #line 455 "program_parse.y"
2305 { (yyval
.integer
) = TEXTURE_3D_INDEX
; ;}
2310 /* Line 1455 of yacc.c */
2311 #line 456 "program_parse.y"
2312 { (yyval
.integer
) = TEXTURE_CUBE_INDEX
; ;}
2317 /* Line 1455 of yacc.c */
2318 #line 457 "program_parse.y"
2319 { (yyval
.integer
) = TEXTURE_RECT_INDEX
; ;}
2324 /* Line 1455 of yacc.c */
2325 #line 458 "program_parse.y"
2326 { (yyval
.integer
) = -TEXTURE_1D_INDEX
; ;}
2331 /* Line 1455 of yacc.c */
2332 #line 459 "program_parse.y"
2333 { (yyval
.integer
) = -TEXTURE_2D_INDEX
; ;}
2338 /* Line 1455 of yacc.c */
2339 #line 460 "program_parse.y"
2340 { (yyval
.integer
) = -TEXTURE_RECT_INDEX
; ;}
2345 /* Line 1455 of yacc.c */
2346 #line 461 "program_parse.y"
2347 { (yyval
.integer
) = TEXTURE_1D_ARRAY_INDEX
; ;}
2352 /* Line 1455 of yacc.c */
2353 #line 462 "program_parse.y"
2354 { (yyval
.integer
) = TEXTURE_2D_ARRAY_INDEX
; ;}
2359 /* Line 1455 of yacc.c */
2360 #line 463 "program_parse.y"
2361 { (yyval
.integer
) = -TEXTURE_1D_ARRAY_INDEX
; ;}
2366 /* Line 1455 of yacc.c */
2367 #line 464 "program_parse.y"
2368 { (yyval
.integer
) = -TEXTURE_2D_ARRAY_INDEX
; ;}
2373 /* Line 1455 of yacc.c */
2374 #line 468 "program_parse.y"
2376 /* FIXME: Is this correct? Should the extenedSwizzle be applied
2377 * FIXME: to the existing swizzle?
2379 (yyvsp
[(4) - (6)].src_reg
).Base
.Swizzle
= (yyvsp
[(6) - (6)].swiz_mask
).swizzle
;
2380 (yyvsp
[(4) - (6)].src_reg
).Base
.Negate
= (yyvsp
[(6) - (6)].swiz_mask
).mask
;
2382 (yyval
.inst
) = asm_instruction_ctor(OPCODE_SWZ
, & (yyvsp
[(2) - (6)].dst_reg
), & (yyvsp
[(4) - (6)].src_reg
), NULL
, NULL
);
2383 (yyval
.inst
)->Base
.SaturateMode
= (yyvsp
[(1) - (6)].temp_inst
).SaturateMode
;
2389 /* Line 1455 of yacc.c */
2390 #line 481 "program_parse.y"
2392 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2394 if ((yyvsp
[(1) - (3)].negate
)) {
2395 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2398 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2399 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2405 /* Line 1455 of yacc.c */
2406 #line 494 "program_parse.y"
2408 (yyval
.src_reg
) = (yyvsp
[(2) - (3)].src_reg
);
2410 if ((yyvsp
[(1) - (3)].negate
)) {
2411 (yyval
.src_reg
).Base
.Negate
= ~(yyval
.src_reg
).Base
.Negate
;
2414 (yyval
.src_reg
).Base
.Swizzle
= _mesa_combine_swizzles((yyval
.src_reg
).Base
.Swizzle
,
2415 (yyvsp
[(3) - (3)].swiz_mask
).swizzle
);
2421 /* Line 1455 of yacc.c */
2422 #line 507 "program_parse.y"
2424 (yyval
.dst_reg
) = (yyvsp
[(1) - (2)].dst_reg
);
2425 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2427 if ((yyval
.dst_reg
).File
== PROGRAM_OUTPUT
) {
2428 /* Technically speaking, this should check that it is in
2429 * vertex program mode. However, PositionInvariant can never be
2430 * set in fragment program mode, so it is somewhat irrelevant.
2432 if (state
->option
.PositionInvariant
2433 && ((yyval
.dst_reg
).Index
== VERT_RESULT_HPOS
)) {
2434 yyerror(& (yylsp
[(1) - (2)]), state
, "position-invariant programs cannot "
2439 state
->prog
->OutputsWritten
|= (1U << (yyval
.dst_reg
).Index
);
2446 /* Line 1455 of yacc.c */
2447 #line 529 "program_parse.y"
2449 init_dst_reg(& (yyval
.dst_reg
));
2450 (yyval
.dst_reg
).File
= PROGRAM_ADDRESS
;
2451 (yyval
.dst_reg
).Index
= 0;
2452 (yyval
.dst_reg
).WriteMask
= (yyvsp
[(2) - (2)].swiz_mask
).mask
;
2458 /* Line 1455 of yacc.c */
2459 #line 538 "program_parse.y"
2461 const unsigned xyzw_valid
=
2462 ((yyvsp
[(1) - (7)].ext_swizzle
).xyzw_valid
<< 0)
2463 | ((yyvsp
[(3) - (7)].ext_swizzle
).xyzw_valid
<< 1)
2464 | ((yyvsp
[(5) - (7)].ext_swizzle
).xyzw_valid
<< 2)
2465 | ((yyvsp
[(7) - (7)].ext_swizzle
).xyzw_valid
<< 3);
2466 const unsigned rgba_valid
=
2467 ((yyvsp
[(1) - (7)].ext_swizzle
).rgba_valid
<< 0)
2468 | ((yyvsp
[(3) - (7)].ext_swizzle
).rgba_valid
<< 1)
2469 | ((yyvsp
[(5) - (7)].ext_swizzle
).rgba_valid
<< 2)
2470 | ((yyvsp
[(7) - (7)].ext_swizzle
).rgba_valid
<< 3);
2472 /* All of the swizzle components have to be valid in either RGBA
2473 * or XYZW. Note that 0 and 1 are valid in both, so both masks
2474 * can have some bits set.
2476 * We somewhat deviate from the spec here. It would be really hard
2477 * to figure out which component is the error, and there probably
2478 * isn't a lot of benefit.
2480 if ((rgba_valid
!= 0x0f) && (xyzw_valid
!= 0x0f)) {
2481 yyerror(& (yylsp
[(1) - (7)]), state
, "cannot combine RGBA and XYZW swizzle "
2486 (yyval
.swiz_mask
).swizzle
= MAKE_SWIZZLE4((yyvsp
[(1) - (7)].ext_swizzle
).swz
, (yyvsp
[(3) - (7)].ext_swizzle
).swz
, (yyvsp
[(5) - (7)].ext_swizzle
).swz
, (yyvsp
[(7) - (7)].ext_swizzle
).swz
);
2487 (yyval
.swiz_mask
).mask
= ((yyvsp
[(1) - (7)].ext_swizzle
).negate
) | ((yyvsp
[(3) - (7)].ext_swizzle
).negate
<< 1) | ((yyvsp
[(5) - (7)].ext_swizzle
).negate
<< 2)
2488 | ((yyvsp
[(7) - (7)].ext_swizzle
).negate
<< 3);
2494 /* Line 1455 of yacc.c */
2495 #line 571 "program_parse.y"
2497 (yyval
.ext_swizzle
) = (yyvsp
[(2) - (2)].ext_swizzle
);
2498 (yyval
.ext_swizzle
).negate
= ((yyvsp
[(1) - (2)].negate
)) ? 1 : 0;
2504 /* Line 1455 of yacc.c */
2505 #line 578 "program_parse.y"
2507 if (((yyvsp
[(1) - (1)].integer
) != 0) && ((yyvsp
[(1) - (1)].integer
) != 1)) {
2508 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2512 (yyval
.ext_swizzle
).swz
= ((yyvsp
[(1) - (1)].integer
) == 0) ? SWIZZLE_ZERO
: SWIZZLE_ONE
;
2514 /* 0 and 1 are valid for both RGBA swizzle names and XYZW
2517 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2518 (yyval
.ext_swizzle
).rgba_valid
= 1;
2524 /* Line 1455 of yacc.c */
2525 #line 593 "program_parse.y"
2527 if (strlen((yyvsp
[(1) - (1)].string
)) > 1) {
2528 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2532 switch ((yyvsp
[(1) - (1)].string
)[0]) {
2534 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2535 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2538 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2539 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2542 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2543 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2546 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2547 (yyval
.ext_swizzle
).xyzw_valid
= 1;
2551 (yyval
.ext_swizzle
).swz
= SWIZZLE_X
;
2552 (yyval
.ext_swizzle
).rgba_valid
= 1;
2555 (yyval
.ext_swizzle
).swz
= SWIZZLE_Y
;
2556 (yyval
.ext_swizzle
).rgba_valid
= 1;
2559 (yyval
.ext_swizzle
).swz
= SWIZZLE_Z
;
2560 (yyval
.ext_swizzle
).rgba_valid
= 1;
2563 (yyval
.ext_swizzle
).swz
= SWIZZLE_W
;
2564 (yyval
.ext_swizzle
).rgba_valid
= 1;
2568 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid extended swizzle selector");
2577 /* Line 1455 of yacc.c */
2578 #line 643 "program_parse.y"
2580 struct asm_symbol
*const s
= (struct asm_symbol
*)
2581 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2584 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2586 } else if ((s
->type
!= at_param
) && (s
->type
!= at_temp
)
2587 && (s
->type
!= at_attrib
)) {
2588 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2590 } else if ((s
->type
== at_param
) && s
->param_is_array
) {
2591 yyerror(& (yylsp
[(1) - (1)]), state
, "non-array access to array PARAM");
2595 init_src_reg(& (yyval
.src_reg
));
2598 (yyval
.src_reg
).Base
.File
= PROGRAM_TEMPORARY
;
2599 (yyval
.src_reg
).Base
.Index
= s
->temp_binding
;
2602 (yyval
.src_reg
).Base
.File
= s
->param_binding_type
;
2603 (yyval
.src_reg
).Base
.Index
= s
->param_binding_begin
;
2606 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2607 (yyval
.src_reg
).Base
.Index
= s
->attrib_binding
;
2608 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2610 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2624 /* Line 1455 of yacc.c */
2625 #line 685 "program_parse.y"
2627 init_src_reg(& (yyval
.src_reg
));
2628 (yyval
.src_reg
).Base
.File
= PROGRAM_INPUT
;
2629 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].attrib
);
2630 state
->prog
->InputsRead
|= (1U << (yyval
.src_reg
).Base
.Index
);
2632 if (!validate_inputs(& (yylsp
[(1) - (1)]), state
)) {
2640 /* Line 1455 of yacc.c */
2641 #line 696 "program_parse.y"
2643 if (! (yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
2644 && ((unsigned) (yyvsp
[(3) - (4)].src_reg
).Base
.Index
>= (yyvsp
[(1) - (4)].sym
)->param_binding_length
)) {
2645 yyerror(& (yylsp
[(3) - (4)]), state
, "out of bounds array access");
2649 init_src_reg(& (yyval
.src_reg
));
2650 (yyval
.src_reg
).Base
.File
= (yyvsp
[(1) - (4)].sym
)->param_binding_type
;
2652 if ((yyvsp
[(3) - (4)].src_reg
).Base
.RelAddr
) {
2653 (yyvsp
[(1) - (4)].sym
)->param_accessed_indirectly
= 1;
2655 (yyval
.src_reg
).Base
.RelAddr
= 1;
2656 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2657 (yyval
.src_reg
).Symbol
= (yyvsp
[(1) - (4)].sym
);
2659 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (4)].sym
)->param_binding_begin
+ (yyvsp
[(3) - (4)].src_reg
).Base
.Index
;
2666 /* Line 1455 of yacc.c */
2667 #line 717 "program_parse.y"
2669 init_src_reg(& (yyval
.src_reg
));
2670 (yyval
.src_reg
).Base
.File
= ((yyvsp
[(1) - (1)].temp_sym
).name
!= NULL
)
2671 ? (yyvsp
[(1) - (1)].temp_sym
).param_binding_type
2673 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].temp_sym
).param_binding_begin
;
2679 /* Line 1455 of yacc.c */
2680 #line 727 "program_parse.y"
2682 init_dst_reg(& (yyval
.dst_reg
));
2683 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2684 (yyval
.dst_reg
).Index
= (yyvsp
[(1) - (1)].result
);
2690 /* Line 1455 of yacc.c */
2691 #line 733 "program_parse.y"
2693 struct asm_symbol
*const s
= (struct asm_symbol
*)
2694 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2697 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2699 } else if ((s
->type
!= at_output
) && (s
->type
!= at_temp
)) {
2700 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2704 init_dst_reg(& (yyval
.dst_reg
));
2707 (yyval
.dst_reg
).File
= PROGRAM_TEMPORARY
;
2708 (yyval
.dst_reg
).Index
= s
->temp_binding
;
2711 (yyval
.dst_reg
).File
= PROGRAM_OUTPUT
;
2712 (yyval
.dst_reg
).Index
= s
->output_binding
;
2715 (yyval
.dst_reg
).File
= s
->param_binding_type
;
2716 (yyval
.dst_reg
).Index
= s
->param_binding_begin
;
2724 /* Line 1455 of yacc.c */
2725 #line 764 "program_parse.y"
2727 struct asm_symbol
*const s
= (struct asm_symbol
*)
2728 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2731 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid operand variable");
2733 } else if ((s
->type
!= at_param
) || !s
->param_is_array
) {
2734 yyerror(& (yylsp
[(1) - (1)]), state
, "array access to non-PARAM variable");
2744 /* Line 1455 of yacc.c */
2745 #line 783 "program_parse.y"
2747 init_src_reg(& (yyval
.src_reg
));
2748 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(1) - (1)].integer
);
2754 /* Line 1455 of yacc.c */
2755 #line 790 "program_parse.y"
2757 /* FINISHME: Add support for multiple address registers.
2759 /* FINISHME: Add support for 4-component address registers.
2761 init_src_reg(& (yyval
.src_reg
));
2762 (yyval
.src_reg
).Base
.RelAddr
= 1;
2763 (yyval
.src_reg
).Base
.Index
= (yyvsp
[(3) - (3)].integer
);
2769 /* Line 1455 of yacc.c */
2770 #line 801 "program_parse.y"
2771 { (yyval
.integer
) = 0; ;}
2776 /* Line 1455 of yacc.c */
2777 #line 802 "program_parse.y"
2778 { (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
); ;}
2783 /* Line 1455 of yacc.c */
2784 #line 803 "program_parse.y"
2785 { (yyval
.integer
) = -(yyvsp
[(2) - (2)].integer
); ;}
2790 /* Line 1455 of yacc.c */
2791 #line 807 "program_parse.y"
2793 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 63)) {
2794 yyerror(& (yylsp
[(1) - (1)]), state
,
2795 "relative address offset too large (positive)");
2798 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2805 /* Line 1455 of yacc.c */
2806 #line 819 "program_parse.y"
2808 if (((yyvsp
[(1) - (1)].integer
) < 0) || ((yyvsp
[(1) - (1)].integer
) > 64)) {
2809 yyerror(& (yylsp
[(1) - (1)]), state
,
2810 "relative address offset too large (negative)");
2813 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
2820 /* Line 1455 of yacc.c */
2821 #line 831 "program_parse.y"
2823 struct asm_symbol
*const s
= (struct asm_symbol
*)
2824 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(1) - (1)].string
));
2827 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid array member");
2829 } else if (s
->type
!= at_address
) {
2830 yyerror(& (yylsp
[(1) - (1)]), state
,
2831 "invalid variable for indexed array access");
2841 /* Line 1455 of yacc.c */
2842 #line 849 "program_parse.y"
2844 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2845 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid address component selector");
2848 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2855 /* Line 1455 of yacc.c */
2856 #line 860 "program_parse.y"
2858 if ((yyvsp
[(1) - (1)].swiz_mask
).mask
!= WRITEMASK_X
) {
2859 yyerror(& (yylsp
[(1) - (1)]), state
,
2860 "address register write mask must be \".x\"");
2863 (yyval
.swiz_mask
) = (yyvsp
[(1) - (1)].swiz_mask
);
2870 /* Line 1455 of yacc.c */
2871 #line 876 "program_parse.y"
2872 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2877 /* Line 1455 of yacc.c */
2878 #line 880 "program_parse.y"
2879 { (yyval
.swiz_mask
).swizzle
= SWIZZLE_NOOP
; (yyval
.swiz_mask
).mask
= WRITEMASK_XYZW
; ;}
2884 /* Line 1455 of yacc.c */
2885 #line 892 "program_parse.y"
2887 struct asm_symbol
*const s
=
2888 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_attrib
, & (yylsp
[(2) - (4)]));
2893 s
->attrib_binding
= (yyvsp
[(4) - (4)].attrib
);
2894 state
->InputsBound
|= (1U << s
->attrib_binding
);
2896 if (!validate_inputs(& (yylsp
[(4) - (4)]), state
)) {
2905 /* Line 1455 of yacc.c */
2906 #line 910 "program_parse.y"
2908 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2914 /* Line 1455 of yacc.c */
2915 #line 914 "program_parse.y"
2917 (yyval
.attrib
) = (yyvsp
[(2) - (2)].attrib
);
2923 /* Line 1455 of yacc.c */
2924 #line 920 "program_parse.y"
2926 (yyval
.attrib
) = VERT_ATTRIB_POS
;
2932 /* Line 1455 of yacc.c */
2933 #line 924 "program_parse.y"
2935 (yyval
.attrib
) = VERT_ATTRIB_WEIGHT
;
2941 /* Line 1455 of yacc.c */
2942 #line 928 "program_parse.y"
2944 (yyval
.attrib
) = VERT_ATTRIB_NORMAL
;
2950 /* Line 1455 of yacc.c */
2951 #line 932 "program_parse.y"
2953 if (!state
->ctx
->Extensions
.EXT_secondary_color
) {
2954 yyerror(& (yylsp
[(2) - (2)]), state
, "GL_EXT_secondary_color not supported");
2958 (yyval
.attrib
) = VERT_ATTRIB_COLOR0
+ (yyvsp
[(2) - (2)].integer
);
2964 /* Line 1455 of yacc.c */
2965 #line 941 "program_parse.y"
2967 if (!state
->ctx
->Extensions
.EXT_fog_coord
) {
2968 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_EXT_fog_coord not supported");
2972 (yyval
.attrib
) = VERT_ATTRIB_FOG
;
2978 /* Line 1455 of yacc.c */
2979 #line 950 "program_parse.y"
2981 (yyval
.attrib
) = VERT_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
2987 /* Line 1455 of yacc.c */
2988 #line 954 "program_parse.y"
2990 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
2997 /* Line 1455 of yacc.c */
2998 #line 959 "program_parse.y"
3000 (yyval
.attrib
) = VERT_ATTRIB_GENERIC0
+ (yyvsp
[(3) - (4)].integer
);
3006 /* Line 1455 of yacc.c */
3007 #line 965 "program_parse.y"
3009 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxAttribs
) {
3010 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid vertex attribute reference");
3014 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3020 /* Line 1455 of yacc.c */
3021 #line 979 "program_parse.y"
3023 (yyval
.attrib
) = FRAG_ATTRIB_WPOS
;
3029 /* Line 1455 of yacc.c */
3030 #line 983 "program_parse.y"
3032 (yyval
.attrib
) = FRAG_ATTRIB_COL0
+ (yyvsp
[(2) - (2)].integer
);
3038 /* Line 1455 of yacc.c */
3039 #line 987 "program_parse.y"
3041 (yyval
.attrib
) = FRAG_ATTRIB_FOGC
;
3047 /* Line 1455 of yacc.c */
3048 #line 991 "program_parse.y"
3050 (yyval
.attrib
) = FRAG_ATTRIB_TEX0
+ (yyvsp
[(2) - (2)].integer
);
3056 /* Line 1455 of yacc.c */
3057 #line 999 "program_parse.y"
3059 struct asm_symbol
*const s
=
3060 declare_variable(state
, (yyvsp
[(2) - (3)].string
), at_param
, & (yylsp
[(2) - (3)]));
3065 s
->param_binding_type
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_type
;
3066 s
->param_binding_begin
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_begin
;
3067 s
->param_binding_length
= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3068 s
->param_is_array
= 0;
3075 /* Line 1455 of yacc.c */
3076 #line 1015 "program_parse.y"
3078 if (((yyvsp
[(4) - (6)].integer
) != 0) && ((unsigned) (yyvsp
[(4) - (6)].integer
) != (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
)) {
3079 yyerror(& (yylsp
[(4) - (6)]), state
,
3080 "parameter array size and number of bindings must match");
3083 struct asm_symbol
*const s
=
3084 declare_variable(state
, (yyvsp
[(2) - (6)].string
), (yyvsp
[(6) - (6)].temp_sym
).type
, & (yylsp
[(2) - (6)]));
3089 s
->param_binding_type
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_type
;
3090 s
->param_binding_begin
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_begin
;
3091 s
->param_binding_length
= (yyvsp
[(6) - (6)].temp_sym
).param_binding_length
;
3092 s
->param_is_array
= 1;
3100 /* Line 1455 of yacc.c */
3101 #line 1037 "program_parse.y"
3103 (yyval
.integer
) = 0;
3109 /* Line 1455 of yacc.c */
3110 #line 1041 "program_parse.y"
3112 if (((yyvsp
[(1) - (1)].integer
) < 1) || ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxParameters
)) {
3113 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid parameter array size");
3116 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3123 /* Line 1455 of yacc.c */
3124 #line 1052 "program_parse.y"
3126 (yyval
.temp_sym
) = (yyvsp
[(2) - (2)].temp_sym
);
3132 /* Line 1455 of yacc.c */
3133 #line 1058 "program_parse.y"
3135 (yyval
.temp_sym
) = (yyvsp
[(3) - (4)].temp_sym
);
3141 /* Line 1455 of yacc.c */
3142 #line 1065 "program_parse.y"
3144 (yyvsp
[(1) - (3)].temp_sym
).param_binding_length
+= (yyvsp
[(3) - (3)].temp_sym
).param_binding_length
;
3145 (yyval
.temp_sym
) = (yyvsp
[(1) - (3)].temp_sym
);
3151 /* Line 1455 of yacc.c */
3152 #line 1072 "program_parse.y"
3154 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3155 (yyval
.temp_sym
).param_binding_begin
= ~0;
3156 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3162 /* Line 1455 of yacc.c */
3163 #line 1078 "program_parse.y"
3165 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3166 (yyval
.temp_sym
).param_binding_begin
= ~0;
3167 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3173 /* Line 1455 of yacc.c */
3174 #line 1084 "program_parse.y"
3176 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3177 (yyval
.temp_sym
).param_binding_begin
= ~0;
3178 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3184 /* Line 1455 of yacc.c */
3185 #line 1092 "program_parse.y"
3187 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3188 (yyval
.temp_sym
).param_binding_begin
= ~0;
3189 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3195 /* Line 1455 of yacc.c */
3196 #line 1098 "program_parse.y"
3198 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3199 (yyval
.temp_sym
).param_binding_begin
= ~0;
3200 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3206 /* Line 1455 of yacc.c */
3207 #line 1104 "program_parse.y"
3209 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3210 (yyval
.temp_sym
).param_binding_begin
= ~0;
3211 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3217 /* Line 1455 of yacc.c */
3218 #line 1112 "program_parse.y"
3220 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3221 (yyval
.temp_sym
).param_binding_begin
= ~0;
3222 initialize_symbol_from_state(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3228 /* Line 1455 of yacc.c */
3229 #line 1118 "program_parse.y"
3231 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3232 (yyval
.temp_sym
).param_binding_begin
= ~0;
3233 initialize_symbol_from_param(state
->prog
, & (yyval
.temp_sym
), (yyvsp
[(1) - (1)].state
));
3239 /* Line 1455 of yacc.c */
3240 #line 1124 "program_parse.y"
3242 memset(& (yyval
.temp_sym
), 0, sizeof((yyval
.temp_sym
)));
3243 (yyval
.temp_sym
).param_binding_begin
= ~0;
3244 initialize_symbol_from_const(state
->prog
, & (yyval
.temp_sym
), & (yyvsp
[(1) - (1)].vector
));
3250 /* Line 1455 of yacc.c */
3251 #line 1131 "program_parse.y"
3252 { memcpy((yyval
.state
), (yyvsp
[(1) - (1)].state
), sizeof((yyval
.state
))); ;}
3257 /* Line 1455 of yacc.c */
3258 #line 1132 "program_parse.y"
3259 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3264 /* Line 1455 of yacc.c */
3265 #line 1135 "program_parse.y"
3266 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3271 /* Line 1455 of yacc.c */
3272 #line 1136 "program_parse.y"
3273 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3278 /* Line 1455 of yacc.c */
3279 #line 1137 "program_parse.y"
3280 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3285 /* Line 1455 of yacc.c */
3286 #line 1138 "program_parse.y"
3287 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3292 /* Line 1455 of yacc.c */
3293 #line 1139 "program_parse.y"
3294 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3299 /* Line 1455 of yacc.c */
3300 #line 1140 "program_parse.y"
3301 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3306 /* Line 1455 of yacc.c */
3307 #line 1141 "program_parse.y"
3308 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3313 /* Line 1455 of yacc.c */
3314 #line 1142 "program_parse.y"
3315 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3320 /* Line 1455 of yacc.c */
3321 #line 1143 "program_parse.y"
3322 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3327 /* Line 1455 of yacc.c */
3328 #line 1144 "program_parse.y"
3329 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3334 /* Line 1455 of yacc.c */
3335 #line 1145 "program_parse.y"
3336 { memcpy((yyval
.state
), (yyvsp
[(2) - (2)].state
), sizeof((yyval
.state
))); ;}
3341 /* Line 1455 of yacc.c */
3342 #line 1149 "program_parse.y"
3344 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3345 (yyval
.state
)[0] = STATE_MATERIAL
;
3346 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3347 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3353 /* Line 1455 of yacc.c */
3354 #line 1158 "program_parse.y"
3356 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3362 /* Line 1455 of yacc.c */
3363 #line 1162 "program_parse.y"
3365 (yyval
.integer
) = STATE_EMISSION
;
3371 /* Line 1455 of yacc.c */
3372 #line 1166 "program_parse.y"
3374 (yyval
.integer
) = STATE_SHININESS
;
3380 /* Line 1455 of yacc.c */
3381 #line 1172 "program_parse.y"
3383 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3384 (yyval
.state
)[0] = STATE_LIGHT
;
3385 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3386 (yyval
.state
)[2] = (yyvsp
[(5) - (5)].integer
);
3392 /* Line 1455 of yacc.c */
3393 #line 1181 "program_parse.y"
3395 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3401 /* Line 1455 of yacc.c */
3402 #line 1185 "program_parse.y"
3404 (yyval
.integer
) = STATE_POSITION
;
3410 /* Line 1455 of yacc.c */
3411 #line 1189 "program_parse.y"
3413 if (!state
->ctx
->Extensions
.EXT_point_parameters
) {
3414 yyerror(& (yylsp
[(1) - (1)]), state
, "GL_ARB_point_parameters not supported");
3418 (yyval
.integer
) = STATE_ATTENUATION
;
3424 /* Line 1455 of yacc.c */
3425 #line 1198 "program_parse.y"
3427 (yyval
.integer
) = (yyvsp
[(2) - (2)].integer
);
3433 /* Line 1455 of yacc.c */
3434 #line 1202 "program_parse.y"
3436 (yyval
.integer
) = STATE_HALF_VECTOR
;
3442 /* Line 1455 of yacc.c */
3443 #line 1208 "program_parse.y"
3445 (yyval
.integer
) = STATE_SPOT_DIRECTION
;
3451 /* Line 1455 of yacc.c */
3452 #line 1214 "program_parse.y"
3454 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].state
)[0];
3455 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].state
)[1];
3461 /* Line 1455 of yacc.c */
3462 #line 1221 "program_parse.y"
3464 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3465 (yyval
.state
)[0] = STATE_LIGHTMODEL_AMBIENT
;
3471 /* Line 1455 of yacc.c */
3472 #line 1226 "program_parse.y"
3474 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3475 (yyval
.state
)[0] = STATE_LIGHTMODEL_SCENECOLOR
;
3476 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].integer
);
3482 /* Line 1455 of yacc.c */
3483 #line 1234 "program_parse.y"
3485 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3486 (yyval
.state
)[0] = STATE_LIGHTPROD
;
3487 (yyval
.state
)[1] = (yyvsp
[(3) - (6)].integer
);
3488 (yyval
.state
)[2] = (yyvsp
[(5) - (6)].integer
);
3489 (yyval
.state
)[3] = (yyvsp
[(6) - (6)].integer
);
3495 /* Line 1455 of yacc.c */
3496 #line 1246 "program_parse.y"
3498 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3499 (yyval
.state
)[0] = (yyvsp
[(3) - (3)].integer
);
3500 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].integer
);
3506 /* Line 1455 of yacc.c */
3507 #line 1254 "program_parse.y"
3509 (yyval
.integer
) = STATE_TEXENV_COLOR
;
3515 /* Line 1455 of yacc.c */
3516 #line 1260 "program_parse.y"
3518 (yyval
.integer
) = STATE_AMBIENT
;
3524 /* Line 1455 of yacc.c */
3525 #line 1264 "program_parse.y"
3527 (yyval
.integer
) = STATE_DIFFUSE
;
3533 /* Line 1455 of yacc.c */
3534 #line 1268 "program_parse.y"
3536 (yyval
.integer
) = STATE_SPECULAR
;
3542 /* Line 1455 of yacc.c */
3543 #line 1274 "program_parse.y"
3545 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxLights
) {
3546 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid light selector");
3550 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3556 /* Line 1455 of yacc.c */
3557 #line 1285 "program_parse.y"
3559 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3560 (yyval
.state
)[0] = STATE_TEXGEN
;
3561 (yyval
.state
)[1] = (yyvsp
[(2) - (4)].integer
);
3562 (yyval
.state
)[2] = (yyvsp
[(3) - (4)].integer
) + (yyvsp
[(4) - (4)].integer
);
3568 /* Line 1455 of yacc.c */
3569 #line 1294 "program_parse.y"
3571 (yyval
.integer
) = STATE_TEXGEN_EYE_S
;
3577 /* Line 1455 of yacc.c */
3578 #line 1298 "program_parse.y"
3580 (yyval
.integer
) = STATE_TEXGEN_OBJECT_S
;
3586 /* Line 1455 of yacc.c */
3587 #line 1303 "program_parse.y"
3589 (yyval
.integer
) = STATE_TEXGEN_EYE_S
- STATE_TEXGEN_EYE_S
;
3595 /* Line 1455 of yacc.c */
3596 #line 1307 "program_parse.y"
3598 (yyval
.integer
) = STATE_TEXGEN_EYE_T
- STATE_TEXGEN_EYE_S
;
3604 /* Line 1455 of yacc.c */
3605 #line 1311 "program_parse.y"
3607 (yyval
.integer
) = STATE_TEXGEN_EYE_R
- STATE_TEXGEN_EYE_S
;
3613 /* Line 1455 of yacc.c */
3614 #line 1315 "program_parse.y"
3616 (yyval
.integer
) = STATE_TEXGEN_EYE_Q
- STATE_TEXGEN_EYE_S
;
3622 /* Line 1455 of yacc.c */
3623 #line 1321 "program_parse.y"
3625 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3626 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3632 /* Line 1455 of yacc.c */
3633 #line 1328 "program_parse.y"
3635 (yyval
.integer
) = STATE_FOG_COLOR
;
3641 /* Line 1455 of yacc.c */
3642 #line 1332 "program_parse.y"
3644 (yyval
.integer
) = STATE_FOG_PARAMS
;
3650 /* Line 1455 of yacc.c */
3651 #line 1338 "program_parse.y"
3653 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3654 (yyval
.state
)[0] = STATE_CLIPPLANE
;
3655 (yyval
.state
)[1] = (yyvsp
[(3) - (5)].integer
);
3661 /* Line 1455 of yacc.c */
3662 #line 1346 "program_parse.y"
3664 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxClipPlanes
) {
3665 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid clip plane selector");
3669 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3675 /* Line 1455 of yacc.c */
3676 #line 1357 "program_parse.y"
3678 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3679 (yyval
.state
)[0] = (yyvsp
[(2) - (2)].integer
);
3685 /* Line 1455 of yacc.c */
3686 #line 1364 "program_parse.y"
3688 (yyval
.integer
) = STATE_POINT_SIZE
;
3694 /* Line 1455 of yacc.c */
3695 #line 1368 "program_parse.y"
3697 (yyval
.integer
) = STATE_POINT_ATTENUATION
;
3703 /* Line 1455 of yacc.c */
3704 #line 1374 "program_parse.y"
3706 (yyval
.state
)[0] = (yyvsp
[(1) - (5)].state
)[0];
3707 (yyval
.state
)[1] = (yyvsp
[(1) - (5)].state
)[1];
3708 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
3709 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
3710 (yyval
.state
)[4] = (yyvsp
[(1) - (5)].state
)[2];
3716 /* Line 1455 of yacc.c */
3717 #line 1384 "program_parse.y"
3719 (yyval
.state
)[0] = (yyvsp
[(1) - (2)].state
)[0];
3720 (yyval
.state
)[1] = (yyvsp
[(1) - (2)].state
)[1];
3721 (yyval
.state
)[2] = (yyvsp
[(2) - (2)].state
)[2];
3722 (yyval
.state
)[3] = (yyvsp
[(2) - (2)].state
)[3];
3723 (yyval
.state
)[4] = (yyvsp
[(1) - (2)].state
)[2];
3729 /* Line 1455 of yacc.c */
3730 #line 1394 "program_parse.y"
3732 (yyval
.state
)[2] = 0;
3733 (yyval
.state
)[3] = 3;
3739 /* Line 1455 of yacc.c */
3740 #line 1399 "program_parse.y"
3742 /* It seems logical that the matrix row range specifier would have
3743 * to specify a range or more than one row (i.e., $5 > $3).
3744 * However, the ARB_vertex_program spec says "a program will fail
3745 * to load if <a> is greater than <b>." This means that $3 == $5
3748 if ((yyvsp
[(3) - (6)].integer
) > (yyvsp
[(5) - (6)].integer
)) {
3749 yyerror(& (yylsp
[(3) - (6)]), state
, "invalid matrix row range");
3753 (yyval
.state
)[2] = (yyvsp
[(3) - (6)].integer
);
3754 (yyval
.state
)[3] = (yyvsp
[(5) - (6)].integer
);
3760 /* Line 1455 of yacc.c */
3761 #line 1417 "program_parse.y"
3763 (yyval
.state
)[0] = (yyvsp
[(2) - (3)].state
)[0];
3764 (yyval
.state
)[1] = (yyvsp
[(2) - (3)].state
)[1];
3765 (yyval
.state
)[2] = (yyvsp
[(3) - (3)].integer
);
3771 /* Line 1455 of yacc.c */
3772 #line 1425 "program_parse.y"
3774 (yyval
.integer
) = 0;
3780 /* Line 1455 of yacc.c */
3781 #line 1429 "program_parse.y"
3783 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3789 /* Line 1455 of yacc.c */
3790 #line 1435 "program_parse.y"
3792 (yyval
.integer
) = STATE_MATRIX_INVERSE
;
3798 /* Line 1455 of yacc.c */
3799 #line 1439 "program_parse.y"
3801 (yyval
.integer
) = STATE_MATRIX_TRANSPOSE
;
3807 /* Line 1455 of yacc.c */
3808 #line 1443 "program_parse.y"
3810 (yyval
.integer
) = STATE_MATRIX_INVTRANS
;
3816 /* Line 1455 of yacc.c */
3817 #line 1449 "program_parse.y"
3819 if ((yyvsp
[(1) - (1)].integer
) > 3) {
3820 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid matrix row reference");
3824 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3830 /* Line 1455 of yacc.c */
3831 #line 1460 "program_parse.y"
3833 (yyval
.state
)[0] = STATE_MODELVIEW_MATRIX
;
3834 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3840 /* Line 1455 of yacc.c */
3841 #line 1465 "program_parse.y"
3843 (yyval
.state
)[0] = STATE_PROJECTION_MATRIX
;
3844 (yyval
.state
)[1] = 0;
3850 /* Line 1455 of yacc.c */
3851 #line 1470 "program_parse.y"
3853 (yyval
.state
)[0] = STATE_MVP_MATRIX
;
3854 (yyval
.state
)[1] = 0;
3860 /* Line 1455 of yacc.c */
3861 #line 1475 "program_parse.y"
3863 (yyval
.state
)[0] = STATE_TEXTURE_MATRIX
;
3864 (yyval
.state
)[1] = (yyvsp
[(2) - (2)].integer
);
3870 /* Line 1455 of yacc.c */
3871 #line 1480 "program_parse.y"
3873 yyerror(& (yylsp
[(1) - (4)]), state
, "GL_ARB_matrix_palette not supported");
3880 /* Line 1455 of yacc.c */
3881 #line 1485 "program_parse.y"
3883 (yyval
.state
)[0] = STATE_PROGRAM_MATRIX
;
3884 (yyval
.state
)[1] = (yyvsp
[(3) - (4)].integer
);
3890 /* Line 1455 of yacc.c */
3891 #line 1492 "program_parse.y"
3893 (yyval
.integer
) = 0;
3899 /* Line 1455 of yacc.c */
3900 #line 1496 "program_parse.y"
3902 (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
);
3908 /* Line 1455 of yacc.c */
3909 #line 1501 "program_parse.y"
3911 /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix
3914 if ((yyvsp
[(1) - (1)].integer
) != 0) {
3915 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid modelview matrix index");
3919 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3925 /* Line 1455 of yacc.c */
3926 #line 1514 "program_parse.y"
3928 /* Since GL_ARB_matrix_palette isn't supported, just let any value
3929 * through here. The error will be generated later.
3931 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3937 /* Line 1455 of yacc.c */
3938 #line 1522 "program_parse.y"
3940 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxProgramMatrices
) {
3941 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program matrix selector");
3945 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
3951 /* Line 1455 of yacc.c */
3952 #line 1533 "program_parse.y"
3954 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3955 (yyval
.state
)[0] = STATE_DEPTH_RANGE
;
3961 /* Line 1455 of yacc.c */
3962 #line 1545 "program_parse.y"
3964 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3965 (yyval
.state
)[0] = state
->state_param_enum
;
3966 (yyval
.state
)[1] = STATE_ENV
;
3967 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
3968 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
3974 /* Line 1455 of yacc.c */
3975 #line 1555 "program_parse.y"
3977 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
3978 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
3984 /* Line 1455 of yacc.c */
3985 #line 1560 "program_parse.y"
3987 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
3988 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
3994 /* Line 1455 of yacc.c */
3995 #line 1567 "program_parse.y"
3997 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
3998 (yyval
.state
)[0] = state
->state_param_enum
;
3999 (yyval
.state
)[1] = STATE_ENV
;
4000 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4001 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4007 /* Line 1455 of yacc.c */
4008 #line 1577 "program_parse.y"
4010 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4011 (yyval
.state
)[0] = state
->state_param_enum
;
4012 (yyval
.state
)[1] = STATE_LOCAL
;
4013 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].state
)[0];
4014 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].state
)[1];
4020 /* Line 1455 of yacc.c */
4021 #line 1586 "program_parse.y"
4023 (yyval
.state
)[0] = (yyvsp
[(1) - (1)].integer
);
4024 (yyval
.state
)[1] = (yyvsp
[(1) - (1)].integer
);
4030 /* Line 1455 of yacc.c */
4031 #line 1591 "program_parse.y"
4033 (yyval
.state
)[0] = (yyvsp
[(1) - (3)].integer
);
4034 (yyval
.state
)[1] = (yyvsp
[(3) - (3)].integer
);
4040 /* Line 1455 of yacc.c */
4041 #line 1598 "program_parse.y"
4043 memset((yyval
.state
), 0, sizeof((yyval
.state
)));
4044 (yyval
.state
)[0] = state
->state_param_enum
;
4045 (yyval
.state
)[1] = STATE_LOCAL
;
4046 (yyval
.state
)[2] = (yyvsp
[(4) - (5)].integer
);
4047 (yyval
.state
)[3] = (yyvsp
[(4) - (5)].integer
);
4053 /* Line 1455 of yacc.c */
4054 #line 1608 "program_parse.y"
4056 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxEnvParams
) {
4057 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid environment parameter reference");
4060 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4066 /* Line 1455 of yacc.c */
4067 #line 1618 "program_parse.y"
4069 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->limits
->MaxLocalParams
) {
4070 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid local parameter reference");
4073 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4079 /* Line 1455 of yacc.c */
4080 #line 1633 "program_parse.y"
4082 (yyval
.vector
).count
= 4;
4083 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4084 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4085 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4086 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4092 /* Line 1455 of yacc.c */
4093 #line 1643 "program_parse.y"
4095 (yyval
.vector
).count
= 1;
4096 (yyval
.vector
).data
[0] = (yyvsp
[(1) - (1)].real
);
4097 (yyval
.vector
).data
[1] = (yyvsp
[(1) - (1)].real
);
4098 (yyval
.vector
).data
[2] = (yyvsp
[(1) - (1)].real
);
4099 (yyval
.vector
).data
[3] = (yyvsp
[(1) - (1)].real
);
4105 /* Line 1455 of yacc.c */
4106 #line 1651 "program_parse.y"
4108 (yyval
.vector
).count
= 1;
4109 (yyval
.vector
).data
[0] = (float) (yyvsp
[(1) - (1)].integer
);
4110 (yyval
.vector
).data
[1] = (float) (yyvsp
[(1) - (1)].integer
);
4111 (yyval
.vector
).data
[2] = (float) (yyvsp
[(1) - (1)].integer
);
4112 (yyval
.vector
).data
[3] = (float) (yyvsp
[(1) - (1)].integer
);
4118 /* Line 1455 of yacc.c */
4119 #line 1661 "program_parse.y"
4121 (yyval
.vector
).count
= 4;
4122 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (3)].real
);
4123 (yyval
.vector
).data
[1] = 0.0f
;
4124 (yyval
.vector
).data
[2] = 0.0f
;
4125 (yyval
.vector
).data
[3] = 1.0f
;
4131 /* Line 1455 of yacc.c */
4132 #line 1669 "program_parse.y"
4134 (yyval
.vector
).count
= 4;
4135 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (5)].real
);
4136 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (5)].real
);
4137 (yyval
.vector
).data
[2] = 0.0f
;
4138 (yyval
.vector
).data
[3] = 1.0f
;
4144 /* Line 1455 of yacc.c */
4145 #line 1678 "program_parse.y"
4147 (yyval
.vector
).count
= 4;
4148 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (7)].real
);
4149 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (7)].real
);
4150 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (7)].real
);
4151 (yyval
.vector
).data
[3] = 1.0f
;
4157 /* Line 1455 of yacc.c */
4158 #line 1687 "program_parse.y"
4160 (yyval
.vector
).count
= 4;
4161 (yyval
.vector
).data
[0] = (yyvsp
[(2) - (9)].real
);
4162 (yyval
.vector
).data
[1] = (yyvsp
[(4) - (9)].real
);
4163 (yyval
.vector
).data
[2] = (yyvsp
[(6) - (9)].real
);
4164 (yyval
.vector
).data
[3] = (yyvsp
[(8) - (9)].real
);
4170 /* Line 1455 of yacc.c */
4171 #line 1697 "program_parse.y"
4173 (yyval
.real
) = ((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].real
) : (yyvsp
[(2) - (2)].real
);
4179 /* Line 1455 of yacc.c */
4180 #line 1701 "program_parse.y"
4182 (yyval
.real
) = (float)(((yyvsp
[(1) - (2)].negate
)) ? -(yyvsp
[(2) - (2)].integer
) : (yyvsp
[(2) - (2)].integer
));
4188 /* Line 1455 of yacc.c */
4189 #line 1706 "program_parse.y"
4190 { (yyval
.negate
) = FALSE
; ;}
4195 /* Line 1455 of yacc.c */
4196 #line 1707 "program_parse.y"
4197 { (yyval
.negate
) = TRUE
; ;}
4202 /* Line 1455 of yacc.c */
4203 #line 1708 "program_parse.y"
4204 { (yyval
.negate
) = FALSE
; ;}
4209 /* Line 1455 of yacc.c */
4210 #line 1711 "program_parse.y"
4211 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4216 /* Line 1455 of yacc.c */
4217 #line 1714 "program_parse.y"
4218 { (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
); ;}
4223 /* Line 1455 of yacc.c */
4224 #line 1718 "program_parse.y"
4226 if (!declare_variable(state
, (yyvsp
[(3) - (3)].string
), (yyvsp
[(0) - (3)].integer
), & (yylsp
[(3) - (3)]))) {
4234 /* Line 1455 of yacc.c */
4235 #line 1724 "program_parse.y"
4237 if (!declare_variable(state
, (yyvsp
[(1) - (1)].string
), (yyvsp
[(0) - (1)].integer
), & (yylsp
[(1) - (1)]))) {
4245 /* Line 1455 of yacc.c */
4246 #line 1732 "program_parse.y"
4248 struct asm_symbol
*const s
=
4249 declare_variable(state
, (yyvsp
[(2) - (4)].string
), at_output
, & (yylsp
[(2) - (4)]));
4254 s
->output_binding
= (yyvsp
[(4) - (4)].result
);
4261 /* Line 1455 of yacc.c */
4262 #line 1745 "program_parse.y"
4264 if (state
->mode
== ARB_vertex
) {
4265 (yyval
.result
) = VERT_RESULT_HPOS
;
4267 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4275 /* Line 1455 of yacc.c */
4276 #line 1754 "program_parse.y"
4278 if (state
->mode
== ARB_vertex
) {
4279 (yyval
.result
) = VERT_RESULT_FOGC
;
4281 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4289 /* Line 1455 of yacc.c */
4290 #line 1763 "program_parse.y"
4292 (yyval
.result
) = (yyvsp
[(2) - (2)].result
);
4298 /* Line 1455 of yacc.c */
4299 #line 1767 "program_parse.y"
4301 if (state
->mode
== ARB_vertex
) {
4302 (yyval
.result
) = VERT_RESULT_PSIZ
;
4304 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4312 /* Line 1455 of yacc.c */
4313 #line 1776 "program_parse.y"
4315 if (state
->mode
== ARB_vertex
) {
4316 (yyval
.result
) = VERT_RESULT_TEX0
+ (yyvsp
[(3) - (3)].integer
);
4318 yyerror(& (yylsp
[(2) - (3)]), state
, "invalid program result name");
4326 /* Line 1455 of yacc.c */
4327 #line 1785 "program_parse.y"
4329 if (state
->mode
== ARB_fragment
) {
4330 (yyval
.result
) = FRAG_RESULT_DEPTH
;
4332 yyerror(& (yylsp
[(2) - (2)]), state
, "invalid program result name");
4340 /* Line 1455 of yacc.c */
4341 #line 1796 "program_parse.y"
4343 (yyval
.result
) = (yyvsp
[(2) - (3)].integer
) + (yyvsp
[(3) - (3)].integer
);
4349 /* Line 1455 of yacc.c */
4350 #line 1802 "program_parse.y"
4352 (yyval
.integer
) = (state
->mode
== ARB_vertex
)
4354 : FRAG_RESULT_COLOR
;
4360 /* Line 1455 of yacc.c */
4361 #line 1808 "program_parse.y"
4363 if (state
->mode
== ARB_vertex
) {
4364 (yyval
.integer
) = VERT_RESULT_COL0
;
4366 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4374 /* Line 1455 of yacc.c */
4375 #line 1817 "program_parse.y"
4377 if (state
->mode
== ARB_vertex
) {
4378 (yyval
.integer
) = VERT_RESULT_BFC0
;
4380 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4388 /* Line 1455 of yacc.c */
4389 #line 1828 "program_parse.y"
4391 (yyval
.integer
) = 0;
4397 /* Line 1455 of yacc.c */
4398 #line 1832 "program_parse.y"
4400 if (state
->mode
== ARB_vertex
) {
4401 (yyval
.integer
) = 0;
4403 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4411 /* Line 1455 of yacc.c */
4412 #line 1841 "program_parse.y"
4414 if (state
->mode
== ARB_vertex
) {
4415 (yyval
.integer
) = 1;
4417 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid program result name");
4425 /* Line 1455 of yacc.c */
4426 #line 1851 "program_parse.y"
4427 { (yyval
.integer
) = 0; ;}
4432 /* Line 1455 of yacc.c */
4433 #line 1852 "program_parse.y"
4434 { (yyval
.integer
) = 0; ;}
4439 /* Line 1455 of yacc.c */
4440 #line 1853 "program_parse.y"
4441 { (yyval
.integer
) = 1; ;}
4446 /* Line 1455 of yacc.c */
4447 #line 1856 "program_parse.y"
4448 { (yyval
.integer
) = 0; ;}
4453 /* Line 1455 of yacc.c */
4454 #line 1857 "program_parse.y"
4455 { (yyval
.integer
) = 0; ;}
4460 /* Line 1455 of yacc.c */
4461 #line 1858 "program_parse.y"
4462 { (yyval
.integer
) = 1; ;}
4467 /* Line 1455 of yacc.c */
4468 #line 1861 "program_parse.y"
4469 { (yyval
.integer
) = 0; ;}
4474 /* Line 1455 of yacc.c */
4475 #line 1862 "program_parse.y"
4476 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4481 /* Line 1455 of yacc.c */
4482 #line 1865 "program_parse.y"
4483 { (yyval
.integer
) = 0; ;}
4488 /* Line 1455 of yacc.c */
4489 #line 1866 "program_parse.y"
4490 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4495 /* Line 1455 of yacc.c */
4496 #line 1869 "program_parse.y"
4497 { (yyval
.integer
) = 0; ;}
4502 /* Line 1455 of yacc.c */
4503 #line 1870 "program_parse.y"
4504 { (yyval
.integer
) = (yyvsp
[(2) - (3)].integer
); ;}
4509 /* Line 1455 of yacc.c */
4510 #line 1874 "program_parse.y"
4512 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureCoordUnits
) {
4513 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture coordinate unit selector");
4517 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4523 /* Line 1455 of yacc.c */
4524 #line 1885 "program_parse.y"
4526 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureImageUnits
) {
4527 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture image unit selector");
4531 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4537 /* Line 1455 of yacc.c */
4538 #line 1896 "program_parse.y"
4540 if ((unsigned) (yyvsp
[(1) - (1)].integer
) >= state
->MaxTextureUnits
) {
4541 yyerror(& (yylsp
[(1) - (1)]), state
, "invalid texture unit selector");
4545 (yyval
.integer
) = (yyvsp
[(1) - (1)].integer
);
4551 /* Line 1455 of yacc.c */
4552 #line 1907 "program_parse.y"
4554 struct asm_symbol
*exist
= (struct asm_symbol
*)
4555 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
));
4556 struct asm_symbol
*target
= (struct asm_symbol
*)
4557 _mesa_symbol_table_find_symbol(state
->st
, 0, (yyvsp
[(4) - (4)].string
));
4560 if (exist
!= NULL
) {
4561 yyerror(& (yylsp
[(2) - (4)]), state
, "redeclared identifier");
4563 } else if (target
== NULL
) {
4564 yyerror(& (yylsp
[(4) - (4)]), state
,
4565 "undefined variable binding in ALIAS statement");
4568 _mesa_symbol_table_add_symbol(state
->st
, 0, (yyvsp
[(2) - (4)].string
), target
);
4575 /* Line 1455 of yacc.c */
4576 #line 4577 "program_parse.tab.c"
4579 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4583 YY_STACK_PRINT (yyss
, yyssp
);
4588 /* Now `shift' the result of the reduction. Determine what state
4589 that goes to, based on the state we popped back to and the rule
4590 number reduced by. */
4594 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4595 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4596 yystate
= yytable
[yystate
];
4598 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4603 /*------------------------------------.
4604 | yyerrlab -- here on detecting error |
4605 `------------------------------------*/
4607 /* If not already recovering from an error, report this error. */
4611 #if ! YYERROR_VERBOSE
4612 yyerror (&yylloc
, state
, YY_("syntax error"));
4615 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
4616 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
4618 YYSIZE_T yyalloc
= 2 * yysize
;
4619 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
4620 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
4621 if (yymsg
!= yymsgbuf
)
4622 YYSTACK_FREE (yymsg
);
4623 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
4625 yymsg_alloc
= yyalloc
;
4629 yymsg_alloc
= sizeof yymsgbuf
;
4633 if (0 < yysize
&& yysize
<= yymsg_alloc
)
4635 (void) yysyntax_error (yymsg
, yystate
, yychar
);
4636 yyerror (&yylloc
, state
, yymsg
);
4640 yyerror (&yylloc
, state
, YY_("syntax error"));
4642 goto yyexhaustedlab
;
4648 yyerror_range
[0] = yylloc
;
4650 if (yyerrstatus
== 3)
4652 /* If just tried and failed to reuse lookahead token after an
4653 error, discard it. */
4655 if (yychar
<= YYEOF
)
4657 /* Return failure if at end of input. */
4658 if (yychar
== YYEOF
)
4663 yydestruct ("Error: discarding",
4664 yytoken
, &yylval
, &yylloc
, state
);
4669 /* Else will try to reuse lookahead token after shifting the error
4674 /*---------------------------------------------------.
4675 | yyerrorlab -- error raised explicitly by YYERROR. |
4676 `---------------------------------------------------*/
4679 /* Pacify compilers like GCC when the user code never invokes
4680 YYERROR and the label yyerrorlab therefore never appears in user
4682 if (/*CONSTCOND*/ 0)
4685 yyerror_range
[0] = yylsp
[1-yylen
];
4686 /* Do not reclaim the symbols of the rule which action triggered
4690 YY_STACK_PRINT (yyss
, yyssp
);
4695 /*-------------------------------------------------------------.
4696 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4697 `-------------------------------------------------------------*/
4699 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4703 yyn
= yypact
[yystate
];
4704 if (yyn
!= YYPACT_NINF
)
4707 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4715 /* Pop the current state because it cannot handle the error token. */
4719 yyerror_range
[0] = *yylsp
;
4720 yydestruct ("Error: popping",
4721 yystos
[yystate
], yyvsp
, yylsp
, state
);
4724 YY_STACK_PRINT (yyss
, yyssp
);
4729 yyerror_range
[1] = yylloc
;
4730 /* Using YYLLOC is tempting, but would change the location of
4731 the lookahead. YYLOC is available though. */
4732 YYLLOC_DEFAULT (yyloc
, (yyerror_range
- 1), 2);
4735 /* Shift the error token. */
4736 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4742 /*-------------------------------------.
4743 | yyacceptlab -- YYACCEPT comes here. |
4744 `-------------------------------------*/
4749 /*-----------------------------------.
4750 | yyabortlab -- YYABORT comes here. |
4751 `-----------------------------------*/
4756 #if !defined(yyoverflow) || YYERROR_VERBOSE
4757 /*-------------------------------------------------.
4758 | yyexhaustedlab -- memory exhaustion comes here. |
4759 `-------------------------------------------------*/
4761 yyerror (&yylloc
, state
, YY_("memory exhausted"));
4767 if (yychar
!= YYEMPTY
)
4768 yydestruct ("Cleanup: discarding lookahead",
4769 yytoken
, &yylval
, &yylloc
, state
);
4770 /* Do not reclaim the symbols of the rule which action triggered
4771 this YYABORT or YYACCEPT. */
4773 YY_STACK_PRINT (yyss
, yyssp
);
4774 while (yyssp
!= yyss
)
4776 yydestruct ("Cleanup: popping",
4777 yystos
[*yyssp
], yyvsp
, yylsp
, state
);
4782 YYSTACK_FREE (yyss
);
4785 if (yymsg
!= yymsgbuf
)
4786 YYSTACK_FREE (yymsg
);
4788 /* Make sure YYID is used. */
4789 return YYID (yyresult
);
4794 /* Line 1675 of yacc.c */
4795 #line 1927 "program_parse.y"
4798 struct asm_instruction
*
4799 asm_instruction_ctor(gl_inst_opcode op
,
4800 const struct prog_dst_register
*dst
,
4801 const struct asm_src_register
*src0
,
4802 const struct asm_src_register
*src1
,
4803 const struct asm_src_register
*src2
)
4805 struct asm_instruction
*inst
= calloc(1, sizeof(struct asm_instruction
));
4808 _mesa_init_instructions(& inst
->Base
, 1);
4809 inst
->Base
.Opcode
= op
;
4811 /* In the core ARB extensions only the KIL instruction doesn't have a
4812 * destination register.
4815 init_dst_reg(& inst
->Base
.DstReg
);
4817 inst
->Base
.DstReg
= *dst
;
4820 inst
->Base
.SrcReg
[0] = src0
->Base
;
4821 inst
->SrcReg
[0] = *src0
;
4824 inst
->Base
.SrcReg
[1] = src1
->Base
;
4825 inst
->SrcReg
[1] = *src1
;
4827 init_src_reg(& inst
->SrcReg
[1]);
4831 inst
->Base
.SrcReg
[2] = src2
->Base
;
4832 inst
->SrcReg
[2] = *src2
;
4834 init_src_reg(& inst
->SrcReg
[2]);
4843 init_dst_reg(struct prog_dst_register
*r
)
4845 memset(r
, 0, sizeof(*r
));
4846 r
->File
= PROGRAM_UNDEFINED
;
4847 r
->WriteMask
= WRITEMASK_XYZW
;
4848 r
->CondMask
= COND_TR
;
4849 r
->CondSwizzle
= SWIZZLE_NOOP
;
4854 init_src_reg(struct asm_src_register
*r
)
4856 memset(r
, 0, sizeof(*r
));
4857 r
->Base
.File
= PROGRAM_UNDEFINED
;
4858 r
->Base
.Swizzle
= SWIZZLE_NOOP
;
4864 * Validate the set of inputs used by a program
4866 * Validates that legal sets of inputs are used by the program. In this case
4867 * "used" included both reading the input or binding the input to a name using
4868 * the \c ATTRIB command.
4871 * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise.
4874 validate_inputs(struct YYLTYPE
*locp
, struct asm_parser_state
*state
)
4876 const int inputs
= state
->prog
->InputsRead
| state
->InputsBound
;
4878 if (((inputs
& 0x0ffff) & (inputs
>> 16)) != 0) {
4879 yyerror(locp
, state
, "illegal use of generic attribute and name attribute");
4888 declare_variable(struct asm_parser_state
*state
, char *name
, enum asm_type t
,
4889 struct YYLTYPE
*locp
)
4891 struct asm_symbol
*s
= NULL
;
4892 struct asm_symbol
*exist
= (struct asm_symbol
*)
4893 _mesa_symbol_table_find_symbol(state
->st
, 0, name
);
4896 if (exist
!= NULL
) {
4897 yyerror(locp
, state
, "redeclared identifier");
4899 s
= calloc(1, sizeof(struct asm_symbol
));
4905 if (state
->prog
->NumTemporaries
>= state
->limits
->MaxTemps
) {
4906 yyerror(locp
, state
, "too many temporaries declared");
4911 s
->temp_binding
= state
->prog
->NumTemporaries
;
4912 state
->prog
->NumTemporaries
++;
4916 if (state
->prog
->NumAddressRegs
>= state
->limits
->MaxAddressRegs
) {
4917 yyerror(locp
, state
, "too many address registers declared");
4922 /* FINISHME: Add support for multiple address registers.
4924 state
->prog
->NumAddressRegs
++;
4931 _mesa_symbol_table_add_symbol(state
->st
, 0, s
->name
, s
);
4932 s
->next
= state
->sym
;
4940 int add_state_reference(struct gl_program_parameter_list
*param_list
,
4941 const gl_state_index tokens
[STATE_LENGTH
])
4943 const GLuint size
= 4; /* XXX fix */
4947 name
= _mesa_program_state_string(tokens
);
4948 index
= _mesa_add_parameter(param_list
, PROGRAM_STATE_VAR
, name
,
4950 NULL
, (gl_state_index
*) tokens
, 0x0);
4951 param_list
->StateFlags
|= _mesa_program_state_flags(tokens
);
4953 /* free name string here since we duplicated it in add_parameter() */
4961 initialize_symbol_from_state(struct gl_program
*prog
,
4962 struct asm_symbol
*param_var
,
4963 const gl_state_index tokens
[STATE_LENGTH
])
4966 gl_state_index state_tokens
[STATE_LENGTH
];
4969 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
4971 param_var
->type
= at_param
;
4972 param_var
->param_binding_type
= PROGRAM_STATE_VAR
;
4974 /* If we are adding a STATE_MATRIX that has multiple rows, we need to
4975 * unroll it and call add_state_reference() for each row
4977 if ((state_tokens
[0] == STATE_MODELVIEW_MATRIX
||
4978 state_tokens
[0] == STATE_PROJECTION_MATRIX
||
4979 state_tokens
[0] == STATE_MVP_MATRIX
||
4980 state_tokens
[0] == STATE_TEXTURE_MATRIX
||
4981 state_tokens
[0] == STATE_PROGRAM_MATRIX
)
4982 && (state_tokens
[2] != state_tokens
[3])) {
4984 const int first_row
= state_tokens
[2];
4985 const int last_row
= state_tokens
[3];
4987 for (row
= first_row
; row
<= last_row
; row
++) {
4988 state_tokens
[2] = state_tokens
[3] = row
;
4990 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4991 if (param_var
->param_binding_begin
== ~0U)
4992 param_var
->param_binding_begin
= idx
;
4993 param_var
->param_binding_length
++;
4997 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
4998 if (param_var
->param_binding_begin
== ~0U)
4999 param_var
->param_binding_begin
= idx
;
5000 param_var
->param_binding_length
++;
5008 initialize_symbol_from_param(struct gl_program
*prog
,
5009 struct asm_symbol
*param_var
,
5010 const gl_state_index tokens
[STATE_LENGTH
])
5013 gl_state_index state_tokens
[STATE_LENGTH
];
5016 memcpy(state_tokens
, tokens
, sizeof(state_tokens
));
5018 assert((state_tokens
[0] == STATE_VERTEX_PROGRAM
)
5019 || (state_tokens
[0] == STATE_FRAGMENT_PROGRAM
));
5020 assert((state_tokens
[1] == STATE_ENV
)
5021 || (state_tokens
[1] == STATE_LOCAL
));
5023 param_var
->type
= at_param
;
5024 param_var
->param_binding_type
= (state_tokens
[1] == STATE_ENV
)
5025 ? PROGRAM_ENV_PARAM
: PROGRAM_LOCAL_PARAM
;
5027 /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements,
5028 * we need to unroll it and call add_state_reference() for each row
5030 if (state_tokens
[2] != state_tokens
[3]) {
5032 const int first_row
= state_tokens
[2];
5033 const int last_row
= state_tokens
[3];
5035 for (row
= first_row
; row
<= last_row
; row
++) {
5036 state_tokens
[2] = state_tokens
[3] = row
;
5038 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5039 if (param_var
->param_binding_begin
== ~0U)
5040 param_var
->param_binding_begin
= idx
;
5041 param_var
->param_binding_length
++;
5045 idx
= add_state_reference(prog
->Parameters
, state_tokens
);
5046 if (param_var
->param_binding_begin
== ~0U)
5047 param_var
->param_binding_begin
= idx
;
5048 param_var
->param_binding_length
++;
5056 initialize_symbol_from_const(struct gl_program
*prog
,
5057 struct asm_symbol
*param_var
,
5058 const struct asm_vector
*vec
)
5060 const int idx
= _mesa_add_parameter(prog
->Parameters
, PROGRAM_CONSTANT
,
5061 NULL
, vec
->count
, GL_NONE
, vec
->data
,
5064 param_var
->type
= at_param
;
5065 param_var
->param_binding_type
= PROGRAM_CONSTANT
;
5067 if (param_var
->param_binding_begin
== ~0U)
5068 param_var
->param_binding_begin
= idx
;
5069 param_var
->param_binding_length
++;
5076 make_error_string(const char *fmt
, ...)
5082 va_start(args
, fmt
);
5084 /* Call vsnprintf once to determine how large the final string is. Call it
5085 * again to do the actual formatting. from the vsnprintf manual page:
5087 * Upon successful return, these functions return the number of
5088 * characters printed (not including the trailing '\0' used to end
5089 * output to strings).
5091 length
= 1 + vsnprintf(NULL
, 0, fmt
, args
);
5093 str
= _mesa_malloc(length
);
5095 vsnprintf(str
, length
, fmt
, args
);
5105 yyerror(YYLTYPE
*locp
, struct asm_parser_state
*state
, const char *s
)
5110 err_str
= make_error_string("glProgramStringARB(%s)\n", s
);
5112 _mesa_error(state
->ctx
, GL_INVALID_OPERATION
, err_str
);
5113 _mesa_free(err_str
);
5116 err_str
= make_error_string("line %u, char %u: error: %s\n",
5117 locp
->first_line
, locp
->first_column
, s
);
5118 _mesa_set_program_error(state
->ctx
, locp
->position
, err_str
);
5121 _mesa_free(err_str
);
5127 _mesa_parse_arb_program(GLcontext
*ctx
, GLenum target
, const GLubyte
*str
,
5128 GLsizei len
, struct asm_parser_state
*state
)
5130 struct asm_instruction
*inst
;
5133 GLboolean result
= GL_FALSE
;
5135 struct asm_symbol
*sym
;
5138 state
->prog
->Target
= target
;
5139 state
->prog
->Parameters
= _mesa_new_parameter_list();
5141 /* Make a copy of the program string and force it to be NUL-terminated.
5143 strz
= (GLubyte
*) _mesa_malloc(len
+ 1);
5145 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5148 _mesa_memcpy (strz
, str
, len
);
5151 state
->prog
->String
= strz
;
5153 state
->st
= _mesa_symbol_table_ctor();
5155 state
->limits
= (target
== GL_VERTEX_PROGRAM_ARB
)
5156 ? & ctx
->Const
.VertexProgram
5157 : & ctx
->Const
.FragmentProgram
;
5159 state
->MaxTextureImageUnits
= ctx
->Const
.MaxTextureImageUnits
;
5160 state
->MaxTextureCoordUnits
= ctx
->Const
.MaxTextureCoordUnits
;
5161 state
->MaxTextureUnits
= ctx
->Const
.MaxTextureUnits
;
5162 state
->MaxClipPlanes
= ctx
->Const
.MaxClipPlanes
;
5163 state
->MaxLights
= ctx
->Const
.MaxLights
;
5164 state
->MaxProgramMatrices
= ctx
->Const
.MaxProgramMatrices
;
5166 state
->state_param_enum
= (target
== GL_VERTEX_PROGRAM_ARB
)
5167 ? STATE_VERTEX_PROGRAM
: STATE_FRAGMENT_PROGRAM
;
5169 _mesa_set_program_error(ctx
, -1, NULL
);
5171 _mesa_program_lexer_ctor(& state
->scanner
, state
, (const char *) str
, len
);
5173 _mesa_program_lexer_dtor(state
->scanner
);
5176 if (ctx
->Program
.ErrorPos
!= -1) {
5180 if (! _mesa_layout_parameters(state
)) {
5184 loc
.first_column
= 0;
5187 yyerror(& loc
, state
, "invalid PARAM usage");
5193 /* Add one instruction to store the "END" instruction.
5195 state
->prog
->Instructions
=
5196 _mesa_alloc_instructions(state
->prog
->NumInstructions
+ 1);
5197 inst
= state
->inst_head
;
5198 for (i
= 0; i
< state
->prog
->NumInstructions
; i
++) {
5199 struct asm_instruction
*const temp
= inst
->next
;
5201 state
->prog
->Instructions
[i
] = inst
->Base
;
5205 /* Finally, tag on an OPCODE_END instruction */
5207 const GLuint numInst
= state
->prog
->NumInstructions
;
5208 _mesa_init_instructions(state
->prog
->Instructions
+ numInst
, 1);
5209 state
->prog
->Instructions
[numInst
].Opcode
= OPCODE_END
;
5211 state
->prog
->NumInstructions
++;
5213 state
->prog
->NumParameters
= state
->prog
->Parameters
->NumParameters
;
5214 state
->prog
->NumAttributes
= _mesa_bitcount(state
->prog
->InputsRead
);
5217 * Initialize native counts to logical counts. The device driver may
5218 * change them if program is translated into a hardware program.
5220 state
->prog
->NumNativeInstructions
= state
->prog
->NumInstructions
;
5221 state
->prog
->NumNativeTemporaries
= state
->prog
->NumTemporaries
;
5222 state
->prog
->NumNativeParameters
= state
->prog
->NumParameters
;
5223 state
->prog
->NumNativeAttributes
= state
->prog
->NumAttributes
;
5224 state
->prog
->NumNativeAddressRegs
= state
->prog
->NumAddressRegs
;
5229 for (inst
= state
->inst_head
; inst
!= NULL
; inst
= temp
) {
5234 state
->inst_head
= NULL
;
5235 state
->inst_tail
= NULL
;
5237 for (sym
= state
->sym
; sym
!= NULL
; sym
= temp
) {
5240 _mesa_free((void *) sym
->name
);
5245 _mesa_symbol_table_dtor(state
->st
);