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