00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define YYBISON 1
00047
00048
00049 #define YYBISON_VERSION "2.4.1"
00050
00051
00052 #define YYSKELETON_NAME "yacc.c"
00053
00054
00055 #define YYPURE 0
00056
00057
00058 #define YYPUSH 0
00059
00060
00061 #define YYPULL 1
00062
00063
00064 #define YYLSP_NEEDED 0
00065
00066
00067
00068
00069
00070
00071 #line 24 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
00072
00073 #include "api.h"
00074 #include "lux.h"
00075 #include "error.h"
00076 #include "paramset.h"
00077 #include "context.h"
00078 #include "memory.h"
00079 #include <stdarg.h>
00080 #include <sstream>
00081
00082 using namespace lux;
00083
00084 extern int yylex( void );
00085 int line_num = 0;
00086 string current_file;
00087
00088 #define YYMAXDEPTH 100000000
00089
00090 void yyerror( const char *str ) {
00091 std::stringstream ss;
00092 ss<<"Parsing error";
00093 if (current_file != "")
00094 ss << " in file '" << current_file << "'";
00095 if (line_num > 0)
00096 ss << " at line " << line_num;
00097 ss << ": " << str;
00098 luxError( LUX_SYNTAX,LUX_SEVERE,ss.str().c_str());
00099
00100 }
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 int cur_paramlist_allocated = 0;
00115 int cur_paramlist_size = 0;
00116 const char **cur_paramlist_tokens = NULL;
00117 void **cur_paramlist_args = NULL;
00118 int *cur_paramlist_sizes = NULL;
00119 bool *cur_paramlist_texture_helper = NULL;
00120
00121 #define CPS cur_paramlist_size
00122 #define CPT cur_paramlist_tokens
00123 #define CPA cur_paramlist_args
00124 #define CPTH cur_paramlist_texture_helper
00125 #define CPSZ cur_paramlist_sizes
00126
00127 typedef struct ParamArray {
00128 int element_size;
00129 int allocated;
00130 int nelems;
00131 void *array;
00132 } ParamArray;
00133
00134 ParamArray *cur_array = NULL;
00135 bool array_is_single_string = false;
00136
00137 #define NA(r) ((float *) r->array)
00138 #define SA(r) ((const char **) r->array)
00139
00140 void AddArrayElement( void *elem ) {
00141 if (cur_array->nelems >= cur_array->allocated) {
00142 cur_array->allocated = 2*cur_array->allocated + 1;
00143 cur_array->array = realloc( cur_array->array,
00144 cur_array->allocated*cur_array->element_size );
00145 }
00146 char *next = ((char *)cur_array->array) + cur_array->nelems *
00147 cur_array->element_size;
00148 memcpy( next, elem, cur_array->element_size );
00149 cur_array->nelems++;
00150 }
00151
00152 ParamArray *ArrayDup( ParamArray *ra )
00153 {
00154 ParamArray *ret = new ParamArray;
00155 ret->element_size = ra->element_size;
00156 ret->allocated = ra->allocated;
00157 ret->nelems = ra->nelems;
00158 ret->array = malloc(ra->nelems * ra->element_size);
00159 memcpy( ret->array, ra->array, ra->nelems * ra->element_size );
00160 return ret;
00161 }
00162
00163 void ArrayFree( ParamArray *ra )
00164 {
00165 free(ra->array);
00166 delete ra;
00167 }
00168
00169 void FreeArgs()
00170 {
00171 for (int i = 0; i < cur_paramlist_size; ++i) {
00172
00173 if(memcmp("string", cur_paramlist_tokens[i], 6) == 0 ||
00174 memcmp("texture", cur_paramlist_tokens[i], 6) == 0) {
00175 for (int j = 0; j < cur_paramlist_sizes[i]; ++j)
00176 free(((char **)cur_paramlist_args[i])[j]);
00177 }
00178 delete[] ((char *)cur_paramlist_args[i]);
00179 }
00180 }
00181
00182 static bool VerifyArrayLength( ParamArray *arr, int required,
00183 const char *command ) {
00184 if (arr->nelems != required) {
00185 std::stringstream ss;
00186 ss<<command<<" requires a(n) "<<required<<" element array!";
00187
00188 return false;
00189 }
00190 return true;
00191 }
00192 enum { PARAM_TYPE_INT, PARAM_TYPE_BOOL, PARAM_TYPE_FLOAT, PARAM_TYPE_POINT,
00193 PARAM_TYPE_VECTOR, PARAM_TYPE_NORMAL, PARAM_TYPE_COLOR,
00194 PARAM_TYPE_STRING, PARAM_TYPE_TEXTURE };
00195 static void InitParamSet(ParamSet &ps, int count, const char **tokens,
00196 void **args, int *sizes, bool *texture_helper);
00197 static bool lookupType(const char *token, int *type, string &name);
00198 #define YYPRINT(file, type, value) \
00199 { \
00200 if ((type) == ID || (type) == STRING) \
00201 fprintf ((file), " %s", (value).string); \
00202 else if ((type) == NUM) \
00203 fprintf ((file), " %f", (value).num); \
00204 }
00205
00206
00207
00208 #line 209 "/builddir/build/BUILD/lux-0.6.1/build/luxparse.cpp"
00209
00210
00211 #ifndef YYDEBUG
00212 # define YYDEBUG 0
00213 #endif
00214
00215
00216 #ifdef YYERROR_VERBOSE
00217 # undef YYERROR_VERBOSE
00218 # define YYERROR_VERBOSE 1
00219 #else
00220 # define YYERROR_VERBOSE 0
00221 #endif
00222
00223
00224 #ifndef YYTOKEN_TABLE
00225 # define YYTOKEN_TABLE 0
00226 #endif
00227
00228
00229
00230 #ifndef YYTOKENTYPE
00231 # define YYTOKENTYPE
00232
00233
00234 enum yytokentype {
00235 STRING = 258,
00236 ID = 259,
00237 NUM = 260,
00238 LBRACK = 261,
00239 RBRACK = 262,
00240 ACCELERATOR = 263,
00241 AREALIGHTSOURCE = 264,
00242 ATTRIBUTEBEGIN = 265,
00243 ATTRIBUTEEND = 266,
00244 CAMERA = 267,
00245 CONCATTRANSFORM = 268,
00246 COORDINATESYSTEM = 269,
00247 COORDSYSTRANSFORM = 270,
00248 FILM = 271,
00249 IDENTITY = 272,
00250 LIGHTSOURCE = 273,
00251 LOOKAT = 274,
00252 MATERIAL = 275,
00253 MAKENAMEDMATERIAL = 276,
00254 NAMEDMATERIAL = 277,
00255 OBJECTBEGIN = 278,
00256 OBJECTEND = 279,
00257 OBJECTINSTANCE = 280,
00258 MOTIONINSTANCE = 281,
00259 LIGHTGROUP = 282,
00260 PIXELFILTER = 283,
00261 REVERSEORIENTATION = 284,
00262 ROTATE = 285,
00263 SAMPLER = 286,
00264 SCALE = 287,
00265 SEARCHPATH = 288,
00266 PORTALSHAPE = 289,
00267 SHAPE = 290,
00268 SURFACEINTEGRATOR = 291,
00269 TEXTURE = 292,
00270 TRANSFORMBEGIN = 293,
00271 TRANSFORMEND = 294,
00272 TRANSFORM = 295,
00273 TRANSLATE = 296,
00274 VOLUME = 297,
00275 VOLUMEINTEGRATOR = 298,
00276 WORLDBEGIN = 299,
00277 WORLDEND = 300,
00278 HIGH_PRECEDENCE = 301
00279 };
00280 #endif
00281
00282 #define STRING 258
00283 #define ID 259
00284 #define NUM 260
00285 #define LBRACK 261
00286 #define RBRACK 262
00287 #define ACCELERATOR 263
00288 #define AREALIGHTSOURCE 264
00289 #define ATTRIBUTEBEGIN 265
00290 #define ATTRIBUTEEND 266
00291 #define CAMERA 267
00292 #define CONCATTRANSFORM 268
00293 #define COORDINATESYSTEM 269
00294 #define COORDSYSTRANSFORM 270
00295 #define FILM 271
00296 #define IDENTITY 272
00297 #define LIGHTSOURCE 273
00298 #define LOOKAT 274
00299 #define MATERIAL 275
00300 #define MAKENAMEDMATERIAL 276
00301 #define NAMEDMATERIAL 277
00302 #define OBJECTBEGIN 278
00303 #define OBJECTEND 279
00304 #define OBJECTINSTANCE 280
00305 #define MOTIONINSTANCE 281
00306 #define LIGHTGROUP 282
00307 #define PIXELFILTER 283
00308 #define REVERSEORIENTATION 284
00309 #define ROTATE 285
00310 #define SAMPLER 286
00311 #define SCALE 287
00312 #define SEARCHPATH 288
00313 #define PORTALSHAPE 289
00314 #define SHAPE 290
00315 #define SURFACEINTEGRATOR 291
00316 #define TEXTURE 292
00317 #define TRANSFORMBEGIN 293
00318 #define TRANSFORMEND 294
00319 #define TRANSFORM 295
00320 #define TRANSLATE 296
00321 #define VOLUME 297
00322 #define VOLUMEINTEGRATOR 298
00323 #define WORLDBEGIN 299
00324 #define WORLDEND 300
00325 #define HIGH_PRECEDENCE 301
00326
00327
00328
00329
00330 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00331 typedef union YYSTYPE
00332 {
00333
00334
00335 #line 159 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
00336
00337 char string[1024];
00338 float num;
00339 ParamArray *ribarray;
00340
00341
00342
00343
00344 #line 345 "/builddir/build/BUILD/lux-0.6.1/build/luxparse.cpp"
00345 } YYSTYPE;
00346 # define YYSTYPE_IS_TRIVIAL 1
00347 # define yystype YYSTYPE
00348 # define YYSTYPE_IS_DECLARED 1
00349 #endif
00350
00351
00352
00353
00354
00355
00356 #line 357 "/builddir/build/BUILD/lux-0.6.1/build/luxparse.cpp"
00357
00358 #ifdef short
00359 # undef short
00360 #endif
00361
00362 #ifdef YYTYPE_UINT8
00363 typedef YYTYPE_UINT8 yytype_uint8;
00364 #else
00365 typedef unsigned char yytype_uint8;
00366 #endif
00367
00368 #ifdef YYTYPE_INT8
00369 typedef YYTYPE_INT8 yytype_int8;
00370 #elif (defined __STDC__ || defined __C99__FUNC__ \
00371 || defined __cplusplus || defined _MSC_VER)
00372 typedef signed char yytype_int8;
00373 #else
00374 typedef short int yytype_int8;
00375 #endif
00376
00377 #ifdef YYTYPE_UINT16
00378 typedef YYTYPE_UINT16 yytype_uint16;
00379 #else
00380 typedef unsigned short int yytype_uint16;
00381 #endif
00382
00383 #ifdef YYTYPE_INT16
00384 typedef YYTYPE_INT16 yytype_int16;
00385 #else
00386 typedef short int yytype_int16;
00387 #endif
00388
00389 #ifndef YYSIZE_T
00390 # ifdef __SIZE_TYPE__
00391 # define YYSIZE_T __SIZE_TYPE__
00392 # elif defined size_t
00393 # define YYSIZE_T size_t
00394 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00395 || defined __cplusplus || defined _MSC_VER)
00396 # include <stddef.h>
00397 # define YYSIZE_T size_t
00398 # else
00399 # define YYSIZE_T unsigned int
00400 # endif
00401 #endif
00402
00403 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00404
00405 #ifndef YY_
00406 # if YYENABLE_NLS
00407 # if ENABLE_NLS
00408 # include <libintl.h>
00409 # define YY_(msgid) dgettext ("bison-runtime", msgid)
00410 # endif
00411 # endif
00412 # ifndef YY_
00413 # define YY_(msgid) msgid
00414 # endif
00415 #endif
00416
00417
00418 #if ! defined lint || defined __GNUC__
00419 # define YYUSE(e) ((void) (e))
00420 #else
00421 # define YYUSE(e)
00422 #endif
00423
00424
00425 #ifndef lint
00426 # define YYID(n) (n)
00427 #else
00428 #if (defined __STDC__ || defined __C99__FUNC__ \
00429 || defined __cplusplus || defined _MSC_VER)
00430 static int
00431 YYID (int yyi)
00432 #else
00433 static int
00434 YYID (yyi)
00435 int yyi;
00436 #endif
00437 {
00438 return yyi;
00439 }
00440 #endif
00441
00442 #if ! defined yyoverflow || YYERROR_VERBOSE
00443
00444
00445
00446 # ifdef YYSTACK_USE_ALLOCA
00447 # if YYSTACK_USE_ALLOCA
00448 # ifdef __GNUC__
00449 # define YYSTACK_ALLOC __builtin_alloca
00450 # elif defined __BUILTIN_VA_ARG_INCR
00451 # include <alloca.h>
00452 # elif defined _AIX
00453 # define YYSTACK_ALLOC __alloca
00454 # elif defined _MSC_VER
00455 # include <malloc.h>
00456 # define alloca _alloca
00457 # else
00458 # define YYSTACK_ALLOC alloca
00459 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00460 || defined __cplusplus || defined _MSC_VER)
00461 # include <stdlib.h>
00462 # ifndef _STDLIB_H
00463 # define _STDLIB_H 1
00464 # endif
00465 # endif
00466 # endif
00467 # endif
00468 # endif
00469
00470 # ifdef YYSTACK_ALLOC
00471
00472 # define YYSTACK_FREE(Ptr) do { ; } while (YYID (0))
00473 # ifndef YYSTACK_ALLOC_MAXIMUM
00474
00475
00476
00477
00478 # define YYSTACK_ALLOC_MAXIMUM 4032
00479 # endif
00480 # else
00481 # define YYSTACK_ALLOC YYMALLOC
00482 # define YYSTACK_FREE YYFREE
00483 # ifndef YYSTACK_ALLOC_MAXIMUM
00484 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00485 # endif
00486 # if (defined __cplusplus && ! defined _STDLIB_H \
00487 && ! ((defined YYMALLOC || defined malloc) \
00488 && (defined YYFREE || defined free)))
00489 # include <stdlib.h>
00490 # ifndef _STDLIB_H
00491 # define _STDLIB_H 1
00492 # endif
00493 # endif
00494 # ifndef YYMALLOC
00495 # define YYMALLOC malloc
00496 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00497 || defined __cplusplus || defined _MSC_VER)
00498 void *malloc (YYSIZE_T);
00499 # endif
00500 # endif
00501 # ifndef YYFREE
00502 # define YYFREE free
00503 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00504 || defined __cplusplus || defined _MSC_VER)
00505 void free (void *);
00506 # endif
00507 # endif
00508 # endif
00509 #endif
00510
00511
00512 #if (! defined yyoverflow \
00513 && (! defined __cplusplus \
00514 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00515
00516
00517 union yyalloc
00518 {
00519 yytype_int16 yyss_alloc;
00520 YYSTYPE yyvs_alloc;
00521 };
00522
00523
00524 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00525
00526
00527
00528 # define YYSTACK_BYTES(N) \
00529 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00530 + YYSTACK_GAP_MAXIMUM)
00531
00532
00533
00534 # ifndef YYCOPY
00535 # if defined __GNUC__ && 1 < __GNUC__
00536 # define YYCOPY(To, From, Count) \
00537 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00538 # else
00539 # define YYCOPY(To, From, Count) \
00540 do \
00541 { \
00542 YYSIZE_T yyi; \
00543 for (yyi = 0; yyi < (Count); yyi++) \
00544 (To)[yyi] = (From)[yyi]; \
00545 } \
00546 while (YYID (0))
00547 # endif
00548 # endif
00549
00550
00551
00552
00553
00554
00555 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
00556 do \
00557 { \
00558 YYSIZE_T yynewbytes; \
00559 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
00560 Stack = &yyptr->Stack_alloc; \
00561 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00562 yyptr += yynewbytes / sizeof (*yyptr); \
00563 } \
00564 while (YYID (0))
00565
00566 #endif
00567
00568
00569 #define YYFINAL 75
00570
00571 #define YYLAST 122
00572
00573
00574 #define YYNTOKENS 47
00575
00576 #define YYNNTS 22
00577
00578 #define YYNRULES 66
00579
00580 #define YYNSTATES 141
00581
00582
00583 #define YYUNDEFTOK 2
00584 #define YYMAXUTOK 301
00585
00586 #define YYTRANSLATE(YYX) \
00587 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00588
00589
00590 static const yytype_uint8 yytranslate[] =
00591 {
00592 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00617 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
00618 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
00619 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
00620 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
00621 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
00622 45, 46
00623 };
00624
00625 #if YYDEBUG
00626
00627
00628 static const yytype_uint8 yyprhs[] =
00629 {
00630 0, 0, 3, 5, 6, 7, 8, 10, 12, 14,
00631 16, 21, 24, 27, 29, 32, 34, 36, 41, 44,
00632 47, 49, 52, 55, 56, 59, 60, 63, 66, 68,
00633 72, 76, 78, 80, 84, 87, 90, 93, 97, 99,
00634 103, 107, 118, 122, 126, 130, 133, 135, 138, 144,
00635 148, 150, 156, 160, 165, 168, 172, 176, 180, 186,
00636 188, 190, 193, 198, 202, 206, 208
00637 };
00638
00639
00640 static const yytype_int8 yyrhs[] =
00641 {
00642 48, 0, -1, 67, -1, -1, -1, -1, 53, -1,
00643 58, -1, 54, -1, 55, -1, 49, 6, 56, 7,
00644 -1, 49, 57, -1, 56, 57, -1, 57, -1, 50,
00645 3, -1, 59, -1, 60, -1, 49, 6, 61, 7,
00646 -1, 49, 62, -1, 61, 62, -1, 62, -1, 51,
00647 5, -1, 64, 65, -1, -1, 66, 65, -1, -1,
00648 3, 52, -1, 67, 68, -1, 68, -1, 8, 3,
00649 63, -1, 9, 3, 63, -1, 10, -1, 11, -1,
00650 12, 3, 63, -1, 13, 58, -1, 14, 3, -1,
00651 15, 3, -1, 16, 3, 63, -1, 17, -1, 27,
00652 3, 63, -1, 18, 3, 63, -1, 19, 5, 5,
00653 5, 5, 5, 5, 5, 5, 5, -1, 20, 3,
00654 63, -1, 21, 3, 63, -1, 22, 3, 63, -1,
00655 23, 3, -1, 24, -1, 25, 3, -1, 26, 3,
00656 5, 5, 3, -1, 28, 3, 63, -1, 29, -1,
00657 30, 5, 5, 5, 5, -1, 31, 3, 63, -1,
00658 32, 5, 5, 5, -1, 33, 3, -1, 35, 3,
00659 63, -1, 34, 3, 63, -1, 36, 3, 63, -1,
00660 37, 3, 3, 3, 63, -1, 38, -1, 39, -1,
00661 40, 59, -1, 41, 5, 5, 5, -1, 43, 3,
00662 63, -1, 42, 3, 63, -1, 44, -1, 45, -1
00663 };
00664
00665
00666 static const yytype_uint16 yyrline[] =
00667 {
00668 0, 181, 181, 185, 195, 200, 205, 209, 214, 218,
00669 224, 229, 233, 236, 240, 246, 250, 255, 260, 264,
00670 267, 271, 277, 281, 286, 290, 293, 311, 314, 318,
00671 325, 332, 336, 340, 347, 353, 357, 361, 368, 372,
00672 379, 386, 390, 397, 404, 411, 415, 419, 423, 427,
00673 434, 438, 442, 449, 453, 457, 464, 471, 478, 485,
00674 489, 493, 499, 503, 510, 517, 521
00675 };
00676 #endif
00677
00678 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00679
00680
00681 static const char *const yytname[] =
00682 {
00683 "$end", "error", "$undefined", "STRING", "ID", "NUM", "LBRACK",
00684 "RBRACK", "ACCELERATOR", "AREALIGHTSOURCE", "ATTRIBUTEBEGIN",
00685 "ATTRIBUTEEND", "CAMERA", "CONCATTRANSFORM", "COORDINATESYSTEM",
00686 "COORDSYSTRANSFORM", "FILM", "IDENTITY", "LIGHTSOURCE", "LOOKAT",
00687 "MATERIAL", "MAKENAMEDMATERIAL", "NAMEDMATERIAL", "OBJECTBEGIN",
00688 "OBJECTEND", "OBJECTINSTANCE", "MOTIONINSTANCE", "LIGHTGROUP",
00689 "PIXELFILTER", "REVERSEORIENTATION", "ROTATE", "SAMPLER", "SCALE",
00690 "SEARCHPATH", "PORTALSHAPE", "SHAPE", "SURFACEINTEGRATOR", "TEXTURE",
00691 "TRANSFORMBEGIN", "TRANSFORMEND", "TRANSFORM", "TRANSLATE", "VOLUME",
00692 "VOLUMEINTEGRATOR", "WORLDBEGIN", "WORLDEND", "HIGH_PRECEDENCE",
00693 "$accept", "start", "array_init", "string_array_init", "num_array_init",
00694 "array", "string_array", "real_string_array",
00695 "single_element_string_array", "string_list", "string_list_entry",
00696 "num_array", "real_num_array", "single_element_num_array", "num_list",
00697 "num_list_entry", "paramlist", "paramlist_init", "paramlist_contents",
00698 "paramlist_entry", "ri_stmt_list", "ri_stmt", 0
00699 };
00700 #endif
00701
00702 # ifdef YYPRINT
00703
00704
00705 static const yytype_uint16 yytoknum[] =
00706 {
00707 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
00708 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
00709 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
00710 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
00711 295, 296, 297, 298, 299, 300, 301
00712 };
00713 # endif
00714
00715
00716 static const yytype_uint8 yyr1[] =
00717 {
00718 0, 47, 48, 49, 50, 51, 52, 52, 53, 53,
00719 54, 55, 56, 56, 57, 58, 58, 59, 60, 61,
00720 61, 62, 63, 64, 65, 65, 66, 67, 67, 68,
00721 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
00722 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
00723 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
00724 68, 68, 68, 68, 68, 68, 68
00725 };
00726
00727
00728 static const yytype_uint8 yyr2[] =
00729 {
00730 0, 2, 1, 0, 0, 0, 1, 1, 1, 1,
00731 4, 2, 2, 1, 2, 1, 1, 4, 2, 2,
00732 1, 2, 2, 0, 2, 0, 2, 2, 1, 3,
00733 3, 1, 1, 3, 2, 2, 2, 3, 1, 3,
00734 3, 10, 3, 3, 3, 2, 1, 2, 5, 3,
00735 1, 5, 3, 4, 2, 3, 3, 3, 5, 1,
00736 1, 2, 4, 3, 3, 1, 1
00737 };
00738
00739
00740
00741
00742 static const yytype_uint8 yydefact[] =
00743 {
00744 0, 0, 0, 31, 32, 0, 3, 0, 0, 0,
00745 38, 0, 0, 0, 0, 0, 0, 46, 0, 0,
00746 0, 0, 50, 0, 0, 0, 0, 0, 0, 0,
00747 0, 59, 60, 3, 0, 0, 0, 65, 66, 0,
00748 2, 28, 23, 23, 23, 5, 34, 15, 16, 35,
00749 36, 23, 23, 0, 23, 23, 23, 45, 47, 0,
00750 23, 23, 0, 23, 0, 54, 23, 23, 23, 0,
00751 0, 61, 0, 23, 23, 1, 27, 29, 25, 30,
00752 33, 5, 0, 18, 37, 40, 0, 42, 43, 44,
00753 0, 39, 49, 0, 52, 0, 56, 55, 57, 0,
00754 0, 64, 63, 3, 22, 25, 5, 20, 21, 0,
00755 0, 0, 53, 23, 62, 4, 26, 6, 8, 9,
00756 7, 24, 17, 19, 0, 48, 51, 58, 4, 0,
00757 11, 0, 4, 13, 14, 0, 10, 12, 0, 0,
00758 41
00759 };
00760
00761
00762 static const yytype_int16 yydefgoto[] =
00763 {
00764 -1, 39, 45, 129, 82, 116, 117, 118, 119, 132,
00765 130, 46, 47, 48, 106, 83, 77, 78, 104, 105,
00766 40, 41
00767 };
00768
00769
00770
00771 #define YYPACT_NINF -123
00772 static const yytype_int8 yypact[] =
00773 {
00774 65, 4, 11, -123, -123, 12, -123, 13, 16, 18,
00775 -123, 19, 21, 24, 26, 29, 30, -123, 31, 32,
00776 33, 34, -123, 35, 36, 37, 38, 40, 41, 42,
00777 43, -123, -123, -123, 44, 45, 48, -123, -123, 47,
00778 65, -123, -123, -123, -123, 46, -123, -123, -123, -123,
00779 -123, -123, -123, 49, -123, -123, -123, -123, -123, 50,
00780 -123, -123, 51, -123, 52, -123, -123, -123, -123, 55,
00781 46, -123, 54, -123, -123, -123, -123, -123, 57, -123,
00782 -123, -123, 56, -123, -123, -123, 58, -123, -123, -123,
00783 59, -123, -123, 60, -123, 61, -123, -123, -123, 64,
00784 63, -123, -123, -123, -123, 57, 62, -123, -123, 66,
00785 108, 107, -123, -123, -123, -1, -123, -123, -123, -123,
00786 -123, -123, -123, -123, 109, -123, -123, -123, 110, 113,
00787 -123, 112, 106, -123, -123, 114, -123, -123, 115, 116,
00788 -123
00789 };
00790
00791
00792 static const yytype_int8 yypgoto[] =
00793 {
00794 -123, -123, -31, -123, -123, -123, -123, -123, -123, -123,
00795 -122, -65, 20, -123, -123, -78, -43, -123, 17, -123,
00796 -123, 22
00797 };
00798
00799
00800
00801
00802
00803 #define YYTABLE_NINF -6
00804 static const yytype_int16 yytable[] =
00805 {
00806 79, 80, 70, 107, -5, 128, 133, 42, 84, 85,
00807 137, 87, 88, 89, 43, 44, 49, 91, 92, 50,
00808 94, 51, 52, 96, 97, 98, 53, 54, 123, 55,
00809 101, 102, 56, 57, 58, 59, 60, 61, 120, 63,
00810 62, 65, 64, 66, 67, 68, 69, 75, 73, 72,
00811 107, 74, 81, 71, 86, 90, 93, 95, 99, 100,
00812 103, 108, 76, 109, 110, 111, 112, 113, 114, 122,
00813 127, 124, 115, 1, 2, 3, 4, 5, 6, 7,
00814 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
00815 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
00816 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
00817 38, 125, 126, 136, 131, -5, 134, 135, 0, 138,
00818 139, 140, 121
00819 };
00820
00821 static const yytype_int16 yycheck[] =
00822 {
00823 43, 44, 33, 81, 5, 6, 128, 3, 51, 52,
00824 132, 54, 55, 56, 3, 3, 3, 60, 61, 3,
00825 63, 3, 3, 66, 67, 68, 5, 3, 106, 3,
00826 73, 74, 3, 3, 3, 3, 3, 3, 103, 3,
00827 5, 3, 5, 3, 3, 3, 3, 0, 3, 5,
00828 128, 3, 6, 33, 5, 5, 5, 5, 3, 5,
00829 3, 5, 40, 5, 5, 5, 5, 3, 5, 7,
00830 113, 5, 103, 8, 9, 10, 11, 12, 13, 14,
00831 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
00832 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
00833 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
00834 45, 3, 5, 7, 5, 5, 3, 5, -1, 5,
00835 5, 5, 105
00836 };
00837
00838
00839
00840 static const yytype_uint8 yystos[] =
00841 {
00842 0, 8, 9, 10, 11, 12, 13, 14, 15, 16,
00843 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
00844 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
00845 37, 38, 39, 40, 41, 42, 43, 44, 45, 48,
00846 67, 68, 3, 3, 3, 49, 58, 59, 60, 3,
00847 3, 3, 3, 5, 3, 3, 3, 3, 3, 3,
00848 3, 3, 5, 3, 5, 3, 3, 3, 3, 3,
00849 49, 59, 5, 3, 3, 0, 68, 63, 64, 63,
00850 63, 6, 51, 62, 63, 63, 5, 63, 63, 63,
00851 5, 63, 63, 5, 63, 5, 63, 63, 63, 3,
00852 5, 63, 63, 3, 65, 66, 61, 62, 5, 5,
00853 5, 5, 5, 3, 5, 49, 52, 53, 54, 55,
00854 58, 65, 7, 62, 5, 3, 5, 63, 6, 50,
00855 57, 5, 56, 57, 3, 5, 7, 57, 5, 5,
00856 5
00857 };
00858
00859 #define yyerrok (yyerrstatus = 0)
00860 #define yyclearin (yychar = YYEMPTY)
00861 #define YYEMPTY (-2)
00862 #define YYEOF 0
00863
00864 #define YYACCEPT goto yyacceptlab
00865 #define YYABORT goto yyabortlab
00866 #define YYERROR goto yyerrorlab
00867
00868
00869
00870
00871
00872
00873 #define YYFAIL goto yyerrlab
00874
00875 #define YYRECOVERING() (!!yyerrstatus)
00876
00877 #define YYBACKUP(Token, Value) \
00878 do \
00879 if (yychar == YYEMPTY && yylen == 1) \
00880 { \
00881 yychar = (Token); \
00882 yylval = (Value); \
00883 yytoken = YYTRANSLATE (yychar); \
00884 YYPOPSTACK (1); \
00885 goto yybackup; \
00886 } \
00887 else \
00888 { \
00889 yyerror (YY_("syntax error: cannot back up")); \
00890 YYERROR; \
00891 } \
00892 while (YYID (0))
00893
00894
00895 #define YYTERROR 1
00896 #define YYERRCODE 256
00897
00898
00899
00900
00901
00902
00903 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00904 #ifndef YYLLOC_DEFAULT
00905 # define YYLLOC_DEFAULT(Current, Rhs, N) \
00906 do \
00907 if (YYID (N)) \
00908 { \
00909 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
00910 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
00911 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
00912 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
00913 } \
00914 else \
00915 { \
00916 (Current).first_line = (Current).last_line = \
00917 YYRHSLOC (Rhs, 0).last_line; \
00918 (Current).first_column = (Current).last_column = \
00919 YYRHSLOC (Rhs, 0).last_column; \
00920 } \
00921 while (YYID (0))
00922 #endif
00923
00924
00925
00926
00927
00928
00929 #ifndef YY_LOCATION_PRINT
00930 # if YYLTYPE_IS_TRIVIAL
00931 # define YY_LOCATION_PRINT(File, Loc) \
00932 fprintf (File, "%d.%d-%d.%d", \
00933 (Loc).first_line, (Loc).first_column, \
00934 (Loc).last_line, (Loc).last_column)
00935 # else
00936 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00937 # endif
00938 #endif
00939
00940
00941
00942
00943 #ifdef YYLEX_PARAM
00944 # define YYLEX yylex (YYLEX_PARAM)
00945 #else
00946 # define YYLEX yylex ()
00947 #endif
00948
00949
00950 #if YYDEBUG
00951
00952 # ifndef YYFPRINTF
00953 # include <stdio.h>
00954 # define YYFPRINTF fprintf
00955 # endif
00956
00957 # define YYDPRINTF(Args) \
00958 do { \
00959 if (yydebug) \
00960 YYFPRINTF Args; \
00961 } while (YYID (0))
00962
00963 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
00964 do { \
00965 if (yydebug) \
00966 { \
00967 YYFPRINTF (stderr, "%s ", Title); \
00968 yy_symbol_print (stderr, \
00969 Type, Value); \
00970 YYFPRINTF (stderr, "\n"); \
00971 } \
00972 } while (YYID (0))
00973
00974
00975
00976
00977
00978
00979
00980 #if (defined __STDC__ || defined __C99__FUNC__ \
00981 || defined __cplusplus || defined _MSC_VER)
00982 static void
00983 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
00984 #else
00985 static void
00986 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
00987 FILE *yyoutput;
00988 int yytype;
00989 YYSTYPE const * const yyvaluep;
00990 #endif
00991 {
00992 if (!yyvaluep)
00993 return;
00994 # ifdef YYPRINT
00995 if (yytype < YYNTOKENS)
00996 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00997 # else
00998 YYUSE (yyoutput);
00999 # endif
01000 switch (yytype)
01001 {
01002 default:
01003 break;
01004 }
01005 }
01006
01007
01008
01009
01010
01011
01012 #if (defined __STDC__ || defined __C99__FUNC__ \
01013 || defined __cplusplus || defined _MSC_VER)
01014 static void
01015 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01016 #else
01017 static void
01018 yy_symbol_print (yyoutput, yytype, yyvaluep)
01019 FILE *yyoutput;
01020 int yytype;
01021 YYSTYPE const * const yyvaluep;
01022 #endif
01023 {
01024 if (yytype < YYNTOKENS)
01025 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01026 else
01027 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01028
01029 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01030 YYFPRINTF (yyoutput, ")");
01031 }
01032
01033
01034
01035
01036
01037
01038 #if (defined __STDC__ || defined __C99__FUNC__ \
01039 || defined __cplusplus || defined _MSC_VER)
01040 static void
01041 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
01042 #else
01043 static void
01044 yy_stack_print (yybottom, yytop)
01045 yytype_int16 *yybottom;
01046 yytype_int16 *yytop;
01047 #endif
01048 {
01049 YYFPRINTF (stderr, "Stack now");
01050 for (; yybottom <= yytop; yybottom++)
01051 {
01052 int yybot = *yybottom;
01053 YYFPRINTF (stderr, " %d", yybot);
01054 }
01055 YYFPRINTF (stderr, "\n");
01056 }
01057
01058 # define YY_STACK_PRINT(Bottom, Top) \
01059 do { \
01060 if (yydebug) \
01061 yy_stack_print ((Bottom), (Top)); \
01062 } while (YYID (0))
01063
01064
01065
01066
01067
01068
01069 #if (defined __STDC__ || defined __C99__FUNC__ \
01070 || defined __cplusplus || defined _MSC_VER)
01071 static void
01072 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
01073 #else
01074 static void
01075 yy_reduce_print (yyvsp, yyrule)
01076 YYSTYPE *yyvsp;
01077 int yyrule;
01078 #endif
01079 {
01080 int yynrhs = yyr2[yyrule];
01081 int yyi;
01082 unsigned long int yylno = yyrline[yyrule];
01083 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01084 yyrule - 1, yylno);
01085
01086 for (yyi = 0; yyi < yynrhs; yyi++)
01087 {
01088 YYFPRINTF (stderr, " $%d = ", yyi + 1);
01089 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01090 &(yyvsp[(yyi + 1) - (yynrhs)])
01091 );
01092 YYFPRINTF (stderr, "\n");
01093 }
01094 }
01095
01096 # define YY_REDUCE_PRINT(Rule) \
01097 do { \
01098 if (yydebug) \
01099 yy_reduce_print (yyvsp, Rule); \
01100 } while (YYID (0))
01101
01102
01103
01104 int yydebug;
01105 #else
01106 # define YYDPRINTF(Args)
01107 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01108 # define YY_STACK_PRINT(Bottom, Top)
01109 # define YY_REDUCE_PRINT(Rule)
01110 #endif
01111
01112
01113
01114 #ifndef YYINITDEPTH
01115 # define YYINITDEPTH 200
01116 #endif
01117
01118
01119
01120
01121
01122
01123
01124
01125 #ifndef YYMAXDEPTH
01126 # define YYMAXDEPTH 10000
01127 #endif
01128
01129
01130
01131 #if YYERROR_VERBOSE
01132
01133 # ifndef yystrlen
01134 # if defined __GLIBC__ && defined _STRING_H
01135 # define yystrlen strlen
01136 # else
01137
01138 #if (defined __STDC__ || defined __C99__FUNC__ \
01139 || defined __cplusplus || defined _MSC_VER)
01140 static YYSIZE_T
01141 yystrlen (const char *yystr)
01142 #else
01143 static YYSIZE_T
01144 yystrlen (yystr)
01145 const char *yystr;
01146 #endif
01147 {
01148 YYSIZE_T yylen;
01149 for (yylen = 0; yystr[yylen]; yylen++)
01150 continue;
01151 return yylen;
01152 }
01153 # endif
01154 # endif
01155
01156 # ifndef yystpcpy
01157 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01158 # define yystpcpy stpcpy
01159 # else
01160
01161
01162 #if (defined __STDC__ || defined __C99__FUNC__ \
01163 || defined __cplusplus || defined _MSC_VER)
01164 static char *
01165 yystpcpy (char *yydest, const char *yysrc)
01166 #else
01167 static char *
01168 yystpcpy (yydest, yysrc)
01169 char *yydest;
01170 const char *yysrc;
01171 #endif
01172 {
01173 char *yyd = yydest;
01174 const char *yys = yysrc;
01175
01176 while ((*yyd++ = *yys++) != '\0')
01177 continue;
01178
01179 return yyd - 1;
01180 }
01181 # endif
01182 # endif
01183
01184 # ifndef yytnamerr
01185
01186
01187
01188
01189
01190
01191
01192 static YYSIZE_T
01193 yytnamerr (char *yyres, const char *yystr)
01194 {
01195 if (*yystr == '"')
01196 {
01197 YYSIZE_T yyn = 0;
01198 char const *yyp = yystr;
01199
01200 for (;;)
01201 switch (*++yyp)
01202 {
01203 case '\'':
01204 case ',':
01205 goto do_not_strip_quotes;
01206
01207 case '\\':
01208 if (*++yyp != '\\')
01209 goto do_not_strip_quotes;
01210
01211 default:
01212 if (yyres)
01213 yyres[yyn] = *yyp;
01214 yyn++;
01215 break;
01216
01217 case '"':
01218 if (yyres)
01219 yyres[yyn] = '\0';
01220 return yyn;
01221 }
01222 do_not_strip_quotes: ;
01223 }
01224
01225 if (! yyres)
01226 return yystrlen (yystr);
01227
01228 return yystpcpy (yyres, yystr) - yyres;
01229 }
01230 # endif
01231
01232
01233
01234
01235
01236
01237
01238
01239 static YYSIZE_T
01240 yysyntax_error (char *yyresult, int yystate, int yychar)
01241 {
01242 int yyn = yypact[yystate];
01243
01244 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01245 return 0;
01246 else
01247 {
01248 int yytype = YYTRANSLATE (yychar);
01249 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01250 YYSIZE_T yysize = yysize0;
01251 YYSIZE_T yysize1;
01252 int yysize_overflow = 0;
01253 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01254 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01255 int yyx;
01256
01257 # if 0
01258
01259
01260 YY_("syntax error, unexpected %s");
01261 YY_("syntax error, unexpected %s, expecting %s");
01262 YY_("syntax error, unexpected %s, expecting %s or %s");
01263 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01264 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01265 # endif
01266 char *yyfmt;
01267 char const *yyf;
01268 static char const yyunexpected[] = "syntax error, unexpected %s";
01269 static char const yyexpecting[] = ", expecting %s";
01270 static char const yyor[] = " or %s";
01271 char yyformat[sizeof yyunexpected
01272 + sizeof yyexpecting - 1
01273 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01274 * (sizeof yyor - 1))];
01275 char const *yyprefix = yyexpecting;
01276
01277
01278
01279 int yyxbegin = yyn < 0 ? -yyn : 0;
01280
01281
01282 int yychecklim = YYLAST - yyn + 1;
01283 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01284 int yycount = 1;
01285
01286 yyarg[0] = yytname[yytype];
01287 yyfmt = yystpcpy (yyformat, yyunexpected);
01288
01289 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01290 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01291 {
01292 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01293 {
01294 yycount = 1;
01295 yysize = yysize0;
01296 yyformat[sizeof yyunexpected - 1] = '\0';
01297 break;
01298 }
01299 yyarg[yycount++] = yytname[yyx];
01300 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01301 yysize_overflow |= (yysize1 < yysize);
01302 yysize = yysize1;
01303 yyfmt = yystpcpy (yyfmt, yyprefix);
01304 yyprefix = yyor;
01305 }
01306
01307 yyf = YY_(yyformat);
01308 yysize1 = yysize + yystrlen (yyf);
01309 yysize_overflow |= (yysize1 < yysize);
01310 yysize = yysize1;
01311
01312 if (yysize_overflow)
01313 return YYSIZE_MAXIMUM;
01314
01315 if (yyresult)
01316 {
01317
01318
01319
01320 char *yyp = yyresult;
01321 int yyi = 0;
01322 while ((*yyp = *yyf) != '\0')
01323 {
01324 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01325 {
01326 yyp += yytnamerr (yyp, yyarg[yyi++]);
01327 yyf += 2;
01328 }
01329 else
01330 {
01331 yyp++;
01332 yyf++;
01333 }
01334 }
01335 }
01336 return yysize;
01337 }
01338 }
01339 #endif
01340
01341
01342
01343
01344
01345
01346
01347 #if (defined __STDC__ || defined __C99__FUNC__ \
01348 || defined __cplusplus || defined _MSC_VER)
01349 static void
01350 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01351 #else
01352 static void
01353 yydestruct (yymsg, yytype, yyvaluep)
01354 const char *yymsg;
01355 int yytype;
01356 YYSTYPE *yyvaluep;
01357 #endif
01358 {
01359 YYUSE (yyvaluep);
01360
01361 if (!yymsg)
01362 yymsg = "Deleting";
01363 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01364
01365 switch (yytype)
01366 {
01367
01368 default:
01369 break;
01370 }
01371 }
01372
01373
01374 #ifdef YYPARSE_PARAM
01375 #if defined __STDC__ || defined __cplusplus
01376 int yyparse (void *YYPARSE_PARAM);
01377 #else
01378 int yyparse ();
01379 #endif
01380 #else
01381 #if defined __STDC__ || defined __cplusplus
01382 int yyparse (void);
01383 #else
01384 int yyparse ();
01385 #endif
01386 #endif
01387
01388
01389
01390 int yychar;
01391
01392
01393 YYSTYPE yylval;
01394
01395
01396 int yynerrs;
01397
01398
01399
01400
01401
01402
01403
01404 #ifdef YYPARSE_PARAM
01405 #if (defined __STDC__ || defined __C99__FUNC__ \
01406 || defined __cplusplus || defined _MSC_VER)
01407 int
01408 yyparse (void *YYPARSE_PARAM)
01409 #else
01410 int
01411 yyparse (YYPARSE_PARAM)
01412 void *YYPARSE_PARAM;
01413 #endif
01414 #else
01415 #if (defined __STDC__ || defined __C99__FUNC__ \
01416 || defined __cplusplus || defined _MSC_VER)
01417 int
01418 yyparse (void)
01419 #else
01420 int
01421 yyparse ()
01422
01423 #endif
01424 #endif
01425 {
01426
01427
01428 int yystate;
01429
01430 int yyerrstatus;
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440 yytype_int16 yyssa[YYINITDEPTH];
01441 yytype_int16 *yyss;
01442 yytype_int16 *yyssp;
01443
01444
01445 YYSTYPE yyvsa[YYINITDEPTH];
01446 YYSTYPE *yyvs;
01447 YYSTYPE *yyvsp;
01448
01449 YYSIZE_T yystacksize;
01450
01451 int yyn;
01452 int yyresult;
01453
01454 int yytoken;
01455
01456
01457 YYSTYPE yyval;
01458
01459 #if YYERROR_VERBOSE
01460
01461 char yymsgbuf[128];
01462 char *yymsg = yymsgbuf;
01463 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01464 #endif
01465
01466 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
01467
01468
01469
01470 int yylen = 0;
01471
01472 yytoken = 0;
01473 yyss = yyssa;
01474 yyvs = yyvsa;
01475 yystacksize = YYINITDEPTH;
01476
01477 YYDPRINTF ((stderr, "Starting parse\n"));
01478
01479 yystate = 0;
01480 yyerrstatus = 0;
01481 yynerrs = 0;
01482 yychar = YYEMPTY;
01483
01484
01485
01486
01487
01488 yyssp = yyss;
01489 yyvsp = yyvs;
01490
01491 goto yysetstate;
01492
01493
01494
01495
01496 yynewstate:
01497
01498
01499 yyssp++;
01500
01501 yysetstate:
01502 *yyssp = yystate;
01503
01504 if (yyss + yystacksize - 1 <= yyssp)
01505 {
01506
01507 YYSIZE_T yysize = yyssp - yyss + 1;
01508
01509 #ifdef yyoverflow
01510 {
01511
01512
01513
01514 YYSTYPE *yyvs1 = yyvs;
01515 yytype_int16 *yyss1 = yyss;
01516
01517
01518
01519
01520
01521 yyoverflow (YY_("memory exhausted"),
01522 &yyss1, yysize * sizeof (*yyssp),
01523 &yyvs1, yysize * sizeof (*yyvsp),
01524 &yystacksize);
01525
01526 yyss = yyss1;
01527 yyvs = yyvs1;
01528 }
01529 #else
01530 # ifndef YYSTACK_RELOCATE
01531 goto yyexhaustedlab;
01532 # else
01533
01534 if (YYMAXDEPTH <= yystacksize)
01535 goto yyexhaustedlab;
01536 yystacksize *= 2;
01537 if (YYMAXDEPTH < yystacksize)
01538 yystacksize = YYMAXDEPTH;
01539
01540 {
01541 yytype_int16 *yyss1 = yyss;
01542 union yyalloc *yyptr =
01543 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01544 if (! yyptr)
01545 goto yyexhaustedlab;
01546 YYSTACK_RELOCATE (yyss_alloc, yyss);
01547 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
01548 # undef YYSTACK_RELOCATE
01549 if (yyss1 != yyssa)
01550 YYSTACK_FREE (yyss1);
01551 }
01552 # endif
01553 #endif
01554
01555 yyssp = yyss + yysize - 1;
01556 yyvsp = yyvs + yysize - 1;
01557
01558 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01559 (unsigned long int) yystacksize));
01560
01561 if (yyss + yystacksize - 1 <= yyssp)
01562 YYABORT;
01563 }
01564
01565 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01566
01567 if (yystate == YYFINAL)
01568 YYACCEPT;
01569
01570 goto yybackup;
01571
01572
01573
01574
01575 yybackup:
01576
01577
01578
01579
01580
01581 yyn = yypact[yystate];
01582 if (yyn == YYPACT_NINF)
01583 goto yydefault;
01584
01585
01586
01587
01588 if (yychar == YYEMPTY)
01589 {
01590 YYDPRINTF ((stderr, "Reading a token: "));
01591 yychar = YYLEX;
01592 }
01593
01594 if (yychar <= YYEOF)
01595 {
01596 yychar = yytoken = YYEOF;
01597 YYDPRINTF ((stderr, "Now at end of input.\n"));
01598 }
01599 else
01600 {
01601 yytoken = YYTRANSLATE (yychar);
01602 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01603 }
01604
01605
01606
01607 yyn += yytoken;
01608 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01609 goto yydefault;
01610 yyn = yytable[yyn];
01611 if (yyn <= 0)
01612 {
01613 if (yyn == 0 || yyn == YYTABLE_NINF)
01614 goto yyerrlab;
01615 yyn = -yyn;
01616 goto yyreduce;
01617 }
01618
01619
01620
01621 if (yyerrstatus)
01622 yyerrstatus--;
01623
01624
01625 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01626
01627
01628 yychar = YYEMPTY;
01629
01630 yystate = yyn;
01631 *++yyvsp = yylval;
01632
01633 goto yynewstate;
01634
01635
01636
01637
01638
01639 yydefault:
01640 yyn = yydefact[yystate];
01641 if (yyn == 0)
01642 goto yyerrlab;
01643 goto yyreduce;
01644
01645
01646
01647
01648
01649 yyreduce:
01650
01651 yylen = yyr2[yyn];
01652
01653
01654
01655
01656
01657
01658
01659
01660
01661 yyval = yyvsp[1-yylen];
01662
01663
01664 YY_REDUCE_PRINT (yyn);
01665 switch (yyn)
01666 {
01667 case 2:
01668
01669
01670 #line 182 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01671 {
01672 }
01673 break;
01674
01675 case 3:
01676
01677
01678 #line 186 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01679 {
01680 if (cur_array) ArrayFree( cur_array );
01681 cur_array = new ParamArray;
01682 cur_array->allocated = 0;
01683 cur_array->nelems = 0;
01684 cur_array->array = NULL;
01685 array_is_single_string = false;
01686 }
01687 break;
01688
01689 case 4:
01690
01691
01692 #line 196 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01693 {
01694 cur_array->element_size = sizeof( const char * );
01695 }
01696 break;
01697
01698 case 5:
01699
01700
01701 #line 201 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01702 {
01703 cur_array->element_size = sizeof( float );
01704 }
01705 break;
01706
01707 case 6:
01708
01709
01710 #line 206 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01711 {
01712 (yyval.ribarray) = (yyvsp[(1) - (1)].ribarray);
01713 }
01714 break;
01715
01716 case 7:
01717
01718
01719 #line 210 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01720 {
01721 (yyval.ribarray) = (yyvsp[(1) - (1)].ribarray);
01722 }
01723 break;
01724
01725 case 8:
01726
01727
01728 #line 215 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01729 {
01730 (yyval.ribarray) = (yyvsp[(1) - (1)].ribarray);
01731 }
01732 break;
01733
01734 case 9:
01735
01736
01737 #line 219 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01738 {
01739 (yyval.ribarray) = ArrayDup(cur_array);
01740 array_is_single_string = true;
01741 }
01742 break;
01743
01744 case 10:
01745
01746
01747 #line 225 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01748 {
01749 (yyval.ribarray) = ArrayDup(cur_array);
01750 }
01751 break;
01752
01753 case 11:
01754
01755
01756 #line 230 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01757 {
01758 }
01759 break;
01760
01761 case 12:
01762
01763
01764 #line 234 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01765 {
01766 }
01767 break;
01768
01769 case 13:
01770
01771
01772 #line 237 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01773 {
01774 }
01775 break;
01776
01777 case 14:
01778
01779
01780 #line 241 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01781 {
01782 char *to_add = strdup((yyvsp[(2) - (2)].string));
01783 AddArrayElement( &to_add );
01784 }
01785 break;
01786
01787 case 15:
01788
01789
01790 #line 247 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01791 {
01792 (yyval.ribarray) = (yyvsp[(1) - (1)].ribarray);
01793 }
01794 break;
01795
01796 case 16:
01797
01798
01799 #line 251 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01800 {
01801 (yyval.ribarray) = ArrayDup(cur_array);
01802 }
01803 break;
01804
01805 case 17:
01806
01807
01808 #line 256 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01809 {
01810 (yyval.ribarray) = ArrayDup(cur_array);
01811 }
01812 break;
01813
01814 case 18:
01815
01816
01817 #line 261 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01818 {
01819 }
01820 break;
01821
01822 case 19:
01823
01824
01825 #line 265 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01826 {
01827 }
01828 break;
01829
01830 case 20:
01831
01832
01833 #line 268 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01834 {
01835 }
01836 break;
01837
01838 case 21:
01839
01840
01841 #line 272 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01842 {
01843 float to_add = (yyvsp[(2) - (2)].num);
01844 AddArrayElement( &to_add );
01845 }
01846 break;
01847
01848 case 22:
01849
01850
01851 #line 278 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01852 {
01853 }
01854 break;
01855
01856 case 23:
01857
01858
01859 #line 282 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01860 {
01861 cur_paramlist_size = 0;
01862 }
01863 break;
01864
01865 case 24:
01866
01867
01868 #line 287 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01869 {
01870 }
01871 break;
01872
01873 case 25:
01874
01875
01876 #line 290 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01877 {
01878 }
01879 break;
01880
01881 case 26:
01882
01883
01884 #line 294 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01885 {
01886 void *arg = new char[ (yyvsp[(2) - (2)].ribarray)->nelems * (yyvsp[(2) - (2)].ribarray)->element_size ];
01887 memcpy(arg, (yyvsp[(2) - (2)].ribarray)->array, (yyvsp[(2) - (2)].ribarray)->nelems * (yyvsp[(2) - (2)].ribarray)->element_size);
01888 if (cur_paramlist_size >= cur_paramlist_allocated) {
01889 cur_paramlist_allocated = 2*cur_paramlist_allocated + 1;
01890 cur_paramlist_tokens = (const char **) realloc(cur_paramlist_tokens, cur_paramlist_allocated*sizeof(const char *) );
01891 cur_paramlist_args = (void * *) realloc( cur_paramlist_args, cur_paramlist_allocated*sizeof(void *) );
01892 cur_paramlist_sizes = (int *) realloc( cur_paramlist_sizes, cur_paramlist_allocated*sizeof(int) );
01893 cur_paramlist_texture_helper = (bool *) realloc( cur_paramlist_texture_helper, cur_paramlist_allocated*sizeof(bool) );
01894 }
01895 cur_paramlist_tokens[cur_paramlist_size] = (yyvsp[(1) - (2)].string);
01896 cur_paramlist_sizes[cur_paramlist_size] = (yyvsp[(2) - (2)].ribarray)->nelems;
01897 cur_paramlist_texture_helper[cur_paramlist_size] = array_is_single_string;
01898 cur_paramlist_args[cur_paramlist_size++] = arg;
01899 ArrayFree( (yyvsp[(2) - (2)].ribarray) );
01900 }
01901 break;
01902
01903 case 27:
01904
01905
01906 #line 312 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01907 {
01908 }
01909 break;
01910
01911 case 28:
01912
01913
01914 #line 315 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01915 {
01916 }
01917 break;
01918
01919 case 29:
01920
01921
01922 #line 319 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01923 {
01924 ParamSet params;
01925 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
01926 Context::luxAccelerator((yyvsp[(2) - (3)].string), params);
01927 FreeArgs();
01928 }
01929 break;
01930
01931 case 30:
01932
01933
01934 #line 326 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01935 {
01936 ParamSet params;
01937 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
01938 Context::luxAreaLightSource((yyvsp[(2) - (3)].string), params);
01939 FreeArgs();
01940 }
01941 break;
01942
01943 case 31:
01944
01945
01946 #line 333 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01947 {
01948 Context::luxAttributeBegin();
01949 }
01950 break;
01951
01952 case 32:
01953
01954
01955 #line 337 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01956 {
01957 Context::luxAttributeEnd();
01958 }
01959 break;
01960
01961 case 33:
01962
01963
01964 #line 341 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01965 {
01966 ParamSet params;
01967 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
01968 Context::luxCamera((yyvsp[(2) - (3)].string), params);
01969 FreeArgs();
01970 }
01971 break;
01972
01973 case 34:
01974
01975
01976 #line 348 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01977 {
01978 if (VerifyArrayLength( (yyvsp[(2) - (2)].ribarray), 16, "ConcatTransform" ))
01979 Context::luxConcatTransform( (float *) (yyvsp[(2) - (2)].ribarray)->array );
01980 ArrayFree( (yyvsp[(2) - (2)].ribarray) );
01981 }
01982 break;
01983
01984 case 35:
01985
01986
01987 #line 354 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01988 {
01989 Context::luxCoordinateSystem( (yyvsp[(2) - (2)].string) );
01990 }
01991 break;
01992
01993 case 36:
01994
01995
01996 #line 358 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
01997 {
01998 Context::luxCoordSysTransform( (yyvsp[(2) - (2)].string) );
01999 }
02000 break;
02001
02002 case 37:
02003
02004
02005 #line 362 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02006 {
02007 ParamSet params;
02008 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02009 Context::luxFilm((yyvsp[(2) - (3)].string), params);
02010 FreeArgs();
02011 }
02012 break;
02013
02014 case 38:
02015
02016
02017 #line 369 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02018 {
02019 Context::luxIdentity();
02020 }
02021 break;
02022
02023 case 39:
02024
02025
02026 #line 373 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02027 {
02028 ParamSet params;
02029 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02030 Context::luxLightGroup((yyvsp[(2) - (3)].string), params);
02031 FreeArgs();
02032 }
02033 break;
02034
02035 case 40:
02036
02037
02038 #line 380 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02039 {
02040 ParamSet params;
02041 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02042 Context::luxLightSource((yyvsp[(2) - (3)].string), params);
02043 FreeArgs();
02044 }
02045 break;
02046
02047 case 41:
02048
02049
02050 #line 387 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02051 {
02052 Context::luxLookAt((yyvsp[(2) - (10)].num), (yyvsp[(3) - (10)].num), (yyvsp[(4) - (10)].num), (yyvsp[(5) - (10)].num), (yyvsp[(6) - (10)].num), (yyvsp[(7) - (10)].num), (yyvsp[(8) - (10)].num), (yyvsp[(9) - (10)].num), (yyvsp[(10) - (10)].num));
02053 }
02054 break;
02055
02056 case 42:
02057
02058
02059 #line 391 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02060 {
02061 ParamSet params;
02062 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02063 Context::luxMaterial((yyvsp[(2) - (3)].string), params);
02064 FreeArgs();
02065 }
02066 break;
02067
02068 case 43:
02069
02070
02071 #line 398 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02072 {
02073 ParamSet params;
02074 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02075 Context::luxMakeNamedMaterial((yyvsp[(2) - (3)].string), params);
02076 FreeArgs();
02077 }
02078 break;
02079
02080 case 44:
02081
02082
02083 #line 405 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02084 {
02085 ParamSet params;
02086 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02087 Context::luxNamedMaterial((yyvsp[(2) - (3)].string), params);
02088 FreeArgs();
02089 }
02090 break;
02091
02092 case 45:
02093
02094
02095 #line 412 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02096 {
02097 Context::luxObjectBegin((yyvsp[(2) - (2)].string));
02098 }
02099 break;
02100
02101 case 46:
02102
02103
02104 #line 416 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02105 {
02106 Context::luxObjectEnd();
02107 }
02108 break;
02109
02110 case 47:
02111
02112
02113 #line 420 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02114 {
02115 Context::luxObjectInstance((yyvsp[(2) - (2)].string));
02116 }
02117 break;
02118
02119 case 48:
02120
02121
02122 #line 424 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02123 {
02124 Context::luxMotionInstance((yyvsp[(2) - (5)].string), (yyvsp[(3) - (5)].num), (yyvsp[(4) - (5)].num), (yyvsp[(5) - (5)].string));
02125 }
02126 break;
02127
02128 case 49:
02129
02130
02131 #line 428 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02132 {
02133 ParamSet params;
02134 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02135 Context::luxPixelFilter((yyvsp[(2) - (3)].string), params);
02136 FreeArgs();
02137 }
02138 break;
02139
02140 case 50:
02141
02142
02143 #line 435 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02144 {
02145 Context::luxReverseOrientation();
02146 }
02147 break;
02148
02149 case 51:
02150
02151
02152 #line 439 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02153 {
02154 Context::luxRotate((yyvsp[(2) - (5)].num), (yyvsp[(3) - (5)].num), (yyvsp[(4) - (5)].num), (yyvsp[(5) - (5)].num));
02155 }
02156 break;
02157
02158 case 52:
02159
02160
02161 #line 443 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02162 {
02163 ParamSet params;
02164 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02165 Context::luxSampler((yyvsp[(2) - (3)].string), params);
02166 FreeArgs();
02167 }
02168 break;
02169
02170 case 53:
02171
02172
02173 #line 450 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02174 {
02175 Context::luxScale((yyvsp[(2) - (4)].num), (yyvsp[(3) - (4)].num), (yyvsp[(4) - (4)].num));
02176 }
02177 break;
02178
02179 case 54:
02180
02181
02182 #line 454 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02183 {
02184 ;
02185 }
02186 break;
02187
02188 case 55:
02189
02190
02191 #line 458 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02192 {
02193 ParamSet params;
02194 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02195 Context::luxShape((yyvsp[(2) - (3)].string), params);
02196 FreeArgs();
02197 }
02198 break;
02199
02200 case 56:
02201
02202
02203 #line 465 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02204 {
02205 ParamSet params;
02206 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02207 Context::luxPortalShape((yyvsp[(2) - (3)].string), params);
02208 FreeArgs();
02209 }
02210 break;
02211
02212 case 57:
02213
02214
02215 #line 472 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02216 {
02217 ParamSet params;
02218 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02219 Context::luxSurfaceIntegrator((yyvsp[(2) - (3)].string), params);
02220 FreeArgs();
02221 }
02222 break;
02223
02224 case 58:
02225
02226
02227 #line 479 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02228 {
02229 ParamSet params;
02230 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02231 Context::luxTexture((yyvsp[(2) - (5)].string), (yyvsp[(3) - (5)].string), (yyvsp[(4) - (5)].string), params);
02232 FreeArgs();
02233 }
02234 break;
02235
02236 case 59:
02237
02238
02239 #line 486 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02240 {
02241 Context::luxTransformBegin();
02242 }
02243 break;
02244
02245 case 60:
02246
02247
02248 #line 490 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02249 {
02250 Context::luxTransformEnd();
02251 }
02252 break;
02253
02254 case 61:
02255
02256
02257 #line 494 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02258 {
02259 if (VerifyArrayLength( (yyvsp[(2) - (2)].ribarray), 16, "Transform" ))
02260 Context::luxTransform( (float *) (yyvsp[(2) - (2)].ribarray)->array );
02261 ArrayFree( (yyvsp[(2) - (2)].ribarray) );
02262 }
02263 break;
02264
02265 case 62:
02266
02267
02268 #line 500 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02269 {
02270 luxTranslate((yyvsp[(2) - (4)].num), (yyvsp[(3) - (4)].num), (yyvsp[(4) - (4)].num));
02271 }
02272 break;
02273
02274 case 63:
02275
02276
02277 #line 504 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02278 {
02279 ParamSet params;
02280 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02281 Context::luxVolumeIntegrator((yyvsp[(2) - (3)].string), params);
02282 FreeArgs();
02283 }
02284 break;
02285
02286 case 64:
02287
02288
02289 #line 511 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02290 {
02291 ParamSet params;
02292 InitParamSet(params, CPS, CPT, CPA, CPSZ, CPTH);
02293 Context::luxVolume((yyvsp[(2) - (3)].string), params);
02294 FreeArgs();
02295 }
02296 break;
02297
02298 case 65:
02299
02300
02301 #line 518 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02302 {
02303 Context::luxWorldBegin();
02304 }
02305 break;
02306
02307 case 66:
02308
02309
02310 #line 522 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02311 {
02312 Context::luxWorldEnd();
02313 }
02314 break;
02315
02316
02317
02318
02319 #line 2320 "/builddir/build/BUILD/lux-0.6.1/build/luxparse.cpp"
02320 default: break;
02321 }
02322 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02323
02324 YYPOPSTACK (yylen);
02325 yylen = 0;
02326 YY_STACK_PRINT (yyss, yyssp);
02327
02328 *++yyvsp = yyval;
02329
02330
02331
02332
02333
02334 yyn = yyr1[yyn];
02335
02336 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02337 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02338 yystate = yytable[yystate];
02339 else
02340 yystate = yydefgoto[yyn - YYNTOKENS];
02341
02342 goto yynewstate;
02343
02344
02345
02346
02347
02348 yyerrlab:
02349
02350 if (!yyerrstatus)
02351 {
02352 ++yynerrs;
02353 #if ! YYERROR_VERBOSE
02354 yyerror (YY_("syntax error"));
02355 #else
02356 {
02357 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
02358 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
02359 {
02360 YYSIZE_T yyalloc = 2 * yysize;
02361 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
02362 yyalloc = YYSTACK_ALLOC_MAXIMUM;
02363 if (yymsg != yymsgbuf)
02364 YYSTACK_FREE (yymsg);
02365 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
02366 if (yymsg)
02367 yymsg_alloc = yyalloc;
02368 else
02369 {
02370 yymsg = yymsgbuf;
02371 yymsg_alloc = sizeof yymsgbuf;
02372 }
02373 }
02374
02375 if (0 < yysize && yysize <= yymsg_alloc)
02376 {
02377 (void) yysyntax_error (yymsg, yystate, yychar);
02378 yyerror (yymsg);
02379 }
02380 else
02381 {
02382 yyerror (YY_("syntax error"));
02383 if (yysize != 0)
02384 goto yyexhaustedlab;
02385 }
02386 }
02387 #endif
02388 }
02389
02390
02391
02392 if (yyerrstatus == 3)
02393 {
02394
02395
02396
02397 if (yychar <= YYEOF)
02398 {
02399
02400 if (yychar == YYEOF)
02401 YYABORT;
02402 }
02403 else
02404 {
02405 yydestruct ("Error: discarding",
02406 yytoken, &yylval);
02407 yychar = YYEMPTY;
02408 }
02409 }
02410
02411
02412
02413 goto yyerrlab1;
02414
02415
02416
02417
02418
02419 yyerrorlab:
02420
02421
02422
02423
02424 if ( 0)
02425 goto yyerrorlab;
02426
02427
02428
02429 YYPOPSTACK (yylen);
02430 yylen = 0;
02431 YY_STACK_PRINT (yyss, yyssp);
02432 yystate = *yyssp;
02433 goto yyerrlab1;
02434
02435
02436
02437
02438
02439 yyerrlab1:
02440 yyerrstatus = 3;
02441
02442 for (;;)
02443 {
02444 yyn = yypact[yystate];
02445 if (yyn != YYPACT_NINF)
02446 {
02447 yyn += YYTERROR;
02448 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02449 {
02450 yyn = yytable[yyn];
02451 if (0 < yyn)
02452 break;
02453 }
02454 }
02455
02456
02457 if (yyssp == yyss)
02458 YYABORT;
02459
02460
02461 yydestruct ("Error: popping",
02462 yystos[yystate], yyvsp);
02463 YYPOPSTACK (1);
02464 yystate = *yyssp;
02465 YY_STACK_PRINT (yyss, yyssp);
02466 }
02467
02468 *++yyvsp = yylval;
02469
02470
02471
02472 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02473
02474 yystate = yyn;
02475 goto yynewstate;
02476
02477
02478
02479
02480
02481 yyacceptlab:
02482 yyresult = 0;
02483 goto yyreturn;
02484
02485
02486
02487
02488 yyabortlab:
02489 yyresult = 1;
02490 goto yyreturn;
02491
02492 #if !defined(yyoverflow) || YYERROR_VERBOSE
02493
02494
02495
02496 yyexhaustedlab:
02497 yyerror (YY_("memory exhausted"));
02498 yyresult = 2;
02499
02500 #endif
02501
02502 yyreturn:
02503 if (yychar != YYEMPTY)
02504 yydestruct ("Cleanup: discarding lookahead",
02505 yytoken, &yylval);
02506
02507
02508 YYPOPSTACK (yylen);
02509 YY_STACK_PRINT (yyss, yyssp);
02510 while (yyssp != yyss)
02511 {
02512 yydestruct ("Cleanup: popping",
02513 yystos[*yyssp], yyvsp);
02514 YYPOPSTACK (1);
02515 }
02516 #ifndef yyoverflow
02517 if (yyss != yyssa)
02518 YYSTACK_FREE (yyss);
02519 #endif
02520 #if YYERROR_VERBOSE
02521 if (yymsg != yymsgbuf)
02522 YYSTACK_FREE (yymsg);
02523 #endif
02524
02525 return YYID (yyresult);
02526 }
02527
02528
02529
02530
02531 #line 525 "/builddir/build/BUILD/lux-0.6.1/core/luxparse.y"
02532
02533 static void InitParamSet(ParamSet &ps, int count, const char **tokens,
02534 void **args, int *sizes, bool *texture_helper) {
02535 ps.Clear();
02536 for (int i = 0; i < count; ++i) {
02537 int type;
02538 string name;
02539 if (lookupType(tokens[i], &type, name)) {
02540 if (texture_helper && texture_helper[i] && type != PARAM_TYPE_TEXTURE && type != PARAM_TYPE_STRING)
02541 {
02542 std::stringstream ss;
02543 ss<<"Bad type for "<<name<<". Changing it to a texture.";
02544 luxError( LUX_SYNTAX,LUX_WARNING,ss.str().c_str());
02545
02546 type = PARAM_TYPE_TEXTURE;
02547 }
02548 void *data = args[i];
02549 int nItems = sizes[i];
02550 if (type == PARAM_TYPE_INT) {
02551
02552 int nAlloc = sizes[i];
02553 int *idata = new int[nAlloc];
02554 float *fdata = (float *)data;
02555 for (int j = 0; j < nAlloc; ++j)
02556 idata[j] = int(fdata[j]);
02557 ps.AddInt(name, idata, nItems);
02558 delete[] idata;
02559 }
02560 else if (type == PARAM_TYPE_BOOL) {
02561
02562 int nAlloc = sizes[i];
02563 bool *bdata = new bool[nAlloc];
02564 for (int j = 0; j < nAlloc; ++j) {
02565 string s(*((const char **)data));
02566 if (s == "true") bdata[j] = true;
02567 else if (s == "false") bdata[j] = false;
02568 else {
02569 std::stringstream ss;
02570 ss<<"Value '"<<s<<"' unknown for boolean parameter '"<<tokens[i]<<"'. Using 'false'.";
02571 luxError( LUX_SYNTAX,LUX_WARNING,ss.str().c_str());
02572
02573
02574 bdata[j] = false;
02575 }
02576 }
02577 ps.AddBool(name, bdata, nItems);
02578 delete[] bdata;
02579 }
02580 else if (type == PARAM_TYPE_FLOAT) {
02581 ps.AddFloat(name, (float *)data, nItems);
02582 } else if (type == PARAM_TYPE_POINT) {
02583 ps.AddPoint(name, (Point *)data, nItems / 3);
02584 } else if (type == PARAM_TYPE_VECTOR) {
02585 ps.AddVector(name, (Vector *)data, nItems / 3);
02586 } else if (type == PARAM_TYPE_NORMAL) {
02587 ps.AddNormal(name, (Normal *)data, nItems / 3);
02588 } else if (type == PARAM_TYPE_COLOR) {
02589 ps.AddRGBColor(name, (RGBColor *)data, nItems / COLOR_SAMPLES);
02590 } else if (type == PARAM_TYPE_STRING) {
02591 string *strings = new string[nItems];
02592 for (int j = 0; j < nItems; ++j)
02593 strings[j] = string(*((const char **)data+j));
02594 ps.AddString(name, strings, nItems);
02595 delete[] strings;
02596 }
02597 else if (type == PARAM_TYPE_TEXTURE) {
02598 if (nItems == 1) {
02599 string val(*((const char **)data));
02600 ps.AddTexture(name, val);
02601 }
02602 else
02603 {
02604
02605 std::stringstream ss;
02606 ss<<"Only one string allowed for 'texture' parameter "<<name;
02607 luxError( LUX_SYNTAX,LUX_ERROR,ss.str().c_str());
02608 }
02609 }
02610 }
02611 else
02612 {
02613
02614 std::stringstream ss;
02615 ss<<"Type of parameter '"<<tokens[i]<<"' is unknown";
02616 luxError( LUX_SYNTAX,LUX_WARNING,ss.str().c_str());
02617 }
02618 }
02619 }
02620 static bool lookupType(const char *token, int *type, string &name) {
02621 BOOST_ASSERT(token != NULL);
02622 *type = 0;
02623 const char *strp = token;
02624 while (*strp && isspace(*strp))
02625 ++strp;
02626 if (!*strp) {
02627
02628 std::stringstream ss;
02629 ss<<"Parameter '"<<token<<"' doesn't have a type declaration?!";
02630 luxError( LUX_SYNTAX,LUX_ERROR,ss.str().c_str());
02631 return false;
02632 }
02633 #define TRY_DECODING_TYPE(name, mask) \
02634 if (strncmp(name, strp, strlen(name)) == 0) { \
02635 *type = mask; strp += strlen(name); \
02636 }
02637 TRY_DECODING_TYPE("float", PARAM_TYPE_FLOAT)
02638 else TRY_DECODING_TYPE("integer", PARAM_TYPE_INT)
02639 else TRY_DECODING_TYPE("bool", PARAM_TYPE_BOOL)
02640 else TRY_DECODING_TYPE("point", PARAM_TYPE_POINT)
02641 else TRY_DECODING_TYPE("vector", PARAM_TYPE_VECTOR)
02642 else TRY_DECODING_TYPE("normal", PARAM_TYPE_NORMAL)
02643 else TRY_DECODING_TYPE("string", PARAM_TYPE_STRING)
02644 else TRY_DECODING_TYPE("texture", PARAM_TYPE_TEXTURE)
02645 else TRY_DECODING_TYPE("color", PARAM_TYPE_COLOR)
02646 else {
02647
02648 std::stringstream ss;
02649 ss<<"Unable to decode type for token '"<<token<<"'";
02650 luxError( LUX_SYNTAX,LUX_ERROR,ss.str().c_str());
02651 return false;
02652 }
02653 while (*strp && isspace(*strp))
02654 ++strp;
02655 name = string(strp);
02656 return true;
02657 }
02658