/* A Bison parser, made by GNU Bison 1.875d. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* If NAME_PREFIX is specified substitute the variables and functions names. */ #define yyparse slparse #define yylex sllex #define yyerror slerror #define yylval sllval #define yychar slchar #define yydebug sldebug #define yynerrs slnerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { SL_SURFACE = 258, SL_DISPLACEMENT = 259, SL_LIGHT = 260, SL_VOLUME = 261, SL_TRANSFORMATION = 262, SL_IMAGER = 263, SL_FOR = 264, SL_WHILE = 265, SL_IF = 266, SL_GATHER = 267, SL_ELSE = 268, SL_BREAK = 269, SL_CONTINUE = 270, SL_ILLUMINANCE = 271, SL_ILLUMINATE = 272, SL_SOLAR = 273, SL_RETURN = 274, SL_VOID = 275, SL_FCN_PI = 276, SL_IDENTIFIER_VALUE = 277, SL_FLOAT_VALUE = 278, SL_COMMA = 279, SL_SEMI_COLON = 280, SL_OPEN_PARANTHESIS = 281, SL_CLOSE_PARANTHESIS = 282, SL_OPEN_CRL_PARANTHESIS = 283, SL_CLOSE_CRL_PARANTHESIS = 284, SL_OPEN_SQR_PARANTHESIS = 285, SL_CLOSE_SQR_PARANTHESIS = 286, SL_TEXTURE = 287, SL_SHADOW = 288, SL_ENVIRONMENT = 289, SL_BUMP = 290, SL_TEXT_VALUE = 291, SL_COLON = 292, SL_QUESTION = 293, SL_STRING = 294, SL_MATRIX = 295, SL_NORMAL = 296, SL_VECTOR = 297, SL_POINT = 298, SL_COLOR = 299, SL_FLOAT = 300, SL_COMP_DIFFERENT = 301, SL_COMP_EQUAL = 302, SL_COMP_LESS_EQUAL = 303, SL_COMP_LESS = 304, SL_COMP_GREATER_EQUAL = 305, SL_COMP_GREATER = 306, SL_EQUAL = 307, SL_DECREMENT_BY = 308, SL_INCREMENT_BY = 309, SL_DECREMENT = 310, SL_INCREMENT = 311, SL_DIVIDE_BY = 312, SL_MULTIPLY_BY = 313, SL_MINUS = 314, SL_PLUS = 315, SL_CROSS = 316, SL_MULTIPLY = 317, SL_DIVIDE = 318, SL_DOT = 319, SL_OR = 320, SL_AND = 321, SL_NOT = 322, SL_OUTPUT = 323, SL_EXTERN = 324, SL_UNIFORM = 325, SL_VARIABLE = 326, SL_VERTEX = 327 }; #endif #define SL_SURFACE 258 #define SL_DISPLACEMENT 259 #define SL_LIGHT 260 #define SL_VOLUME 261 #define SL_TRANSFORMATION 262 #define SL_IMAGER 263 #define SL_FOR 264 #define SL_WHILE 265 #define SL_IF 266 #define SL_GATHER 267 #define SL_ELSE 268 #define SL_BREAK 269 #define SL_CONTINUE 270 #define SL_ILLUMINANCE 271 #define SL_ILLUMINATE 272 #define SL_SOLAR 273 #define SL_RETURN 274 #define SL_VOID 275 #define SL_FCN_PI 276 #define SL_IDENTIFIER_VALUE 277 #define SL_FLOAT_VALUE 278 #define SL_COMMA 279 #define SL_SEMI_COLON 280 #define SL_OPEN_PARANTHESIS 281 #define SL_CLOSE_PARANTHESIS 282 #define SL_OPEN_CRL_PARANTHESIS 283 #define SL_CLOSE_CRL_PARANTHESIS 284 #define SL_OPEN_SQR_PARANTHESIS 285 #define SL_CLOSE_SQR_PARANTHESIS 286 #define SL_TEXTURE 287 #define SL_SHADOW 288 #define SL_ENVIRONMENT 289 #define SL_BUMP 290 #define SL_TEXT_VALUE 291 #define SL_COLON 292 #define SL_QUESTION 293 #define SL_STRING 294 #define SL_MATRIX 295 #define SL_NORMAL 296 #define SL_VECTOR 297 #define SL_POINT 298 #define SL_COLOR 299 #define SL_FLOAT 300 #define SL_COMP_DIFFERENT 301 #define SL_COMP_EQUAL 302 #define SL_COMP_LESS_EQUAL 303 #define SL_COMP_LESS 304 #define SL_COMP_GREATER_EQUAL 305 #define SL_COMP_GREATER 306 #define SL_EQUAL 307 #define SL_DECREMENT_BY 308 #define SL_INCREMENT_BY 309 #define SL_DECREMENT 310 #define SL_INCREMENT 311 #define SL_DIVIDE_BY 312 #define SL_MULTIPLY_BY 313 #define SL_MINUS 314 #define SL_PLUS 315 #define SL_CROSS 316 #define SL_MULTIPLY 317 #define SL_DIVIDE 318 #define SL_DOT 319 #define SL_OR 320 #define SL_AND 321 #define SL_NOT 322 #define SL_OUTPUT 323 #define SL_EXTERN 324 #define SL_UNIFORM 325 #define SL_VARIABLE 326 #define SL_VERTEX 327 /* Copy the first part of user declarations. */ #line 61 "sl.y" ////////////////////////////////////////////////////////////////////////// // Misc C definitions ////////////////////////////////////////////////////////////////////////// #undef alloca #include #include #include "common/global.h" #include "common/os.h" #include "opcodes.h" #include "sdr.h" void yyerror(char *); // Forward definition for stupid yacc int yylex(void ); // Forward definition for stupid yacc ////////////////////////////////////////////////////////////////////////// // Here's the only global CVariable ////////////////////////////////////////////////////////////////////////// CScriptContext *sdr; ////////////////////////////////////////////////////////////////////////// /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 86 "sl.y" typedef union YYSTYPE { char *string; CExpression *code; CExpression *expression; float real; int integer; CArray *array; } YYSTYPE; /* Line 191 of yacc.c. */ #line 264 "sl.cpp" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 276 "sl.cpp" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # endif # else # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short int yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short int yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 1450 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 73 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 105 /* YYNRULES -- Number of rules. */ #define YYNRULES 249 /* YYNRULES -- Number of states. */ #define YYNSTATES 444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 327 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short int yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 14, 16, 17, 19, 20, 22, 24, 26, 28, 30, 32, 34, 39, 42, 44, 48, 52, 57, 59, 60, 64, 67, 69, 70, 74, 75, 80, 82, 83, 90, 91, 99, 103, 108, 109, 110, 119, 121, 123, 125, 127, 129, 131, 133, 134, 138, 141, 143, 144, 148, 151, 154, 155, 160, 161, 165, 166, 174, 175, 182, 183, 185, 189, 190, 195, 198, 201, 204, 205, 209, 210, 215, 216, 223, 224, 232, 235, 237, 239, 241, 243, 246, 247, 249, 251, 253, 255, 258, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 282, 284, 286, 288, 290, 292, 294, 296, 298, 302, 305, 309, 312, 316, 319, 324, 327, 330, 331, 336, 337, 345, 346, 351, 352, 357, 360, 363, 364, 369, 370, 375, 376, 384, 385, 393, 399, 405, 406, 414, 415, 423, 425, 435, 445, 447, 448, 452, 454, 456, 457, 459, 460, 464, 466, 470, 472, 480, 486, 494, 498, 500, 501, 507, 512, 515, 520, 522, 528, 536, 546, 558, 564, 572, 582, 594, 600, 610, 616, 626, 631, 639, 644, 652, 654, 658, 662, 666, 670, 671, 676, 680, 683, 686, 692, 696, 700, 702, 704, 706, 708, 710, 712, 714, 719, 721, 723, 731, 765, 769, 772, 776, 780, 784, 788, 792, 796, 800, 804, 808, 812, 816, 820, 823, 825, 827, 830, 833, 836, 840, 842, 844, 848, 849, 857, 863, 865, 867, 869, 871, 873, 874, 875, 880 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short int yyrhs[] = { 74, 0, -1, -1, 75, 81, -1, 70, -1, 71, -1, 72, -1, -1, 69, -1, -1, 68, -1, -1, 45, -1, 44, -1, 42, -1, 41, -1, 43, -1, 40, -1, 39, -1, 77, 78, 76, 79, -1, 83, 81, -1, 92, -1, 80, 22, 26, -1, 20, 22, 26, -1, 82, 84, 27, 107, -1, 85, -1, -1, 86, 25, 85, -1, 86, 25, -1, 86, -1, -1, 80, 87, 88, -1, -1, 22, 89, 24, 88, -1, 22, -1, -1, 22, 30, 31, 90, 24, 88, -1, -1, 22, 30, 23, 31, 91, 24, 88, -1, 22, 30, 31, -1, 22, 30, 23, 31, -1, -1, -1, 95, 22, 26, 93, 96, 27, 94, 107, -1, 3, -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, -1, 97, -1, -1, 98, 25, 97, -1, 98, 25, -1, 98, -1, -1, 80, 99, 106, -1, 52, 161, -1, 52, 163, -1, -1, 22, 24, 102, 101, -1, -1, 22, 103, 100, -1, -1, 22, 30, 23, 31, 24, 104, 101, -1, -1, 22, 30, 23, 31, 105, 100, -1, -1, 101, -1, 101, 24, 106, -1, -1, 28, 108, 118, 29, -1, 80, 111, -1, 52, 161, -1, 52, 163, -1, -1, 22, 112, 116, -1, -1, 22, 113, 110, 116, -1, -1, 22, 30, 23, 31, 114, 116, -1, -1, 22, 30, 23, 31, 115, 110, 116, -1, 24, 111, -1, 25, -1, 120, -1, 119, -1, 1, -1, 118, 117, -1, -1, 140, -1, 125, -1, 147, -1, 152, -1, 127, 25, -1, 130, 25, -1, 121, -1, 122, -1, 123, -1, 155, -1, 157, -1, 159, -1, 107, -1, 109, -1, 83, -1, 168, 25, -1, 25, -1, 148, -1, 153, -1, 126, -1, 141, -1, 156, -1, 158, -1, 160, -1, 14, 23, 25, -1, 14, 25, -1, 15, 23, 25, -1, 15, 25, -1, 19, 161, 25, -1, 19, 25, -1, 10, 26, 167, 27, -1, 124, 119, -1, 124, 120, -1, -1, 22, 52, 128, 161, -1, -1, 22, 30, 161, 31, 52, 129, 161, -1, -1, 22, 54, 131, 161, -1, -1, 22, 53, 132, 161, -1, 22, 56, -1, 22, 55, -1, -1, 22, 58, 133, 161, -1, -1, 22, 57, 134, 161, -1, -1, 22, 30, 161, 31, 54, 135, 161, -1, -1, 22, 30, 161, 31, 53, 136, 161, -1, 22, 30, 161, 31, 56, -1, 22, 30, 161, 31, 55, -1, -1, 22, 30, 161, 31, 58, 137, 161, -1, -1, 22, 30, 161, 31, 57, 138, 161, -1, 9, -1, 139, 26, 142, 25, 144, 25, 145, 27, 119, -1, 139, 26, 142, 25, 144, 25, 145, 27, 120, -1, 143, -1, -1, 127, 24, 143, -1, 127, -1, 167, -1, -1, 146, -1, -1, 127, 24, 146, -1, 127, -1, 130, 24, 146, -1, 130, -1, 11, 26, 167, 27, 119, 13, 119, -1, 11, 26, 167, 27, 117, -1, 11, 26, 167, 27, 119, 13, 120, -1, 149, 24, 161, -1, 161, -1, -1, 12, 26, 151, 149, 27, -1, 150, 119, 13, 119, -1, 150, 117, -1, 150, 119, 13, 120, -1, 16, -1, 154, 26, 161, 27, 119, -1, 154, 26, 161, 24, 161, 27, 119, -1, 154, 26, 161, 24, 161, 24, 161, 27, 119, -1, 154, 26, 161, 24, 161, 24, 161, 24, 161, 27, 119, -1, 154, 26, 161, 27, 120, -1, 154, 26, 161, 24, 161, 27, 120, -1, 154, 26, 161, 24, 161, 24, 161, 27, 120, -1, 154, 26, 161, 24, 161, 24, 161, 24, 161, 27, 120, -1, 17, 26, 161, 27, 119, -1, 17, 26, 161, 24, 161, 24, 161, 27, 119, -1, 17, 26, 161, 27, 120, -1, 17, 26, 161, 24, 161, 24, 161, 27, 120, -1, 18, 26, 27, 119, -1, 18, 26, 161, 24, 161, 27, 119, -1, 18, 26, 27, 120, -1, 18, 26, 161, 24, 161, 27, 120, -1, 165, -1, 161, 60, 161, -1, 161, 59, 161, -1, 161, 62, 161, -1, 161, 63, 161, -1, -1, 161, 64, 162, 161, -1, 161, 61, 161, -1, 60, 161, -1, 59, 161, -1, 167, 38, 161, 37, 161, -1, 28, 164, 29, -1, 161, 24, 164, -1, 161, -1, 21, -1, 127, -1, 130, -1, 166, -1, 168, -1, 22, -1, 22, 30, 161, 31, -1, 23, -1, 36, -1, 26, 161, 24, 161, 24, 161, 27, -1, 26, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 27, -1, 26, 161, 27, -1, 80, 161, -1, 80, 36, 161, -1, 26, 167, 27, -1, 167, 66, 167, -1, 167, 65, 167, -1, 161, 51, 161, -1, 161, 49, 161, -1, 161, 50, 161, -1, 161, 48, 161, -1, 161, 47, 161, -1, 161, 46, 161, -1, 167, 47, 167, -1, 167, 46, 167, -1, 67, 167, -1, 173, -1, 170, -1, 22, 26, -1, 3, 26, -1, 4, 26, -1, 169, 175, 27, -1, 36, -1, 22, -1, 30, 161, 31, -1, -1, 174, 26, 171, 172, 24, 175, 27, -1, 174, 26, 171, 172, 27, -1, 32, -1, 33, -1, 34, -1, 35, -1, 176, -1, -1, -1, 161, 24, 177, 176, -1, 161, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { 0, 249, 249, 249, 257, 262, 267, 272, 279, 284, 290, 295, 301, 306, 311, 316, 321, 326, 331, 338, 358, 363, 378, 394, 405, 426, 431, 440, 447, 453, 463, 462, 490, 489, 501, 513, 510, 528, 524, 544, 555, 580, 591, 577, 612, 617, 622, 627, 632, 637, 646, 651, 659, 666, 672, 682, 681, 711, 725, 745, 743, 756, 755, 771, 766, 790, 786, 807, 814, 819, 832, 831, 851, 872, 878, 887, 886, 900, 899, 918, 914, 939, 935, 961, 967, 977, 984, 990, 1000, 1006, 1015, 1020, 1025, 1030, 1035, 1040, 1045, 1050, 1055, 1060, 1065, 1070, 1075, 1080, 1085, 1090, 1095, 1104, 1109, 1114, 1119, 1124, 1129, 1134, 1143, 1170, 1199, 1226, 1253, 1282, 1306, 1319, 1329, 1344, 1342, 1367, 1362, 1391, 1389, 1411, 1409, 1429, 1440, 1453, 1451, 1473, 1471, 1496, 1491, 1519, 1514, 1537, 1551, 1570, 1565, 1593, 1588, 1615, 1621, 1638, 1657, 1662, 1670, 1677, 1686, 1691, 1699, 1704, 1712, 1719, 1724, 1731, 1740, 1755, 1764, 1781, 1788, 1798, 1796, 1812, 1825, 1832, 1845, 1853, 1864, 1877, 1892, 1911, 1922, 1935, 1950, 1971, 1982, 1999, 2010, 2029, 2039, 2054, 2064, 2081, 2086, 2093, 2100, 2133, 2142, 2140, 2151, 2158, 2164, 2170, 2188, 2197, 2205, 2213, 2218, 2223, 2228, 2233, 2238, 2251, 2266, 2271, 2276, 2287, 2343, 2353, 2361, 2372, 2379, 2386, 2393, 2401, 2409, 2417, 2425, 2433, 2441, 2449, 2457, 2468, 2508, 2517, 2532, 2547, 2564, 2643, 2648, 2659, 2666, 2677, 2701, 2725, 2738, 2751, 2764, 2781, 2785, 2792, 2790, 2799 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "SL_SURFACE", "SL_DISPLACEMENT", "SL_LIGHT", "SL_VOLUME", "SL_TRANSFORMATION", "SL_IMAGER", "SL_FOR", "SL_WHILE", "SL_IF", "SL_GATHER", "SL_ELSE", "SL_BREAK", "SL_CONTINUE", "SL_ILLUMINANCE", "SL_ILLUMINATE", "SL_SOLAR", "SL_RETURN", "SL_VOID", "SL_FCN_PI", "SL_IDENTIFIER_VALUE", "SL_FLOAT_VALUE", "SL_COMMA", "SL_SEMI_COLON", "SL_OPEN_PARANTHESIS", "SL_CLOSE_PARANTHESIS", "SL_OPEN_CRL_PARANTHESIS", "SL_CLOSE_CRL_PARANTHESIS", "SL_OPEN_SQR_PARANTHESIS", "SL_CLOSE_SQR_PARANTHESIS", "SL_TEXTURE", "SL_SHADOW", "SL_ENVIRONMENT", "SL_BUMP", "SL_TEXT_VALUE", "SL_COLON", "SL_QUESTION", "SL_STRING", "SL_MATRIX", "SL_NORMAL", "SL_VECTOR", "SL_POINT", "SL_COLOR", "SL_FLOAT", "SL_COMP_DIFFERENT", "SL_COMP_EQUAL", "SL_COMP_LESS_EQUAL", "SL_COMP_LESS", "SL_COMP_GREATER_EQUAL", "SL_COMP_GREATER", "SL_EQUAL", "SL_DECREMENT_BY", "SL_INCREMENT_BY", "SL_DECREMENT", "SL_INCREMENT", "SL_DIVIDE_BY", "SL_MULTIPLY_BY", "SL_MINUS", "SL_PLUS", "SL_CROSS", "SL_MULTIPLY", "SL_DIVIDE", "SL_DOT", "SL_OR", "SL_AND", "SL_NOT", "SL_OUTPUT", "SL_EXTERN", "SL_UNIFORM", "SL_VARIABLE", "SL_VERTEX", "$accept", "slStart", "@1", "slContainerClass", "slInheritanceClass", "slOutputClass", "slTypeSpecifier", "slTypeDecl", "slShader", "slFunctionHeader", "slFunction", "slFunctionParameterList", "slFunctionParameters", "slFunctionParameter", "@2", "slFunctionParameterIdentifierList", "@3", "@4", "@5", "slMain", "@6", "@7", "slShaderType", "slShaderParameterList", "slShaderParameters", "slShaderParameter", "@8", "slShaderParameterInitializer", "slShaderParameterIdentifierToken", "@9", "@10", "@11", "@12", "slShaderParameterIdentifierList", "slBlock", "@13", "slVariableDeclerations", "slVariableInitializer", "slVariableIdentifierList", "@14", "@15", "@16", "@17", "slVariableIdentifierTail", "slStatement", "slStatements", "slMatchedStatement", "slUnmatchedStatement", "slBreakStatement", "slContinueStatement", "slReturnStatement", "slWhileStartStatement", "slWhileStatement", "slUnmatchedWhileStatement", "slAssignmentStatement", "@18", "@19", "slUpdateStatement", "@20", "@21", "@22", "@23", "@24", "@25", "@26", "@27", "slForStartStatement", "slForStatement", "slUnmatchedForStatement", "slForInitStatement", "slForInitStatements", "slForCheckStatement", "slForIncrementStatement", "slForIncrementStatements", "slMatchedIfStatement", "slUnmatchedIfStatement", "slGatherParameterList", "slGatherHeader", "@28", "slMatchedGatherStatement", "slUnmatchedGatherStatement", "slIlluminanceStartStatement", "slIlluminanceStatement", "slUnmatchedIlluminanceStatement", "slIlluminateStatement", "slUnmatchedIlluminateStatement", "slSolarStatement", "slUnmatchedSolarStatement", "slAritmeticExpression", "@29", "slArrayList", "slArrayItems", "slAritmeticTerminalValue", "slAritmeticTypeCast", "slBooleanExpression", "slFunctionCall", "slFunCallHeader", "slFunCall", "slTextureNameSpecifier", "slTextureChannelSpecifier", "slTextureCall", "slTextureName", "slFunctionCallParameterList", "slFunctionCallParameters", "@30", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 73, 75, 74, 76, 76, 76, 76, 77, 77, 78, 78, 79, 79, 79, 79, 79, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 85, 87, 86, 89, 88, 88, 90, 88, 91, 88, 88, 88, 93, 94, 92, 95, 95, 95, 95, 95, 95, 96, 96, 97, 97, 97, 99, 98, 100, 100, 102, 101, 103, 101, 104, 101, 105, 101, 101, 106, 106, 108, 107, 109, 110, 110, 112, 111, 113, 111, 114, 111, 115, 111, 116, 116, 117, 117, 117, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 121, 121, 122, 122, 123, 123, 124, 125, 126, 128, 127, 129, 127, 131, 130, 132, 130, 130, 130, 133, 130, 134, 130, 135, 130, 136, 130, 130, 130, 137, 130, 138, 130, 139, 140, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 146, 146, 147, 148, 148, 149, 149, 151, 150, 152, 153, 153, 154, 155, 155, 155, 155, 156, 156, 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, 161, 161, 161, 162, 161, 161, 161, 161, 161, 163, 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, 169, 169, 169, 170, 171, 171, 172, 172, 173, 173, 174, 174, 174, 174, 175, 175, 177, 176, 176 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 4, 2, 1, 3, 3, 4, 1, 0, 3, 2, 1, 0, 3, 0, 4, 1, 0, 6, 0, 7, 3, 4, 0, 0, 8, 1, 1, 1, 1, 1, 1, 1, 0, 3, 2, 1, 0, 3, 2, 2, 0, 4, 0, 3, 0, 7, 0, 6, 0, 1, 3, 0, 4, 2, 2, 2, 0, 3, 0, 4, 0, 6, 0, 7, 2, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 3, 2, 4, 2, 2, 0, 4, 0, 7, 0, 4, 0, 4, 2, 2, 0, 4, 0, 4, 0, 7, 0, 7, 5, 5, 0, 7, 0, 7, 1, 9, 9, 1, 0, 3, 1, 1, 0, 1, 0, 3, 1, 3, 1, 7, 5, 7, 3, 1, 0, 5, 4, 2, 4, 1, 5, 7, 9, 11, 5, 7, 9, 11, 5, 9, 5, 9, 4, 7, 4, 7, 1, 3, 3, 3, 3, 0, 4, 3, 2, 2, 5, 3, 3, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 7, 33, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 2, 2, 2, 3, 1, 1, 3, 0, 7, 5, 1, 1, 1, 1, 1, 0, 0, 4, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 2, 0, 9, 1, 44, 45, 46, 47, 48, 49, 0, 8, 11, 0, 3, 9, 9, 21, 0, 0, 10, 7, 0, 30, 0, 25, 29, 20, 0, 23, 4, 5, 6, 0, 22, 0, 0, 9, 41, 18, 17, 15, 14, 16, 13, 12, 19, 34, 31, 70, 24, 27, 9, 0, 0, 89, 55, 0, 50, 54, 0, 39, 0, 0, 67, 42, 9, 40, 0, 33, 87, 0, 0, 147, 0, 0, 0, 0, 0, 172, 0, 0, 9, 0, 106, 71, 241, 242, 243, 244, 0, 104, 102, 103, 88, 86, 85, 96, 97, 98, 9, 91, 109, 0, 0, 0, 90, 110, 92, 107, 0, 93, 108, 0, 99, 111, 100, 112, 101, 113, 0, 9, 230, 229, 0, 61, 68, 56, 0, 52, 0, 0, 232, 233, 9, 9, 167, 0, 115, 0, 117, 9, 9, 203, 208, 210, 119, 9, 211, 9, 9, 9, 9, 204, 205, 0, 189, 206, 0, 207, 231, 9, 123, 129, 127, 132, 131, 135, 133, 75, 72, 121, 122, 94, 95, 151, 170, 86, 9, 105, 249, 0, 245, 0, 59, 0, 0, 67, 43, 0, 36, 0, 0, 0, 9, 114, 116, 0, 9, 0, 9, 0, 0, 198, 197, 228, 211, 215, 118, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 194, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 153, 0, 150, 9, 0, 247, 234, 236, 235, 238, 67, 0, 9, 62, 69, 38, 120, 0, 0, 166, 9, 9, 185, 187, 9, 0, 9, 214, 217, 216, 225, 224, 223, 221, 222, 220, 191, 190, 196, 192, 193, 9, 0, 227, 226, 219, 218, 0, 124, 130, 128, 136, 134, 0, 0, 84, 76, 9, 0, 9, 0, 9, 169, 171, 9, 9, 9, 9, 0, 60, 65, 9, 57, 58, 163, 86, 9, 168, 0, 181, 183, 0, 209, 0, 195, 9, 125, 139, 137, 142, 141, 145, 143, 79, 75, 83, 73, 74, 78, 0, 152, 0, 154, 0, 173, 177, 248, 0, 9, 240, 63, 0, 202, 0, 9, 165, 9, 9, 9, 199, 9, 9, 9, 9, 9, 0, 0, 0, 157, 9, 9, 237, 0, 67, 66, 9, 200, 162, 164, 0, 186, 188, 0, 126, 140, 138, 146, 144, 80, 0, 0, 159, 161, 0, 156, 0, 174, 178, 239, 64, 201, 9, 9, 212, 82, 0, 0, 9, 9, 9, 182, 184, 0, 158, 160, 148, 149, 0, 175, 179, 9, 9, 0, 176, 180, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 213 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short int yydefgoto[] = { -1, 1, 2, 33, 12, 21, 46, 152, 14, 15, 91, 24, 25, 26, 35, 48, 54, 68, 130, 17, 52, 128, 18, 57, 58, 59, 64, 249, 126, 246, 186, 369, 347, 127, 92, 55, 93, 294, 170, 233, 234, 361, 362, 292, 94, 63, 95, 96, 97, 98, 99, 100, 101, 102, 153, 227, 356, 154, 229, 228, 231, 230, 358, 357, 360, 359, 105, 106, 107, 237, 238, 337, 389, 390, 108, 109, 254, 110, 194, 111, 112, 113, 114, 115, 116, 117, 118, 119, 191, 277, 309, 349, 156, 157, 158, 159, 121, 122, 245, 304, 123, 124, 181, 182, 302 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -289 static const short int yypact[] = { -289, 8, 48, -289, -289, -289, -289, -289, -289, -289, 15, -289, -19, 50, -289, -22, 48, -289, 55, 56, -289, 65, 76, -289, 80, -289, 93, -289, 87, -289, -289, -289, -289, 177, -289, 99, 101, -12, -289, -289, -289, -289, -289, -289, -289, -289, -289, 39, -289, -289, -289, -289, -11, 13, 103, -289, -289, 112, -289, 133, 144, 156, 99, 522, 159, -289, -9, 161, 163, -289, -289, 164, 165, -289, 166, 167, 169, 2, 66, -289, 171, 173, 7, 263, -289, -289, -289, -289, -289, -289, 181, -289, -289, -289, -289, -289, -289, -289, -289, -289, 716, -289, -289, 179, 182, 180, -289, -289, -289, -289, 594, -289, -289, 183, -289, -289, -289, -289, -289, -289, 185, 384, -289, -289, 186, 41, 187, -289, 101, -289, 190, 99, -289, -289, 837, 837, -289, 199, -289, 200, -289, 837, 736, -289, 795, -289, -289, 837, -289, 837, 837, 837, 858, -289, -289, 648, -289, -289, 68, -289, -289, 837, -289, -289, -289, -289, -289, -289, -289, -7, -289, -289, -289, -289, -289, 204, -289, 176, 837, -289, 936, 203, -289, -10, -289, 209, 175, 159, -289, 99, -289, 1279, 54, 57, 837, -289, -289, 215, 716, 964, 837, 525, 136, 109, 109, -289, 646, 1279, -289, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, -289, 837, 837, 837, 837, 837, 1331, 837, 837, 837, 837, 837, 211, 100, 184, -21, 219, 210, -289, 716, 596, -289, -289, -289, -289, 214, 159, 216, 776, -289, -289, -289, -289, 594, 51, 1279, 837, 716, -289, -289, 837, 1337, 837, -289, -289, 1279, 989, 989, 989, 989, 989, 989, 109, 109, 115, 188, 188, 837, 1386, 77, 77, 192, -289, 909, 362, 362, 362, 362, 362, 217, 224, -289, -289, 776, 100, 837, 204, 797, -289, -289, 837, 716, 837, 837, 59, -289, 225, 837, 1279, -289, -289, 240, 837, -289, 983, -289, -289, 410, 909, 1011, -289, 837, -289, -289, -289, -289, -289, -289, -289, 202, -6, -289, 1279, -289, -289, 1358, -289, 231, 68, 883, -289, -289, -289, 1379, 384, -289, -289, 175, 1017, 238, 716, 1279, 837, 716, 837, 1279, 837, 837, 837, 837, 837, 100, 184, 220, 246, 837, 716, -289, 244, 159, -289, 837, -289, -289, -289, 727, -289, -289, 889, 362, 362, 362, 362, 362, -289, 100, 445, 256, 257, 258, -289, 930, -289, -289, -289, -289, -289, 716, 837, -289, -289, 246, 246, 716, 837, 716, -289, -289, 1045, -289, -289, -289, -289, 1285, -289, -289, 837, 716, 1064, -289, -289, 837, 1092, 837, 1098, 837, 1126, 837, 1145, 837, 1173, 837, 1179, 837, 1207, 837, 1226, 837, 1254, 837, 1260, 837, 1310, -289 }; /* YYPGOTO[NTERM-NUM]. */ static const short int yypgoto[] = { -289, -289, -289, -289, -289, -289, -289, -2, 275, -289, 46, -289, 264, -289, -289, -61, -289, -289, -289, -289, -289, -289, -289, -289, 234, -289, -289, -45, -243, -289, -289, -289, -289, 118, -32, -289, -289, -56, 17, -289, -289, -289, -289, -288, -108, -289, -93, 88, -289, -289, -289, -289, -289, -289, 30, -289, -289, 113, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, 12, -289, -289, -240, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -289, -62, -289, 20, -57, -289, -289, -113, 31, -289, -289, -289, -289, -289, -289, -16, 21, -289 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -247 static const short int yytable[] = { 13, 69, 176, 305, 50, -26, 334, 171, 3, 295, 71, 72, 243, 23, 13, -28, -51, 177, -53, 34, 155, 192, 193, 232, 232, 137, 244, 138, 143, 144, 145, 162, 146, 147, 202, 23, 60, 19, 205, 86, 87, 88, 89, 148, 61, -77, -77, 11, 16, 20, 56, 4, 5, 6, 7, 8, 9, 11, 11, 180, 11, 90, 16, -32, 56, 184, 149, 150, 10, 53, 190, 185, 22, 384, 151, 312, 11, 28, 313, 197, 199, 252, 29, 344, 253, 201, 345, 203, 204, 139, 207, 140, 221, 103, 120, 221, 188, 400, 90, 226, 222, 223, 34, 222, 223, 258, 221, 36, 90, 279, 280, 281, 282, 38, 222, 223, 240, 11, 37, 224, 225, 47, 224, 225, 290, 291, 395, 62, 251, 49, 103, 120, 255, 224, 225, 30, 31, 32, 261, 65, 103, 120, 224, 225, 265, 310, 298, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 66, 278, 311, 409, 410, 264, 315, 284, 285, 286, 287, 288, 217, 218, 219, 220, 221, 67, 104, 218, 219, 220, -35, 125, 222, 223, 338, -37, 308, 131, 172, 239, 132, 133, 134, 135, 314, 136, 90, 141, 317, 142, 319, 224, 225, 169, 173, 236, 175, 174, 340, 178, 179, 187, 183, 104, 189, 320, 39, 40, 41, 42, 43, 44, 45, 104, 195, 196, 235, 248, 103, 120, 242, 332, 247, 335, 289, 297, 293, 90, 339, 256, 180, 343, 257, 296, 303, 348, 330, 306, 329, 346, 351, 90, 220, 350, -81, 90, 364, 373, 225, 355, 376, 209, 210, 211, 212, 213, 214, 372, 386, 103, 120, 394, 322, 392, 215, 216, 217, 218, 219, 220, 401, 402, 180, 103, 120, 403, 259, 103, 120, 160, 375, 27, 378, 161, 379, 380, 381, 382, 383, 90, 129, 51, 370, 391, 406, 250, 385, 331, 336, 348, 411, 104, 414, 333, 396, 162, 163, 164, 165, 166, 167, 168, 0, 342, 419, 0, 236, 299, 368, 0, 0, 103, 120, 0, 0, 0, 408, 0, 0, 0, 0, 0, 413, 0, 0, 316, 0, 0, 90, 0, 0, 90, 104, 0, 418, 0, 0, 0, 0, 422, 0, 424, 0, 426, 90, 428, 104, 430, 0, 432, 104, 434, 0, 436, 0, 438, 0, 440, 0, 442, 103, 120, 0, 103, 120, 0, 0, 71, 72, 341, 0, 0, 0, 0, 387, 90, 103, 120, 0, 0, 0, 90, 0, 90, 0, 143, 144, 145, 0, 0, 147, -246, 0, 0, 104, 90, 86, 87, 88, 89, 148, 215, 216, 217, 218, 219, 220, 103, 120, 0, 0, 387, 387, 103, 120, 103, 120, 353, 374, 0, 0, 377, 0, 149, 150, 0, 0, 103, 120, 0, 0, 151, 0, 11, 393, 0, 209, 210, 211, 212, 213, 214, 0, 104, 0, 0, 104, 0, 0, 215, 216, 217, 218, 219, 220, 161, 0, 388, 0, 104, 0, 0, 0, 0, 0, 407, 0, 0, 0, 0, 0, 412, 0, 415, 0, 0, 0, 162, 163, 164, 165, 166, 167, 168, 0, 420, 0, 0, 0, 0, 104, 0, 0, 0, 388, 388, 104, 0, 104, 0, 0, 0, 0, 70, 0, 71, 72, 0, 0, 0, 104, 73, 74, 75, 76, 0, 77, 78, 79, 80, 81, 82, 10, 0, 83, 0, 0, 84, 0, 262, 49, 85, 263, 0, 86, 87, 88, 89, 0, 0, 0, -9, -9, -9, -9, -9, -9, -9, 0, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, -9, 11, -9, -9, -9, 70, 0, 71, 72, 0, 0, 0, 0, 73, 74, 75, 76, 0, 77, 78, 79, 80, 81, 82, 10, 0, 83, 0, 0, 84, 300, 0, 49, 301, 0, 0, 86, 87, 88, 89, 0, 0, 0, -9, -9, -9, -9, -9, -9, -9, 0, 0, 209, 210, 211, 212, 213, 214, 0, 71, 72, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 0, -9, 11, -9, -9, -9, 143, 144, 145, 0, 0, 147, 208, 0, 0, 0, 0, 86, 87, 88, 89, 148, 0, 0, -9, -9, -9, -9, -9, -9, -9, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 149, 150, 215, 216, 217, 218, 219, 220, 151, -9, 11, -9, -9, -9, 71, 72, 0, 0, 0, 0, 73, 74, 75, 76, 0, 77, 78, 79, 80, 81, 82, 10, 0, 83, 71, 72, 84, 0, 0, 49, 0, 0, 0, 86, 87, 88, 89, 0, 0, 397, 0, 0, 143, 144, 145, 0, 0, 147, 198, 0, 0, 0, 0, 86, 87, 88, 89, 148, 209, 210, 211, 212, 213, 214, 71, 72, 0, 0, 0, 0, 11, 215, 216, 217, 218, 219, 220, 0, 0, 0, 149, 150, 143, 144, 145, 71, 72, 147, 151, 307, 11, 0, 0, 86, 87, 88, 89, 148, 0, 0, 0, 0, 0, 143, 144, 145, 160, -155, 147, 0, 200, 0, 0, 0, 86, 87, 88, 89, 148, 0, 149, 150, 0, 0, 0, 71, 72, 0, 151, 0, 11, 0, 162, 163, 164, 165, 166, 167, 168, 0, 0, 149, 150, 143, 144, 145, 71, 72, 147, 151, 0, 11, 0, 0, 86, 87, 88, 89, 148, 0, 0, 0, 0, 0, 143, 144, 145, 0, 0, 147, 0, 0, 0, 0, 0, 86, 87, 88, 89, 206, 0, 149, 150, 0, 0, 0, 0, 0, 0, 151, 0, 11, 365, 0, 0, 366, 0, 0, 398, 0, 0, 399, 149, 150, 0, 0, 0, 0, 0, 0, 151, 0, 11, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 0, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 404, 0, 0, 405, 0, 0, 241, 322, 323, 324, 325, 326, 327, 328, 0, 0, 0, 0, 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 260, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 352, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 209, 210, 211, 212, 213, 214, 354, 0, 211, 212, 213, 214, 371, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 416, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 421, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 209, 210, 211, 212, 213, 214, 423, 0, 0, 0, 0, 0, 425, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 427, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 429, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 209, 210, 211, 212, 213, 214, 431, 0, 0, 0, 0, 0, 433, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 435, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 437, 0, 0, 209, 210, 211, 212, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 209, 210, 211, 212, 213, 214, 439, 0, 0, 0, 0, 0, 441, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 417, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 443, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, 283, 0, 0, 0, 0, 0, 318, 215, 216, 217, 218, 219, 220, 0, 0, 209, 210, 211, 212, 213, 214, 209, 210, 211, 212, 213, 214, 363, 215, 216, 217, 218, 219, 220, 215, 216, 217, 218, 219, 220, 0, 0, 209, 210, 211, 212, 213, 214, 367, 0, 0, 0, 0, 0, 0, 215, 216, 217, 218, 219, 220, 321, 0, 209, 210, 211, 212, 213, 214, 0, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 0, 215, 216, 217, 218, 219, 220 }; static const short int yycheck[] = { 2, 62, 110, 246, 36, 27, 294, 100, 0, 30, 3, 4, 22, 15, 16, 27, 27, 110, 27, 26, 82, 134, 135, 30, 30, 23, 36, 25, 21, 22, 23, 52, 25, 26, 147, 37, 23, 22, 151, 32, 33, 34, 35, 36, 31, 52, 52, 69, 2, 68, 52, 3, 4, 5, 6, 7, 8, 69, 69, 121, 69, 63, 16, 24, 66, 24, 59, 60, 20, 30, 131, 30, 22, 361, 67, 24, 69, 22, 27, 141, 142, 27, 26, 24, 27, 147, 27, 149, 150, 23, 152, 25, 38, 63, 63, 38, 128, 385, 100, 161, 46, 47, 26, 46, 47, 198, 38, 27, 110, 222, 223, 224, 225, 26, 46, 47, 178, 69, 25, 65, 66, 22, 65, 66, 24, 25, 369, 24, 189, 28, 100, 100, 194, 65, 66, 70, 71, 72, 200, 27, 110, 110, 65, 66, 206, 253, 239, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 25, 221, 253, 401, 402, 27, 257, 227, 228, 229, 230, 231, 61, 62, 63, 64, 38, 31, 63, 62, 63, 64, 24, 22, 46, 47, 297, 24, 248, 24, 100, 13, 26, 26, 26, 26, 256, 26, 198, 26, 260, 26, 262, 65, 66, 22, 25, 175, 26, 25, 301, 26, 25, 24, 26, 100, 24, 277, 39, 40, 41, 42, 43, 44, 45, 110, 25, 25, 22, 52, 198, 198, 27, 293, 23, 295, 23, 25, 52, 239, 300, 24, 302, 303, 27, 24, 30, 307, 22, 31, 31, 24, 312, 253, 64, 13, 52, 257, 25, 350, 66, 321, 353, 46, 47, 48, 49, 50, 51, 29, 22, 239, 239, 27, 52, 366, 59, 60, 61, 62, 63, 64, 24, 24, 344, 253, 253, 27, 198, 257, 257, 26, 352, 16, 354, 30, 356, 357, 358, 359, 360, 301, 66, 37, 347, 365, 397, 187, 362, 290, 296, 371, 403, 198, 405, 293, 371, 52, 53, 54, 55, 56, 57, 58, -1, 302, 417, -1, 296, 239, 344, -1, -1, 301, 301, -1, -1, -1, 398, -1, -1, -1, -1, -1, 404, -1, -1, 257, -1, -1, 350, -1, -1, 353, 239, -1, 416, -1, -1, -1, -1, 421, -1, 423, -1, 425, 366, 427, 253, 429, -1, 431, 257, 433, -1, 435, -1, 437, -1, 439, -1, 441, 350, 350, -1, 353, 353, -1, -1, 3, 4, 301, -1, -1, -1, -1, 364, 397, 366, 366, -1, -1, -1, 403, -1, 405, -1, 21, 22, 23, -1, -1, 26, 27, -1, -1, 301, 417, 32, 33, 34, 35, 36, 59, 60, 61, 62, 63, 64, 397, 397, -1, -1, 401, 402, 403, 403, 405, 405, 27, 350, -1, -1, 353, -1, 59, 60, -1, -1, 417, 417, -1, -1, 67, -1, 69, 366, -1, 46, 47, 48, 49, 50, 51, -1, 350, -1, -1, 353, -1, -1, 59, 60, 61, 62, 63, 64, 30, -1, 364, -1, 366, -1, -1, -1, -1, -1, 397, -1, -1, -1, -1, -1, 403, -1, 405, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, -1, 417, -1, -1, -1, -1, 397, -1, -1, -1, 401, 402, 403, -1, 405, -1, -1, -1, -1, 1, -1, 3, 4, -1, -1, -1, 417, 9, 10, 11, 12, -1, 14, 15, 16, 17, 18, 19, 20, -1, 22, -1, -1, 25, -1, 24, 28, 29, 27, -1, 32, 33, 34, 35, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 68, 69, 70, 71, 72, 1, -1, 3, 4, -1, -1, -1, -1, 9, 10, 11, 12, -1, 14, 15, 16, 17, 18, 19, 20, -1, 22, -1, -1, 25, 24, -1, 28, 27, -1, -1, 32, 33, 34, 35, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, -1, -1, 46, 47, 48, 49, 50, 51, -1, 3, 4, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, -1, 68, 69, 70, 71, 72, 21, 22, 23, -1, -1, 26, 25, -1, -1, -1, -1, 32, 33, 34, 35, 36, -1, -1, 39, 40, 41, 42, 43, 44, 45, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, 59, 60, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 72, 3, 4, -1, -1, -1, -1, 9, 10, 11, 12, -1, 14, 15, 16, 17, 18, 19, 20, -1, 22, 3, 4, 25, -1, -1, 28, -1, -1, -1, 32, 33, 34, 35, -1, -1, 27, -1, -1, 21, 22, 23, -1, -1, 26, 27, -1, -1, -1, -1, 32, 33, 34, 35, 36, 46, 47, 48, 49, 50, 51, 3, 4, -1, -1, -1, -1, 69, 59, 60, 61, 62, 63, 64, -1, -1, -1, 59, 60, 21, 22, 23, 3, 4, 26, 67, 28, 69, -1, -1, 32, 33, 34, 35, 36, -1, -1, -1, -1, -1, 21, 22, 23, 26, 25, 26, -1, 30, -1, -1, -1, 32, 33, 34, 35, 36, -1, 59, 60, -1, -1, -1, 3, 4, -1, 67, -1, 69, -1, 52, 53, 54, 55, 56, 57, 58, -1, -1, 59, 60, 21, 22, 23, 3, 4, 26, 67, -1, 69, -1, -1, 32, 33, 34, 35, 36, -1, -1, -1, -1, -1, 21, 22, 23, -1, -1, 26, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, -1, 59, 60, -1, -1, -1, -1, -1, -1, 67, -1, 69, 24, -1, -1, 27, -1, -1, 24, -1, -1, 27, 59, 60, -1, -1, -1, -1, -1, -1, 67, -1, 69, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, -1, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, 24, -1, -1, 27, -1, -1, 24, 52, 53, 54, 55, 56, 57, 58, -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 24, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, 24, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 46, 47, 48, 49, 50, 51, 24, -1, 48, 49, 50, 51, 24, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 24, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, 24, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 46, 47, 48, 49, 50, 51, 24, -1, -1, -1, -1, -1, 24, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 24, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, 24, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 46, 47, 48, 49, 50, 51, 24, -1, -1, -1, -1, -1, 24, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 24, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, 24, -1, -1, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 46, 47, 48, 49, 50, 51, 24, -1, -1, -1, -1, -1, 24, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 27, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 27, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, 46, 47, 48, 49, 50, 51, 31, -1, -1, -1, -1, -1, 31, 59, 60, 61, 62, 63, 64, -1, -1, 46, 47, 48, 49, 50, 51, 46, 47, 48, 49, 50, 51, 31, 59, 60, 61, 62, 63, 64, 59, 60, 61, 62, 63, 64, -1, -1, 46, 47, 48, 49, 50, 51, 31, -1, -1, -1, -1, -1, -1, 59, 60, 61, 62, 63, 64, 37, -1, 46, 47, 48, 49, 50, 51, -1, 46, 47, 48, 49, 50, 51, 59, 60, 61, 62, 63, 64, -1, 59, 60, 61, 62, 63, 64 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 74, 75, 0, 3, 4, 5, 6, 7, 8, 20, 69, 77, 80, 81, 82, 83, 92, 95, 22, 68, 78, 22, 80, 84, 85, 86, 81, 22, 26, 70, 71, 72, 76, 26, 87, 27, 25, 26, 39, 40, 41, 42, 43, 44, 45, 79, 22, 88, 28, 107, 85, 93, 30, 89, 108, 80, 96, 97, 98, 23, 31, 24, 118, 99, 27, 25, 31, 90, 88, 1, 3, 4, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 22, 25, 29, 32, 33, 34, 35, 80, 83, 107, 109, 117, 119, 120, 121, 122, 123, 124, 125, 126, 127, 130, 139, 140, 141, 147, 148, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 168, 169, 170, 173, 174, 22, 101, 106, 94, 97, 91, 24, 26, 26, 26, 26, 26, 23, 25, 23, 25, 26, 26, 21, 22, 23, 25, 26, 36, 59, 60, 67, 80, 127, 130, 161, 165, 166, 167, 168, 26, 30, 52, 53, 54, 55, 56, 57, 58, 22, 111, 119, 120, 25, 25, 26, 117, 119, 26, 25, 161, 175, 176, 26, 24, 30, 103, 24, 107, 24, 88, 161, 167, 167, 151, 25, 25, 161, 27, 161, 30, 161, 167, 161, 161, 167, 36, 161, 25, 46, 47, 48, 49, 50, 51, 59, 60, 61, 62, 63, 64, 38, 46, 47, 65, 66, 161, 128, 132, 131, 134, 133, 30, 112, 113, 22, 127, 142, 143, 13, 161, 24, 27, 22, 36, 171, 102, 23, 52, 100, 106, 88, 27, 27, 149, 161, 24, 27, 119, 120, 24, 161, 24, 27, 27, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 161, 167, 167, 167, 167, 31, 161, 161, 161, 161, 161, 23, 24, 25, 116, 52, 110, 30, 24, 25, 119, 120, 24, 27, 177, 30, 172, 101, 31, 28, 161, 163, 117, 119, 24, 27, 161, 119, 120, 161, 31, 161, 161, 37, 52, 53, 54, 55, 56, 57, 58, 31, 22, 111, 161, 163, 116, 161, 143, 144, 167, 161, 119, 120, 176, 161, 24, 27, 24, 105, 161, 164, 13, 161, 24, 27, 24, 161, 129, 136, 135, 138, 137, 114, 115, 31, 25, 24, 27, 31, 175, 104, 100, 24, 29, 119, 120, 161, 119, 120, 161, 161, 161, 161, 161, 161, 116, 110, 22, 127, 130, 145, 146, 161, 119, 120, 27, 101, 164, 27, 24, 27, 116, 24, 24, 27, 24, 27, 119, 120, 161, 146, 146, 119, 120, 161, 119, 120, 24, 27, 161, 119, 120, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 24, 161, 27 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).first_line = (Rhs)[1].first_line, \ (Current).first_column = (Rhs)[1].first_column, \ (Current).last_line = (Rhs)[N].last_line, \ (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) short int *bottom; short int *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short int yyssa[YYINITDEPTH]; short int *yyss = yyssa; register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 249 "sl.y" { ;} break; case 3: #line 252 "sl.y" { ;} break; case 4: #line 258 "sl.y" { yyval.integer = SLC_UNIFORM; ;} break; case 5: #line 263 "sl.y" { yyval.integer = SLC_VARYING; ;} break; case 6: #line 268 "sl.y" { yyval.integer = SLC_VARYING | SLC_VERTEX; ;} break; case 7: #line 272 "sl.y" { yyval.integer = 0; ;} break; case 8: #line 280 "sl.y" { yyval.integer = SLC_EXTERN; ;} break; case 9: #line 284 "sl.y" { yyval.integer = 0; ;} break; case 10: #line 291 "sl.y" { yyval.integer = SLC_OUTPUT; ;} break; case 11: #line 295 "sl.y" { yyval.integer = 0; ;} break; case 12: #line 302 "sl.y" { yyval.integer = SLC_FLOAT; ;} break; case 13: #line 307 "sl.y" { yyval.integer = SLC_VECTOR | SLC_VCOLOR; ;} break; case 14: #line 312 "sl.y" { yyval.integer = SLC_VECTOR | SLC_VVECTOR; ;} break; case 15: #line 317 "sl.y" { yyval.integer = SLC_VECTOR | SLC_VNORMAL; ;} break; case 16: #line 322 "sl.y" { yyval.integer = SLC_VECTOR | SLC_VPOINT; ;} break; case 17: #line 327 "sl.y" { yyval.integer = SLC_MATRIX; ;} break; case 18: #line 332 "sl.y" { yyval.integer = SLC_STRING | SLC_UNIFORM; ;} break; case 19: #line 342 "sl.y" { yyval.integer = yyvsp[-3].integer | yyvsp[-2].integer | yyvsp[-1].integer | yyvsp[0].integer; sdr->desire(yyval.integer); ;} break; case 20: #line 360 "sl.y" { ;} break; case 21: #line 364 "sl.y" { ;} break; case 22: #line 381 "sl.y" { CFunction *thisFunction = sdr->newFunction(yyvsp[-1].string); if (yyvsp[-2].integer & (SLC_OUTPUT | SLC_EXTERN | SLC_RDONLY)) { sdr->error("Invalid return type for function %s\n",yyvsp[-1].string); yyvsp[-2].integer &= ~(SLC_OUTPUT | SLC_EXTERN | SLC_RDONLY); } thisFunction->returnValue = new CParameter(yyvsp[-1].string,yyvsp[-2].integer,1); sdr->undesire(); ;} break; case 23: #line 397 "sl.y" { CFunction *thisFunction = sdr->newFunction(yyvsp[-1].string); thisFunction->returnValue = NULL; ;} break; case 24: #line 409 "sl.y" { CFunction *cFun = sdr->popFunction(); cFun->initExpression = yyvsp[-2].code; cFun->code = yyvsp[0].code; if (cFun->returnValue != NULL) if (cFun->returnValueGiven == FALSE) sdr->error("Return value not given for %s\n",cFun->symbolName); ;} break; case 25: #line 427 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 26: #line 431 "sl.y" { yyval.code = new CNullExpression; ;} break; case 27: #line 443 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].code,yyvsp[0].code); ;} break; case 28: #line 449 "sl.y" { yyval.code = yyvsp[-1].code; ;} break; case 29: #line 454 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 30: #line 463 "sl.y" { int type = sdr->desired(); if (type & (SLC_EXTERN)) { sdr->error("Invalid parameter type\n"); type &= ~(SLC_EXTERN); } if (type & SLC_OUTPUT) { sdr->undesire(); sdr->desire(type); // Make sure we mark the desired type as READ-ONLY } else { sdr->undesire(); sdr->desire(type | SLC_RDONLY); // Make sure we mark the desired type as READ-ONLY } ;} break; case 31: #line 480 "sl.y" { yyval.code = yyvsp[0].code; sdr->undesire(); // We're done with the type ;} break; case 32: #line 490 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[0].string,sdr->desired(),1); // Add the Parameter to the current CFunction ;} break; case 33: #line 497 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 34: #line 502 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[0].string,sdr->desired(),1); yyval.code = new CNullExpression; ;} break; case 35: #line 513 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[-2].string,sdr->desired() | SLC_ARRAY,-1); ;} break; case 36: #line 520 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 37: #line 528 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[-3].string,sdr->desired() | SLC_ARRAY, atoi(yyvsp[-1].string)); if (cParameter->numItems <= 0) { sdr->error("Array size for %s is invalid (%s)\n",yyvsp[-3].string,yyvsp[-1].string); cParameter->numItems = 1; } ;} break; case 38: #line 540 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 39: #line 547 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[-2].string,sdr->desired() | SLC_ARRAY, -1); yyval.code = new CNullExpression; ;} break; case 40: #line 559 "sl.y" { CParameter *cParameter; cParameter = sdr->newParameter(yyvsp[-3].string,sdr->desired() | SLC_ARRAY, atoi(yyvsp[-1].string)); if (cParameter->numItems <= 0) { sdr->error("Array size for %s is invalid (%s)\n",yyvsp[-3].string,yyvsp[-1].string); cParameter->numItems = 1; } yyval.code = new CNullExpression; ;} break; case 41: #line 580 "sl.y" { CFunction *mainFunction = sdr->newFunction(constantShaderMain); mainFunction->returnValue = NULL; sdr->shaderName = strdup(yyvsp[-1].string); sdr->shaderType = yyvsp[-2].integer; sdr->shaderFunction = mainFunction; ;} break; case 42: #line 591 "sl.y" { sdr->restoreParameters(); ;} break; case 43: #line 595 "sl.y" { CFunction *cFun = sdr->popFunction(); CParameter *cParameter; for (cParameter=cFun->parameters->first();cParameter!=NULL;cParameter=cFun->parameters->next()) { sdr->variables->push(cParameter); } assert(cFun == sdr->shaderFunction); cFun->initExpression = yyvsp[-3].code; cFun->code = yyvsp[0].code; ;} break; case 44: #line 613 "sl.y" { yyval.integer = SLC_SURFACE; ;} break; case 45: #line 618 "sl.y" { yyval.integer = SLC_DISPLACEMENT; ;} break; case 46: #line 623 "sl.y" { yyval.integer = SLC_LIGHT; ;} break; case 47: #line 628 "sl.y" { yyval.integer = SLC_VOLUME; ;} break; case 48: #line 633 "sl.y" { yyval.integer = SLC_TRANSFORMATION; ;} break; case 49: #line 638 "sl.y" { yyval.integer = SLC_IMAGER; ;} break; case 50: #line 647 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 51: #line 651 "sl.y" { yyval.code = new CNullExpression; ;} break; case 52: #line 662 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].code,yyvsp[0].code); ;} break; case 53: #line 668 "sl.y" { yyval.code = yyvsp[-1].code; ;} break; case 54: #line 673 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 55: #line 682 "sl.y" { int type = yyvsp[0].integer; if (type & SLC_VARYING) { } else { type |= SLC_UNIFORM; } // FIXME: Shaders have uniform variables only //type |= SLC_UNIFORM; sdr->undesire(); sdr->desire(type); ;} break; case 56: #line 697 "sl.y" { yyval.code = yyvsp[0].code; if (yyvsp[-2].integer & (SLC_EXTERN)) { sdr->error("Invalid parameter type for the shader\n"); } sdr->undesire(); ;} break; case 57: #line 713 "sl.y" { //if (!(sdr->desired() & SLC_VARYING)) { yyval.code = getAssignment(sdr->variableList,yyvsp[0].expression); //} else { // CVariable *cVar; // while((cVar = sdr->variableList->pop()) != NULL) { // } // $$ = new CNullExpression; //} ;} break; case 58: #line 727 "sl.y" { //if (!(sdr->desired() & SLC_VARYING)) yyval.code = getAssignment(sdr->variableList,yyvsp[0].array); //else { // CVariable *cVar; // while((cVar = sdr->variableList->pop()) != NULL) { // } // $$ = new CNullExpression; //} ;} break; case 59: #line 745 "sl.y" { CParameter *cParameter = sdr->newParameter(yyvsp[-1].string,sdr->desired() | SLC_PARAMETER,1); sdr->variableList->push(cParameter); // Save the parameter so that we can generate init code later ;} break; case 60: #line 751 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 61: #line 756 "sl.y" { CParameter *cParameter = sdr->newParameter(yyvsp[0].string,sdr->desired() | SLC_PARAMETER,1); sdr->variableList->push(cParameter); ;} break; case 62: #line 762 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 63: #line 771 "sl.y" { CParameter *cParameter = sdr->newParameter(yyvsp[-4].string,sdr->desired() | SLC_PARAMETER | SLC_ARRAY,atoi(yyvsp[-2].string)); if (cParameter->numItems <= 0) { sdr->error("Array size for %s is invalid (%s)\n",yyvsp[-4].string,yyvsp[-2].string); cParameter->numItems = 1; } sdr->variableList->push(cParameter); ;} break; case 64: #line 782 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 65: #line 790 "sl.y" { CParameter *cParameter = sdr->newParameter(yyvsp[-3].string,sdr->desired() | SLC_PARAMETER | SLC_ARRAY,atoi(yyvsp[-1].string)); // Get the parameter if (cParameter->numItems <= 0) { sdr->error("Array size for %s is invalid (%s)\n",yyvsp[-3].string,yyvsp[-1].string); cParameter->numItems = 1; } sdr->variableList->push(cParameter); ;} break; case 66: #line 802 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 67: #line 807 "sl.y" { yyval.code = new CNullExpression; ;} break; case 68: #line 815 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 69: #line 822 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].code,yyvsp[0].code); ;} break; case 70: #line 832 "sl.y" { CFunction *cFun = sdr->newFunction(constantBlockName); ;} break; case 71: #line 837 "sl.y" { CFunction *cFun = sdr->popFunction(); cFun->code = yyvsp[-1].code; yyval.code = new CFuncallExpression(cFun,NULL); ;} break; case 72: #line 853 "sl.y" { CVariable *cVar; if (yyvsp[-1].integer & (SLC_OUTPUT | SLC_RDONLY)) { sdr->error("Invalid container class for local variables\n"); } // Remove the uninitialized variables from the list while((cVar = (CVariable *) sdr->variableList->pop()) != NULL); sdr->undesire(); yyval.code = yyvsp[0].code; ;} break; case 73: #line 874 "sl.y" { yyval.code = getAssignment(sdr->variableList,yyvsp[0].expression); ;} break; case 74: #line 880 "sl.y" { yyval.code = getAssignment(sdr->variableList,yyvsp[0].array); ;} break; case 75: #line 887 "sl.y" { CVariable *cVar; cVar = sdr->newVariable(yyvsp[0].string,sdr->desired(),1); sdr->variableList->push(cVar); ;} break; case 76: #line 895 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 77: #line 900 "sl.y" { CVariable *cVar; cVar = sdr->newVariable(yyvsp[0].string,sdr->desired(),1); sdr->variableList->push(cVar); ;} break; case 78: #line 909 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-1].code,yyvsp[0].code); ;} break; case 79: #line 918 "sl.y" { CVariable *cVar; cVar = sdr->newVariable(yyvsp[-3].string,sdr->desired() | SLC_ARRAY,atoi(yyvsp[-1].string)); if (cVar->numItems <= 0) { sdr->error("Array size is invalid for %s (%s)\n",yyvsp[-3].string,yyvsp[-1].string); cVar->numItems = 1; } sdr->variableList->push(cVar); ;} break; case 80: #line 931 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 81: #line 939 "sl.y" { CVariable *cVar; cVar = sdr->newVariable(yyvsp[-3].string,sdr->desired() | SLC_ARRAY,atoi(yyvsp[-1].string)); if (cVar->numItems <= 0) { sdr->error("Array size is invalid for %s (%s)\n",yyvsp[-3].string,yyvsp[-1].string); cVar->numItems = 1; } sdr->variableList->push(cVar); ;} break; case 82: #line 955 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-1].code,yyvsp[0].code); ;} break; case 83: #line 963 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 84: #line 968 "sl.y" { yyval.code = new CNullExpression; ;} break; case 85: #line 978 "sl.y" { yyval.code = yyvsp[0].code; assert(sdr->desired() & SLC_NONE); ;} break; case 86: #line 985 "sl.y" { yyval.code = yyvsp[0].code; assert(sdr->desired() & SLC_NONE); ;} break; case 87: #line 991 "sl.y" { // Recoverable error happened yyval.code = new CNullExpression; assert(sdr->desired() & SLC_NONE); ;} break; case 88: #line 1002 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-1].code,yyvsp[0].code); ;} break; case 89: #line 1006 "sl.y" { yyval.code = new CNullExpression; ;} break; case 90: #line 1016 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 91: #line 1021 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 92: #line 1026 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 93: #line 1031 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 94: #line 1036 "sl.y" { yyval.code = yyvsp[-1].expression; ;} break; case 95: #line 1041 "sl.y" { yyval.code = yyvsp[-1].expression; ;} break; case 96: #line 1046 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 97: #line 1051 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 98: #line 1056 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 99: #line 1061 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 100: #line 1066 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 101: #line 1071 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 102: #line 1076 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 103: #line 1081 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 104: #line 1086 "sl.y" { yyval.code = new CNullExpression; ;} break; case 105: #line 1091 "sl.y" { yyval.code = yyvsp[-1].expression; ;} break; case 106: #line 1096 "sl.y" { yyval.code = new CNullExpression; ;} break; case 107: #line 1105 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 108: #line 1110 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 109: #line 1115 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 110: #line 1120 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 111: #line 1125 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 112: #line 1130 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 113: #line 1135 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 114: #line 1144 "sl.y" { CFunction *cFunction; int bc; char tmp[256]; if (sscanf(yyvsp[-1].string,"%d",&bc) != 1) sdr->error("Invalid break count: %s\n",yyvsp[-1].string); if (bc <= 0) sdr->error("Bad break count: %s\n",yyvsp[-1].string); for(cFunction = sdr->functionStack->last(); cFunction != NULL; cFunction = sdr->functionStack->prev()) { if (strcmp(cFunction->symbolName,constantLoopName) == 0) bc--; else if (strcmp(cFunction->symbolName,constantBlockName) == 0) continue; if (bc == 0) break; sdr->error("Break target not found\n"); break; } if (cFunction == NULL) sdr->error("Break target not found\n"); sprintf(tmp,"%s\t%s\n",opcodeBreak,yyvsp[-1].string); yyval.code = new CFixedExpression(tmp); ;} break; case 115: #line 1171 "sl.y" { CFunction *cFunction; char tmp[256]; int bc = (int) 1; sdr->functionStack->push(sdr->lastFunction); for(cFunction = sdr->functionStack->last(); cFunction != NULL; cFunction = sdr->functionStack->prev()) { if (strcmp(cFunction->symbolName,constantLoopName) == 0) bc--; else if (strcmp(cFunction->symbolName,constantBlockName) == 0) continue; if (bc == 0) break; sdr->error("Break target not found\n"); break; } sdr->lastFunction = sdr->functionStack->pop(); if (cFunction == NULL) sdr->error("Break target not found\n"); sprintf(tmp,"%s\t1\n",opcodeBreak); yyval.code = new CFixedExpression(tmp); ;} break; case 116: #line 1200 "sl.y" { CFunction *cFunction; char tmp[256]; int bc; if (sscanf(yyvsp[-1].string,"%d",&bc) != 1) sdr->error("Bad continue count: %s\n",yyvsp[-1].string); if (bc <= 0) sdr->error("Bad continue count: %s\n",yyvsp[-1].string); for(cFunction = sdr->functionStack->last(); cFunction != NULL; cFunction = sdr->functionStack->prev()) { if (strcmp(cFunction->symbolName,constantLoopName) == 0) bc--; else if (strcmp(cFunction->symbolName,constantBlockName) == 0) continue; if (bc == 0) break; sdr->error("Continue target not found\n"); break; } if (cFunction == NULL) sdr->error("Continue target not found\n"); sprintf(tmp,"%s\t%s\n",opcodeContinue,yyvsp[-1].string); yyval.code = new CFixedExpression(tmp); ;} break; case 117: #line 1227 "sl.y" { CFunction *cFunction; char tmp[256]; int bc = (int) 1; for(cFunction = sdr->functionStack->last(); cFunction != NULL; cFunction = sdr->functionStack->prev()) { if (strcmp(cFunction->symbolName,constantLoopName) == 0) bc--; else if (strcmp(cFunction->symbolName,constantBlockName) == 0) continue; if (bc == 0) break; sdr->error("Continue target not found\n"); break; } if (cFunction == NULL) sdr->error("Continue target not found\n"); sprintf(tmp,"%s\t1\n",opcodeContinue); yyval.code = new CFixedExpression(tmp); ;} break; case 118: #line 1254 "sl.y" { CFunction *cFun = sdr->lastFunction; CExpression *c; // Skip over loops for (cFun = sdr->functionStack->last(); cFun != NULL; cFun = sdr->functionStack->prev()) { if (strcmp(cFun->symbolName,constantBlockName) == 0) continue; if (strcmp(cFun->symbolName,constantLoopName) == 0) continue; break; } if (cFun == NULL) { sdr->error("Return target not found\n"); yyval.code = new CNullExpression; } else { if (cFun->returnValue == NULL) { sdr->error("Function %s was not expecting a return value\n",cFun->symbolName); c = new CNullExpression; } else { c = new CAssignmentExpression(cFun->returnValue,yyvsp[-1].expression); } yyval.code = c; cFun->returnValueGiven = TRUE; } ;} break; case 119: #line 1283 "sl.y" { CFunction *cFun = sdr->lastFunction; // Skip over loops for (cFun = sdr->functionStack->last(); cFun != NULL; cFun = sdr->functionStack->prev()) { if (strcmp(cFun->symbolName,constantBlockName) == 0) continue; if (strcmp(cFun->symbolName,constantLoopName) == 0) continue; break; } if (cFun == NULL) sdr->error("Return target not found\n"); else { if (cFun->returnValue != NULL) { sdr->error("Function %s was expecting a return value\n",cFun->symbolName); } } ;} break; case 120: #line 1310 "sl.y" { CFunction *cFun = sdr->newFunction(constantLoopName); yyval.expression = yyvsp[-1].expression; ;} break; case 121: #line 1321 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CForLoop(NULL,yyvsp[-1].expression,NULL,yyvsp[0].code); ;} break; case 122: #line 1331 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CForLoop(NULL,yyvsp[-1].expression,NULL,yyvsp[0].code); ;} break; case 123: #line 1344 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else sdr->desire(cVar->type); ;} break; case 124: #line 1351 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CAssignmentExpression(cVar,yyvsp[0].expression); sdr->undesire(); } ;} break; case 125: #line 1367 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else sdr->desire(cVar->type); ;} break; case 126: #line 1374 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-6].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayAssignmentExpression(cVar,yyvsp[-4].expression,yyvsp[0].expression); sdr->undesire(); } ;} break; case 127: #line 1391 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else sdr->desire(cVar->type); ;} break; case 128: #line 1398 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CUpdateExpression(cVar,opcodeAddFloatFloat,opcodeAddVectorVector,FALSE,yyvsp[0].expression); sdr->undesire(); } ;} break; case 129: #line 1411 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else sdr->desire(cVar->type); ;} break; case 130: #line 1418 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CUpdateExpression(cVar,opcodeSubFloatFloat,opcodeSubVectorVector,FALSE,yyvsp[0].expression); sdr->undesire(); } ;} break; case 131: #line 1431 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else { yyval.expression = new CUpdateExpression(cVar,opcodeAddFloatFloat,opcodeAddVectorVector,FALSE,new CConstantTerminalExpression(SLC_FLOAT,strdup("1"))); } ;} break; case 132: #line 1442 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else { yyval.expression = new CUpdateExpression(cVar,opcodeAddFloatFloat,opcodeAddVectorVector,FALSE,new CConstantTerminalExpression(SLC_FLOAT,strdup("-1"))); } ;} break; case 133: #line 1453 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else sdr->desire(cVar->type); ;} break; case 134: #line 1460 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CUpdateExpression(cVar,opcodeMulFloatFloat,opcodeMulVectorVector,FALSE,yyvsp[0].expression); sdr->undesire(); } ;} break; case 135: #line 1473 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-1].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-1].string); else sdr->desire(cVar->type); ;} break; case 136: #line 1480 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CUpdateExpression(cVar,opcodeDivFloatFloat,opcodeDivVectorVector,FALSE,yyvsp[0].expression); sdr->undesire(); } ;} break; case 137: #line 1496 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else sdr->desire(cVar->type); ;} break; case 138: #line 1503 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-6].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-4].expression,yyvsp[0].expression,opcodeAddFloatFloat,opcodeAddVectorVector,opcodeAddMatrixMatrix); sdr->undesire(); } ;} break; case 139: #line 1519 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else sdr->desire(cVar->type); ;} break; case 140: #line 1526 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-6].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-4].expression,yyvsp[0].expression,opcodeSubFloatFloat,opcodeSubVectorVector,opcodeSubMatrixMatrix); sdr->undesire(); } ;} break; case 141: #line 1542 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-2].expression,new CConstantTerminalExpression(SLC_FLOAT,strdup("1")),opcodeAddFloatFloat,opcodeAddVectorVector,opcodeAddMatrixMatrix); } ;} break; case 142: #line 1556 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-2].expression,new CConstantTerminalExpression(SLC_FLOAT,strdup("-1")),opcodeAddFloatFloat,opcodeAddVectorVector,opcodeAddMatrixMatrix); } ;} break; case 143: #line 1570 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else sdr->desire(cVar->type); ;} break; case 144: #line 1577 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-6].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-4].expression,yyvsp[0].expression,opcodeMulFloatFloat,opcodeMulVectorVector,opcodeMulMatrixMatrix); sdr->undesire(); } ;} break; case 145: #line 1593 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-4].string); if (cVar == NULL) sdr->error("Identifier %s not found\n",yyvsp[-4].string); else sdr->desire(cVar->type); ;} break; case 146: #line 1600 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-6].string); if (cVar == NULL) { yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayUpdateExpression(cVar,yyvsp[-4].expression,yyvsp[0].expression,opcodeDivFloatFloat,opcodeDivVectorVector,opcodeDivMatrixMatrix); sdr->undesire(); } ;} break; case 147: #line 1616 "sl.y" { CFunction *cFun = sdr->newFunction(constantLoopName); ;} break; case 148: #line 1630 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CForLoop(yyvsp[-6].code,yyvsp[-4].expression,yyvsp[-2].code,yyvsp[0].code); ;} break; case 149: #line 1647 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CForLoop(yyvsp[-6].code,yyvsp[-4].expression,yyvsp[-2].code,yyvsp[0].code); ;} break; case 150: #line 1658 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 151: #line 1662 "sl.y" { yyval.code = new CNullExpression; ;} break; case 152: #line 1673 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].expression,yyvsp[0].code); ;} break; case 153: #line 1678 "sl.y" { yyval.code = yyvsp[0].expression; ;} break; case 154: #line 1687 "sl.y" { yyval.expression = getConversion(SLC_BOOLEAN,yyvsp[0].expression); ;} break; case 155: #line 1691 "sl.y" { yyval.expression = new CConstantTerminalExpression(SLC_BOOLEAN | SLC_UNIFORM,strdup("true")); ;} break; case 156: #line 1700 "sl.y" { yyval.code = yyvsp[0].code; ;} break; case 157: #line 1704 "sl.y" { yyval.code = new CNullExpression; ;} break; case 158: #line 1715 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].expression,yyvsp[0].code); ;} break; case 159: #line 1720 "sl.y" { yyval.code = yyvsp[0].expression; ;} break; case 160: #line 1727 "sl.y" { yyval.code = new CTwoExpressions(yyvsp[-2].expression,yyvsp[0].code); ;} break; case 161: #line 1732 "sl.y" { yyval.code = yyvsp[0].expression; ;} break; case 162: #line 1747 "sl.y" { yyval.code = new CIfThenElse(yyvsp[-4].expression,yyvsp[-2].code,yyvsp[0].code); ;} break; case 163: #line 1760 "sl.y" { yyval.code = new CIfThenElse(yyvsp[-2].expression,yyvsp[0].code,NULL); ;} break; case 164: #line 1771 "sl.y" { yyval.code = new CIfThenElse(yyvsp[-4].expression,yyvsp[-2].code,yyvsp[0].code); ;} break; case 165: #line 1784 "sl.y" { yyval.array->push(yyvsp[0].expression); ;} break; case 166: #line 1789 "sl.y" { sdr->actualParameters->push(yyvsp[0].expression); yyval.array = sdr->actualParameters; ;} break; case 167: #line 1798 "sl.y" { sdr->actualParameterStack->push(sdr->actualParameters); sdr->actualParameters = new CArray; ;} break; case 168: #line 1804 "sl.y" { yyval.array = yyvsp[-1].array; ;} break; case 169: #line 1816 "sl.y" { yyval.code = new CGatherThenElse(yyvsp[-3].array,yyvsp[-2].code,yyvsp[0].code); sdr->actualParameters = sdr->actualParameterStack->pop(); ;} break; case 170: #line 1827 "sl.y" { yyval.code = new CGatherThenElse(yyvsp[-1].array,yyvsp[0].code,NULL); sdr->actualParameters = sdr->actualParameterStack->pop(); ;} break; case 171: #line 1836 "sl.y" { yyval.code = new CGatherThenElse(yyvsp[-3].array,yyvsp[-2].code,yyvsp[0].code); sdr->actualParameters = sdr->actualParameterStack->pop(); ;} break; case 172: #line 1846 "sl.y" { CFunction *cCFunction = sdr->newFunction(constantLoopName); sdr->requiredShaderContext |= SLC_SURFACE; ;} break; case 173: #line 1858 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(NULL,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 174: #line 1871 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(yyvsp[-4].expression,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 175: #line 1886 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(NULL,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 176: #line 1903 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(yyvsp[-8].expression,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 177: #line 1916 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(NULL,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 178: #line 1929 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(yyvsp[-4].expression,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 179: #line 1944 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(NULL,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 180: #line 1961 "sl.y" { CFunction *cFun = sdr->popFunction(); yyval.code = new CIlluminationLoop(yyvsp[-8].expression,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 181: #line 1976 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeIlluminate,opcodeEndIlluminate,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 182: #line 1991 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeIlluminate,opcodeEndIlluminate,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 183: #line 2004 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeIlluminate,opcodeEndIlluminate,yyvsp[-2].expression,NULL,NULL,yyvsp[0].code); ;} break; case 184: #line 2019 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeIlluminate,opcodeEndIlluminate,yyvsp[-6].expression,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].code); ;} break; case 185: #line 2033 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeSolar,opcodeEndSolar,NULL,NULL,NULL,yyvsp[0].code); ;} break; case 186: #line 2046 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeSolar,opcodeEndSolar,yyvsp[-4].expression,yyvsp[-2].expression,NULL,yyvsp[0].code); ;} break; case 187: #line 2058 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeSolar,opcodeEndSolar,NULL,NULL,NULL,yyvsp[0].code); ;} break; case 188: #line 2071 "sl.y" { sdr->requiredShaderContext |= SLC_LIGHT; yyval.code = new CIlluminateSolar(opcodeSolar,opcodeEndSolar,yyvsp[-4].expression,yyvsp[-2].expression,NULL,yyvsp[0].code); ;} break; case 189: #line 2082 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 190: #line 2089 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeAddFloatFloat,opcodeAddVectorVector,opcodeAddMatrixMatrix,NULL,NULL); ;} break; case 191: #line 2096 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeSubFloatFloat,opcodeSubVectorVector,opcodeSubMatrixMatrix,NULL,NULL); ;} break; case 192: #line 2103 "sl.y" { yyval.expression = NULL; if (yyvsp[-2].expression->type & SLC_MATRIX) { if (yyvsp[0].expression->type & SLC_VVECTOR) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VVECTOR,opcodeMulMatrixVector,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } else if (yyvsp[0].expression->type & SLC_VPOINT) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VPOINT,opcodeMulMatrixPoint,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } else if (yyvsp[0].expression->type & SLC_VNORMAL) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VNORMAL,opcodeMulMatrixNormal,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } } if (yyval.expression == NULL) { if (yyvsp[0].expression->type & SLC_MATRIX) { if (yyvsp[-2].expression->type & SLC_VVECTOR) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VVECTOR,opcodeMulVectorMatrix,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } else if (yyvsp[-2].expression->type & SLC_VPOINT) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VPOINT,opcodeMulPointMatrix,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } else if (yyvsp[-2].expression->type & SLC_VNORMAL) { yyval.expression = new CBinaryExpression(SLC_VECTOR | SLC_VNORMAL,opcodeMulNormalMatrix,yyvsp[-2].expression,getConversion(SLC_VECTOR,yyvsp[0].expression)); } } } if (yyval.expression == NULL) yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeMulFloatFloat,opcodeMulVectorVector,opcodeMulMatrixMatrix,NULL,NULL); ;} break; case 193: #line 2136 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeDivFloatFloat,opcodeDivVectorVector,opcodeDivMatrixMatrix,NULL,NULL); ;} break; case 194: #line 2142 "sl.y" { sdr->desire(SLC_VECTOR | SLC_VVECTOR); ;} break; case 195: #line 2146 "sl.y" { sdr->undesire(); yyval.expression = new CBinaryExpression(SLC_FLOAT,opcodeDotProduct,getConversion(SLC_VECTOR,yyvsp[-3].expression),getConversion(SLC_VECTOR,yyvsp[0].expression)); ;} break; case 196: #line 2154 "sl.y" { yyval.expression = new CBinaryExpression(SLC_VECTOR,opcodeCrossProduct,getConversion(SLC_VECTOR,yyvsp[-2].expression),getConversion(SLC_VECTOR,yyvsp[0].expression)); ;} break; case 197: #line 2160 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 198: #line 2166 "sl.y" { yyval.expression = getOperation(yyvsp[0].expression,opcodeNegFloat,opcodeNegVector,opcodeNegMatrix,NULL,NULL); ;} break; case 199: #line 2175 "sl.y" { int ft = yyvsp[-2].expression->type; int st = yyvsp[0].expression->type; if ((yyvsp[-2].expression->type & SLC_TYPE_MASK) == (yyvsp[0].expression->type & SLC_TYPE_MASK)) { yyval.expression = new CConditionalExpression(yyvsp[-2].expression->type,yyvsp[-4].expression,yyvsp[-2].expression,yyvsp[0].expression); } else { sdr->error("Type mismatch in conditional execution\n"); } ;} break; case 200: #line 2191 "sl.y" { yyval.array = yyvsp[-1].array; ;} break; case 201: #line 2200 "sl.y" { yyval.array = yyvsp[0].array; yyval.array->push(yyvsp[-2].expression); ;} break; case 202: #line 2206 "sl.y" { yyval.array = new CArray; yyval.array->push(yyvsp[0].expression); ;} break; case 203: #line 2214 "sl.y" { yyval.expression = new CConstantTerminalExpression(SLC_FLOAT | SLC_UNIFORM,strdup("3.141592654")); ;} break; case 204: #line 2219 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 205: #line 2224 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 206: #line 2229 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 207: #line 2234 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 208: #line 2239 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[0].string); if (cVar == NULL) { sdr->error("Identifier %s not found\n",yyvsp[0].string); yyval.expression = new CNullExpression; } else { yyval.expression = new CTerminalExpression(cVar); } ;} break; case 209: #line 2255 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[-3].string); if (cVar == NULL) { sdr->error("Identifier %s not found\n",yyvsp[-3].string); yyval.expression = new CNullExpression; } else { yyval.expression = new CArrayExpression(cVar,yyvsp[-1].expression); } ;} break; case 210: #line 2267 "sl.y" { yyval.expression = new CConstantTerminalExpression(SLC_FLOAT,strdup(yyvsp[0].string)); ;} break; case 211: #line 2272 "sl.y" { yyval.expression = new CConstantTerminalExpression(SLC_STRING,strdup(yyvsp[0].string)); ;} break; case 212: #line 2283 "sl.y" { yyval.expression = new CVectorExpression(yyvsp[-5].expression,yyvsp[-3].expression,yyvsp[-1].expression); ;} break; case 213: #line 2320 "sl.y" { CExpression *elements[16]; elements[0] = yyvsp[-31].expression; elements[1] = yyvsp[-29].expression; elements[2] = yyvsp[-27].expression; elements[3] = yyvsp[-25].expression; elements[4] = yyvsp[-23].expression; elements[5] = yyvsp[-21].expression; elements[6] = yyvsp[-19].expression; elements[7] = yyvsp[-17].expression; elements[8] = yyvsp[-15].expression; elements[9] = yyvsp[-13].expression; elements[10] = yyvsp[-11].expression; elements[11] = yyvsp[-9].expression; elements[12] = yyvsp[-7].expression; elements[13] = yyvsp[-5].expression; elements[14] = yyvsp[-3].expression; elements[15] = yyvsp[-1].expression; yyval.expression = new CMatrixExpression(elements); ;} break; case 214: #line 2346 "sl.y" { yyval.expression = yyvsp[-1].expression; ;} break; case 215: #line 2355 "sl.y" { yyval.expression = getConversion(yyvsp[-1].integer,yyvsp[0].expression); sdr->undesire(); ;} break; case 216: #line 2364 "sl.y" { yyval.expression = getConversion(yyvsp[-2].integer,yyvsp[-1].string,yyvsp[0].expression); sdr->undesire(); ;} break; case 217: #line 2375 "sl.y" { yyval.expression = yyvsp[-1].expression; ;} break; case 218: #line 2382 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,NULL,NULL,NULL,NULL,opcodeAnd); ;} break; case 219: #line 2389 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,NULL,NULL,NULL,NULL,opcodeOr); ;} break; case 220: #line 2396 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatGreater,opcodeVectorGreater,NULL,NULL,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 221: #line 2404 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatLess,opcodeVectorLess,NULL,NULL,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 222: #line 2412 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatEGreater,opcodeVectorEGreater,NULL,NULL,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 223: #line 2420 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatELess,opcodeVectorELess,NULL,NULL,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 224: #line 2428 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatEqual,opcodeVectorEqual,NULL,opcodeStringEqual,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 225: #line 2436 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,opcodeFloatNotEqual,opcodeVectorNotEqual,NULL,opcodeStringNotEqual,NULL); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 226: #line 2444 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,NULL,NULL,NULL,NULL,opcodeAnd); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 227: #line 2452 "sl.y" { yyval.expression = getOperation(yyvsp[-2].expression,yyvsp[0].expression,NULL,NULL,NULL,NULL,opcodeXor); yyval.expression->type = SLC_BOOLEAN | (yyvsp[-2].expression->type & yyvsp[0].expression->type & SLC_UNIFORM); ;} break; case 228: #line 2459 "sl.y" { yyval.expression = new CUnaryExpression(SLC_BOOLEAN,opcodeNot,getConversion(SLC_BOOLEAN,yyvsp[0].expression)); ;} break; case 229: #line 2469 "sl.y" { CFunctionPrototype *cFun; CArray *parameters = sdr->actualParameters; // This is the list of parameters to the function char *funName = yyvsp[0].string; // Clear the desired type flags sdr->undesire(); // Restore the old parameters sdr->actualParameters = sdr->actualParameterStack->pop(); // Check the builtin functions for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->perfectMatch(yyvsp[0].string,parameters,sdr->desired())) break; } if (cFun == NULL) { for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->match(yyvsp[0].string,parameters,sdr->desired())) break; } } if (cFun != NULL) { yyval.expression = new CBuiltinExpression(cFun,parameters); } else { sdr->error("Function %s not found\n",yyvsp[0].string); if (parameters->numItems != 0) { CExpression *cCode; while((cCode = parameters->pop()) != NULL) { delete cCode; } } delete parameters; yyval.expression = new CNullExpression; } ;} break; case 230: #line 2509 "sl.y" { yyval.expression = yyvsp[0].expression; ;} break; case 231: #line 2519 "sl.y" { // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); // Set the name yyval.string = yyvsp[-1].string; ;} break; case 232: #line 2534 "sl.y" { // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); // Set the name yyval.string = "surface"; ;} break; case 233: #line 2549 "sl.y" { // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); // Set the name yyval.string = "displacement"; ;} break; case 234: #line 2567 "sl.y" { CFunction *cFun; CArray *parameters = sdr->actualParameters; // This is the list of parameters to the function char *funName = yyvsp[-2].string; // Clear the desired type flags sdr->undesire(); // Restore the old parameters sdr->actualParameters = sdr->actualParameterStack->pop(); // Search for the CFunction here.... cFun = sdr->getFunction(yyvsp[-2].string,parameters); if (cFun != NULL) { // Cool, the function exists // A function with the same name is defined ... // Try to match the parameters; if (cFun->parameters->numItems == parameters->numItems) { // The number of parameters match // A function with the same name is defined and the number of Parameters match yyval.expression = new CFuncallExpression(cFun,parameters); } } // If not found, check the predefined CFunctions if (cFun == NULL) { CFunctionPrototype *cFun; char *fName = yyvsp[-2].string; // Check the builtin CFunctions for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->perfectMatch(yyvsp[-2].string,parameters,sdr->desired())) break; } if (cFun == NULL) { for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->match(yyvsp[-2].string,parameters,sdr->desired())) break; } } // Check if there is a DSO implementing this function if (cFun == NULL) { sdr->enumerateDso(yyvsp[-2].string); for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->perfectMatch(yyvsp[-2].string,parameters,sdr->desired())) break; } if (cFun == NULL) { for (cFun = sdr->builtinFunctions->first(); cFun != NULL; cFun = sdr->builtinFunctions->next()) { if (cFun->match(yyvsp[-2].string,parameters,sdr->desired())) break; } } } if (cFun != NULL) { yyval.expression = new CBuiltinExpression(cFun,parameters); } else { sdr->error("Function %s not found\n",yyvsp[-2].string); if (parameters->numItems != 0) { CExpression *cCode; while((cCode = parameters->pop()) != NULL) { delete cCode; } } delete parameters; yyval.expression = new CNullExpression; } } ;} break; case 235: #line 2644 "sl.y" { yyval.code = new CConstantTerminalExpression(SLC_STRING | SLC_UNIFORM,strdup(yyvsp[0].string)); ;} break; case 236: #line 2649 "sl.y" { CVariable *cVar = sdr->getVariable(yyvsp[0].string); if (cVar != NULL) yyval.code = new CTerminalExpression(cVar); else yyval.code = new CNullExpression; ;} break; case 237: #line 2662 "sl.y" { yyval.code = getConversion(SLC_FLOAT | (yyvsp[-1].expression->type & SLC_UNIFORM),yyvsp[-1].expression); ;} break; case 238: #line 2666 "sl.y" { yyval.code = new CConstantTerminalExpression(SLC_FLOAT | SLC_UNIFORM,strdup("0")); ;} break; case 239: #line 2684 "sl.y" { // Fake the parameters CArray *parameters = sdr->actualParameters; // This is the list of parameters to the function CArray *pl = new CArray; CExpression *cExpression; pl->push(yyvsp[-4].code); pl->push(yyvsp[-3].code); for (cExpression=parameters->first();cExpression!=NULL;cExpression=parameters->next()) pl->push(cExpression); delete parameters; sdr->actualParameters = pl; yyval.string = yyvsp[-6].string; ;} break; case 240: #line 2706 "sl.y" { // Fake the parameters CArray *parameters = sdr->actualParameters; // This is the list of parameters to the function CArray *pl = new CArray; CExpression *cExpression; pl->push(yyvsp[-2].code); pl->push(yyvsp[-1].code); for (cExpression=parameters->first();cExpression!=NULL;cExpression=parameters->next()) pl->push(cExpression); delete parameters; sdr->actualParameters = pl; yyval.string = yyvsp[-4].string; ;} break; case 241: #line 2726 "sl.y" { yyval.string = "texture"; // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); ;} break; case 242: #line 2739 "sl.y" { yyval.string = "shadow"; // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); ;} break; case 243: #line 2752 "sl.y" { yyval.string = "environment"; // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); ;} break; case 244: #line 2765 "sl.y" { yyval.string = "bump"; // Save the old parameters sdr->actualParameterStack->push(sdr->actualParameters); // Start a new parameter list sdr->actualParameters = new CArray; // Make sure we do not do something stupid with the parameters sdr->desire(SLC_NONE); ;} break; case 245: #line 2782 "sl.y" { ;} break; case 246: #line 2785 "sl.y" { ;} break; case 247: #line 2792 "sl.y" { sdr->actualParameters->push(yyvsp[-1].expression); ;} break; case 248: #line 2796 "sl.y" { ;} break; case 249: #line 2800 "sl.y" { sdr->actualParameters->push(yyvsp[0].expression); ;} break; } /* Line 1010 of yacc.c. */ #line 4300 "sl.cpp" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 2805 "sl.y" #include "lex.sl.cpp" int CScriptContext::compile(FILE *in,char *outName) { sdr = this; yyin = in; yyparse(); if (compileError == 0) { char *tmp; if (outName == NULL) { // If there's no compile error, dump the compiled code tmp = new char[strlen(sdr->shaderName)+5]; strcpy(tmp,sdr->shaderName); strcat(tmp,".sdr"); } else { tmp = outName; } sdr->generateCode(tmp); if (tmp != outName) delete [] tmp; return TRUE; } return FALSE; } void yyerror(char *mes) { sdr->error("Parse error\n"); }