1 /* A Bison parser, made by GNU Bison 1.875.  */
2 
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10 
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.  */
20 
21 /* As a special exception, when this file is copied by Bison into a
22    Bison output file, you may use that output file without restriction.
23    This special exception was added by the Free Software Foundation
24    in version 1.24 of Bison.  */
25 
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28 
29 /* All symbols defined below should begin with yy or YY, to avoid
30    infringing on user name space.  This should be done even for local
31    variables, as they might otherwise be expanded by user macros.
32    There are some unavoidable exceptions within include files to
33    define necessary library symbols; they are noted "INFRINGES ON
34    USER NAME SPACE" below.  */
35 
36 /* Identify Bison output.  */
37 #define YYBISON 1
38 
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41 
42 /* Pure parsers.  */
43 #define YYPURE 0
44 
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47 
48 /* If NAME_PREFIX is specified substitute the variables and functions
49    names.  */
50 #define yyparse ConfigParser_parse
51 #define yylex   ConfigParser_lex
52 #define yyerror ConfigParser_error
53 #define yylval  ConfigParser_lval
54 #define yychar  ConfigParser_char
55 #define yydebug ConfigParser_debug
56 #define yynerrs ConfigParser_nerrs
57 
58 
59 /* Tokens.  */
60 #ifndef YYTOKENTYPE
61 # define YYTOKENTYPE
62    /* Put the tokens into the symbol table, so that GDB and other debuggers
63       know about them.  */
64    enum yytokentype {
65      PRTOKEN_VISUAL = 258,
66      PRTOKEN_SET_SIMPLE = 259,
67      PRTOKEN_VISUAL_ID = 260,
68      PRTOKEN_BUFFER_SIZE = 261,
69      PRTOKEN_LEVEL = 262,
70      PRTOKEN_RGBA = 263,
71      PRTOKEN_DOUBLEBUFFER = 264,
72      PRTOKEN_STEREO = 265,
73      PRTOKEN_AUX_BUFFERS = 266,
74      PRTOKEN_RED_SIZE = 267,
75      PRTOKEN_GREEN_SIZE = 268,
76      PRTOKEN_BLUE_SIZE = 269,
77      PRTOKEN_ALPHA_SIZE = 270,
78      PRTOKEN_DEPTH_SIZE = 271,
79      PRTOKEN_STENCIL_SIZE = 272,
80      PRTOKEN_ACCUM_RED_SIZE = 273,
81      PRTOKEN_ACCUM_GREEN_SIZE = 274,
82      PRTOKEN_ACCUM_BLUE_SIZE = 275,
83      PRTOKEN_ACCUM_ALPHA_SIZE = 276,
84      PRTOKEN_SAMPLES = 277,
85      PRTOKEN_SAMPLE_BUFFERS = 278,
86      PRTOKEN_RENDER_SURFACE = 279,
87      PRTOKEN_WINDOW_RECT = 280,
88      PRTOKEN_INPUT_RECT = 281,
89      PRTOKEN_HOSTNAME = 282,
90      PRTOKEN_DISPLAY = 283,
91      PRTOKEN_SCREEN = 284,
92      PRTOKEN_BORDER = 285,
93      PRTOKEN_DRAWABLE_TYPE = 286,
94      PRTOKEN_WINDOW_TYPE = 287,
95      PRTOKEN_PBUFFER_TYPE = 288,
96      PRTOKEN_CAMERA_GROUP = 289,
97      PRTOKEN_CAMERA = 290,
98      PRTOKEN_PROJECTION_RECT = 291,
99      PRTOKEN_LENS = 292,
100      PRTOKEN_FRUSTUM = 293,
101      PRTOKEN_PERSPECTIVE = 294,
102      PRTOKEN_ORTHO = 295,
103      PRTOKEN_OFFSET = 296,
104      PRTOKEN_ROTATE = 297,
105      PRTOKEN_TRANSLATE = 298,
106      PRTOKEN_SCALE = 299,
107      PRTOKEN_SHEAR = 300,
108      PRTOKEN_CLEAR_COLOR = 301,
109      PRTOKEN_INPUT_AREA = 302,
110      PRTOKEN_ERROR = 303,
111      PRTOKEN_INTEGER = 304,
112      PRTOKEN_HEX_INTEGER = 305,
113      PRTOKEN_FLOAT = 306,
114      PRTOKEN_TRUE = 307,
115      PRTOKEN_FALSE = 308,
116      PRTOKEN_QUOTED_STRING = 309,
117      PRTOKEN_STEREO_SYSTEM_COMMANDS = 310,
118      PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE = 311,
119      PRTOKEN_METHOD = 312,
120      PRTOKEN_PREMULTIPLY = 313,
121      PRTOKEN_POSTMULTIPLY = 314,
122      PRTOKEN_OVERRIDE_REDIRECT = 315,
123      PRTOKEN_SHARELENS = 316,
124      PRTOKEN_SHAREVIEW = 317,
125      PRTOKEN_READ_DRAWABLE = 318,
126      PRTOKEN_SET_RTT_MODE = 319,
127      PRTOKEN_RTT_MODE_NONE = 320,
128      PRTOKEN_RTT_MODE_RGB = 321,
129      PRTOKEN_RTT_MODE_RGBA = 322,
130      PRTOKEN_THREAD_MODEL = 323,
131      PRTOKEN_SINGLE_THREADED = 324,
132      PRTOKEN_THREAD_PER_CAMERA = 325,
133      PRTOKEN_THREAD_PER_RENDER_SURFACE = 326
134    };
135 #endif
136 #define PRTOKEN_VISUAL 258
137 #define PRTOKEN_SET_SIMPLE 259
138 #define PRTOKEN_VISUAL_ID 260
139 #define PRTOKEN_BUFFER_SIZE 261
140 #define PRTOKEN_LEVEL 262
141 #define PRTOKEN_RGBA 263
142 #define PRTOKEN_DOUBLEBUFFER 264
143 #define PRTOKEN_STEREO 265
144 #define PRTOKEN_AUX_BUFFERS 266
145 #define PRTOKEN_RED_SIZE 267
146 #define PRTOKEN_GREEN_SIZE 268
147 #define PRTOKEN_BLUE_SIZE 269
148 #define PRTOKEN_ALPHA_SIZE 270
149 #define PRTOKEN_DEPTH_SIZE 271
150 #define PRTOKEN_STENCIL_SIZE 272
151 #define PRTOKEN_ACCUM_RED_SIZE 273
152 #define PRTOKEN_ACCUM_GREEN_SIZE 274
153 #define PRTOKEN_ACCUM_BLUE_SIZE 275
154 #define PRTOKEN_ACCUM_ALPHA_SIZE 276
155 #define PRTOKEN_SAMPLES 277
156 #define PRTOKEN_SAMPLE_BUFFERS 278
157 #define PRTOKEN_RENDER_SURFACE 279
158 #define PRTOKEN_WINDOW_RECT 280
159 #define PRTOKEN_INPUT_RECT 281
160 #define PRTOKEN_HOSTNAME 282
161 #define PRTOKEN_DISPLAY 283
162 #define PRTOKEN_SCREEN 284
163 #define PRTOKEN_BORDER 285
164 #define PRTOKEN_DRAWABLE_TYPE 286
165 #define PRTOKEN_WINDOW_TYPE 287
166 #define PRTOKEN_PBUFFER_TYPE 288
167 #define PRTOKEN_CAMERA_GROUP 289
168 #define PRTOKEN_CAMERA 290
169 #define PRTOKEN_PROJECTION_RECT 291
170 #define PRTOKEN_LENS 292
171 #define PRTOKEN_FRUSTUM 293
172 #define PRTOKEN_PERSPECTIVE 294
173 #define PRTOKEN_ORTHO 295
174 #define PRTOKEN_OFFSET 296
175 #define PRTOKEN_ROTATE 297
176 #define PRTOKEN_TRANSLATE 298
177 #define PRTOKEN_SCALE 299
178 #define PRTOKEN_SHEAR 300
179 #define PRTOKEN_CLEAR_COLOR 301
180 #define PRTOKEN_INPUT_AREA 302
181 #define PRTOKEN_ERROR 303
182 #define PRTOKEN_INTEGER 304
183 #define PRTOKEN_HEX_INTEGER 305
184 #define PRTOKEN_FLOAT 306
185 #define PRTOKEN_TRUE 307
186 #define PRTOKEN_FALSE 308
187 #define PRTOKEN_QUOTED_STRING 309
188 #define PRTOKEN_STEREO_SYSTEM_COMMANDS 310
189 #define PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE 311
190 #define PRTOKEN_METHOD 312
191 #define PRTOKEN_PREMULTIPLY 313
192 #define PRTOKEN_POSTMULTIPLY 314
193 #define PRTOKEN_OVERRIDE_REDIRECT 315
194 #define PRTOKEN_SHARELENS 316
195 #define PRTOKEN_SHAREVIEW 317
196 #define PRTOKEN_READ_DRAWABLE 318
197 #define PRTOKEN_SET_RTT_MODE 319
198 #define PRTOKEN_RTT_MODE_NONE 320
199 #define PRTOKEN_RTT_MODE_RGB 321
200 #define PRTOKEN_RTT_MODE_RGBA 322
201 #define PRTOKEN_THREAD_MODEL 323
202 #define PRTOKEN_SINGLE_THREADED 324
203 #define PRTOKEN_THREAD_PER_CAMERA 325
204 #define PRTOKEN_THREAD_PER_RENDER_SURFACE 326
205 
206 
207 
208 
209 /* Copy the first part of user declarations.  */
210 
211 
212 
213 #ifndef WIN32
214 #include <unistd.h>
215 #include <sys/wait.h>
216 #include <stdlib.h>
217 #include <fcntl.h>
218 #endif
219 
220 #if 0
221 #ifndef WIN32
222 #define SUPPORT_CPP 1
223 #endif
224 #endif
225 
226 #include <osgDB/fstream>
227 
228 #include <string.h>
229 #include <stdio.h>
230 #include <errno.h>
231 #include <string>
232 
233 #include "FlexLexer.h"
234 
235 #include "CameraConfig.h"
236 
237 
238 using namespace std;
239 using namespace osgProducer;
240 
241 static void ConfigParser_error( const char * );
242 static CameraConfig *cfg = 0L;
243 static std::string fileName = "(stdin)";
244 
245 static yyFlexLexer *flexer = 0L;
246 
yylex()247 static int yylex()
248 {
249     if( flexer == 0L )
250         fprintf( stderr, "Internal error!\n" );
251     return flexer->yylex();
252 }
253 
254 
255 
256 /* Enabling traces.  */
257 #ifndef YYDEBUG
258 # define YYDEBUG 0
259 #endif
260 
261 /* Enabling verbose error messages.  */
262 #ifdef YYERROR_VERBOSE
263 # undef YYERROR_VERBOSE
264 # define YYERROR_VERBOSE 1
265 #else
266 # define YYERROR_VERBOSE 0
267 #endif
268 
269 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
270 
271 typedef union YYSTYPE {
272     char * string;
273     int    integer;
274     float  real;
275     bool boolean;
276 } YYSTYPE;
277 /* Line 191 of yacc.c.  */
278 
279 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
280 # define YYSTYPE_IS_DECLARED 1
281 # define YYSTYPE_IS_TRIVIAL 1
282 #endif
283 
284 
285 
286 /* Copy the second part of user declarations.  */
287 
288 
289 /* Line 214 of yacc.c.  */
290 
291 
292 #if ! defined (yyoverflow) || YYERROR_VERBOSE
293 
294 /* The parser invokes alloca or malloc; define the necessary symbols.  */
295 
296 # if YYSTACK_USE_ALLOCA
297 #  define YYSTACK_ALLOC alloca
298 # else
299 #  ifndef YYSTACK_USE_ALLOCA
300 #   if defined (alloca) || defined (_ALLOCA_H)
301 #    define YYSTACK_ALLOC alloca
302 #   else
303 #    ifdef __GNUC__
304 #     define YYSTACK_ALLOC __builtin_alloca
305 #    endif
306 #   endif
307 #  endif
308 # endif
309 
310 # ifdef YYSTACK_ALLOC
311    /* Pacify GCC's `empty if-body' warning. */
312 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
313 # else
314 #  if defined (__STDC__) || defined (__cplusplus)
315 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
316 #   define YYSIZE_T size_t
317 #  endif
318 #  define YYSTACK_ALLOC malloc
319 #  define YYSTACK_FREE free
320 # endif
321 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
322 
323 
324 #if (! defined (yyoverflow) \
325      && (! defined (__cplusplus) \
326      || (YYSTYPE_IS_TRIVIAL)))
327 
328 /* A type that is properly aligned for any stack member.  */
329 union yyalloc
330 {
331   short yyss;
332   YYSTYPE yyvs;
333   };
334 
335 /* The size of the maximum gap between one aligned stack and the next.  */
336 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
337 
338 /* The size of an array large to enough to hold all stacks, each with
339    N elements.  */
340 # define YYSTACK_BYTES(N) \
341      ((N) * (sizeof (short) + sizeof (YYSTYPE))                \
342       + YYSTACK_GAP_MAXIMUM)
343 
344 /* Copy COUNT objects from FROM to TO.  The source and destination do
345    not overlap.  */
346 # ifndef YYCOPY
347 #  if 1 < __GNUC__
348 #   define YYCOPY(To, From, Count) \
349       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
350 #  else
351 #   define YYCOPY(To, From, Count)        \
352       do                    \
353     {                    \
354       register YYSIZE_T yyi;        \
355       for (yyi = 0; yyi < (Count); yyi++)    \
356         (To)[yyi] = (From)[yyi];        \
357     }                    \
358       while (0)
359 #  endif
360 # endif
361 
362 /* Relocate STACK from its old location to the new one.  The
363    local variables YYSIZE and YYSTACKSIZE give the old and new number of
364    elements in the stack, and YYPTR gives the new location of the
365    stack.  Advance YYPTR to a properly aligned location for the next
366    stack.  */
367 # define YYSTACK_RELOCATE(Stack)                    \
368     do                                    \
369       {                                    \
370     YYSIZE_T yynewbytes;                        \
371     YYCOPY (&yyptr->Stack, Stack, yysize);                \
372     Stack = &yyptr->Stack;                        \
373     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
374     yyptr += yynewbytes / sizeof (*yyptr);                \
375       }                                    \
376     while (0)
377 
378 #endif
379 
380 #if defined (__STDC__) || defined (__cplusplus)
381    typedef signed char yysigned_char;
382 #else
383    typedef short yysigned_char;
384 #endif
385 
386 /* YYFINAL -- State number of the termination state. */
387 #define YYFINAL  32
388 /* YYLAST -- Last index in YYTABLE.  */
389 #define YYLAST   279
390 
391 /* YYNTOKENS -- Number of terminals. */
392 #define YYNTOKENS  76
393 /* YYNNTS -- Number of nonterminals. */
394 #define YYNNTS  45
395 /* YYNRULES -- Number of rules. */
396 #define YYNRULES  122
397 /* YYNRULES -- Number of states. */
398 #define YYNSTATES  266
399 
400 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
401 #define YYUNDEFTOK  2
402 #define YYMAXUTOK   326
403 
404 #define YYTRANSLATE(YYX)                         \
405   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
406 
407 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
408 static const unsigned char yytranslate[] =
409 {
410        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
411        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
412        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
413        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
414        2,     2,     2,     2,    75,     2,     2,     2,     2,     2,
415        2,     2,     2,     2,     2,     2,     2,     2,     2,    72,
416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
417        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
418        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
419        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
420        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
421        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
422        2,     2,     2,    73,     2,    74,     2,     2,     2,     2,
423        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
424        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
425        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
426        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
427        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
428        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
429        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
431        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
432        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
433        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
434        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
435        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
436        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
437       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
438       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
439       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
440       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
441       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
442       65,    66,    67,    68,    69,    70,    71
443 };
444 
445 #if YYDEBUG
446 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
447    YYRHS.  */
448 static const unsigned short yyprhs[] =
449 {
450        0,     0,     3,     5,     7,    10,    12,    14,    16,    18,
451       20,    22,    24,    26,    29,    33,    35,    37,    39,    45,
452       50,    52,    53,    55,    58,    59,    66,    68,    71,    72,
453       76,    78,    85,    89,    93,   100,   102,   104,   105,   111,
454      113,   116,   121,   128,   134,   140,   144,   146,   148,   153,
455      155,   158,   159,   168,   179,   186,   195,   204,   215,   220,
456      221,   228,   230,   233,   234,   238,   240,   247,   254,   258,
457      262,   266,   270,   277,   281,   285,   289,   293,   295,   297,
458      299,   301,   303,   304,   311,   312,   318,   320,   324,   326,
459      329,   332,   335,   337,   339,   341,   344,   347,   350,   353,
460      356,   359,   362,   365,   368,   371,   374,   377,   379,   382,
461      383,   389,   391,   394,   398,   400,   402,   404,   406,   408,
462      410,   412,   414
463 };
464 
465 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
466 static const yysigned_char yyrhs[] =
467 {
468       77,     0,    -1,    78,    -1,    79,    -1,    78,    79,    -1,
469      105,    -1,    99,    -1,    87,    -1,   110,    -1,    84,    -1,
470       83,    -1,    80,    -1,    81,    -1,    80,    81,    -1,    68,
471       82,    72,    -1,    69,    -1,    70,    -1,    71,    -1,    55,
472      116,   118,   118,    72,    -1,    34,    73,    85,    74,    -1,
473       86,    -1,    -1,    87,    -1,    86,    87,    -1,    -1,    35,
474      117,    88,    73,    89,    74,    -1,    90,    -1,    89,    90,
475       -1,    -1,    24,   117,    72,    -1,    99,    -1,    36,   114,
476      114,   114,   114,    72,    -1,    61,   120,    72,    -1,    62,
477      120,    72,    -1,    46,   114,   114,   114,   114,    72,    -1,
478       96,    -1,    91,    -1,    -1,    41,    73,    92,    93,    74,
479       -1,    94,    -1,    93,    94,    -1,    45,   114,   114,    72,
480       -1,    42,   114,   114,   114,   114,    72,    -1,    43,   114,
481      114,   114,    72,    -1,    44,   114,   114,   114,    72,    -1,
482       57,    95,    72,    -1,    58,    -1,    59,    -1,    37,    73,
483       97,    74,    -1,    98,    -1,    97,    98,    -1,    -1,    40,
484      114,   114,   114,   114,   114,   114,    72,    -1,    40,   114,
485      114,   114,   114,   114,   114,   114,   114,    72,    -1,    39,
486      114,   114,   114,   114,    72,    -1,    39,   114,   114,   114,
487      114,   114,   114,    72,    -1,    38,   114,   114,   114,   114,
488      114,   114,    72,    -1,    38,   114,   114,   114,   114,   114,
489      114,   114,   114,    72,    -1,    45,   114,   114,    72,    -1,
490       -1,    24,   117,   100,    73,   101,    74,    -1,   102,    -1,
491      101,   102,    -1,    -1,     3,   117,    72,    -1,   105,    -1,
492       25,   116,   116,   116,   116,    72,    -1,    26,   115,   115,
493      115,   115,    72,    -1,    27,   117,    72,    -1,    28,   116,
494       72,    -1,    29,   116,    72,    -1,    30,   120,    72,    -1,
495       56,   116,   116,   116,   116,    72,    -1,    60,   120,    72,
496       -1,    31,   103,    72,    -1,    63,   117,    72,    -1,    64,
497      104,    72,    -1,    32,    -1,    33,    -1,    65,    -1,    66,
498       -1,    67,    -1,    -1,     3,   117,   106,    73,   108,    74,
499       -1,    -1,     3,   107,    73,   108,    74,    -1,   109,    -1,
500      108,    75,   109,    -1,     4,    -1,     5,   119,    -1,     6,
501      116,    -1,     7,   116,    -1,     8,    -1,     9,    -1,    10,
502       -1,    11,   116,    -1,    12,   116,    -1,    13,   116,    -1,
503       14,   116,    -1,    15,   116,    -1,    16,   116,    -1,    17,
504      116,    -1,    18,   116,    -1,    19,   116,    -1,    20,   116,
505       -1,    21,   116,    -1,    22,   116,    -1,    23,    -1,   116,
506      116,    -1,    -1,    47,   111,    73,   112,    74,    -1,   113,
507       -1,   112,   113,    -1,    24,   117,    72,    -1,    51,    -1,
508       49,    -1,    51,    -1,    49,    -1,    54,    -1,    54,    -1,
509       50,    -1,    52,    -1,    53,    -1
510 };
511 
512 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
513 static const unsigned short yyrline[] =
514 {
515        0,   144,   144,   147,   147,   150,   150,   150,   150,   150,
516      150,   150,   153,   153,   157,   165,   166,   167,   170,   176,
517      179,   182,   182,   182,   186,   185,   194,   194,   197,   199,
518      203,   207,   211,   215,   219,   223,   224,   228,   227,   237,
519      237,   241,   245,   249,   253,   257,   264,   265,   268,   271,
520      271,   274,   276,   280,   284,   288,   292,   296,   300,   307,
521      306,   317,   318,   321,   323,   327,   331,   335,   339,   343,
522      347,   351,   355,   359,   363,   368,   372,   379,   380,   384,
523      385,   386,   391,   390,   400,   399,   410,   410,   413,   417,
524      422,   426,   431,   435,   439,   443,   447,   452,   457,   461,
525      465,   469,   473,   477,   481,   485,   489,   493,   497,   504,
526      503,   509,   509,   513,   519,   523,   530,   536,   542,   548,
527      555,   563,   563
528 };
529 #endif
530 
531 #if YYDEBUG || YYERROR_VERBOSE
532 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
533    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
534 static const char *const yytname[] =
535 {
536   "$end", "error", "$undefined", "PRTOKEN_VISUAL", "PRTOKEN_SET_SIMPLE",
537   "PRTOKEN_VISUAL_ID", "PRTOKEN_BUFFER_SIZE", "PRTOKEN_LEVEL",
538   "PRTOKEN_RGBA", "PRTOKEN_DOUBLEBUFFER", "PRTOKEN_STEREO",
539   "PRTOKEN_AUX_BUFFERS", "PRTOKEN_RED_SIZE", "PRTOKEN_GREEN_SIZE",
540   "PRTOKEN_BLUE_SIZE", "PRTOKEN_ALPHA_SIZE", "PRTOKEN_DEPTH_SIZE",
541   "PRTOKEN_STENCIL_SIZE", "PRTOKEN_ACCUM_RED_SIZE",
542   "PRTOKEN_ACCUM_GREEN_SIZE", "PRTOKEN_ACCUM_BLUE_SIZE",
543   "PRTOKEN_ACCUM_ALPHA_SIZE", "PRTOKEN_SAMPLES", "PRTOKEN_SAMPLE_BUFFERS",
544   "PRTOKEN_RENDER_SURFACE", "PRTOKEN_WINDOW_RECT", "PRTOKEN_INPUT_RECT",
545   "PRTOKEN_HOSTNAME", "PRTOKEN_DISPLAY", "PRTOKEN_SCREEN",
546   "PRTOKEN_BORDER", "PRTOKEN_DRAWABLE_TYPE", "PRTOKEN_WINDOW_TYPE",
547   "PRTOKEN_PBUFFER_TYPE", "PRTOKEN_CAMERA_GROUP", "PRTOKEN_CAMERA",
548   "PRTOKEN_PROJECTION_RECT", "PRTOKEN_LENS", "PRTOKEN_FRUSTUM",
549   "PRTOKEN_PERSPECTIVE", "PRTOKEN_ORTHO", "PRTOKEN_OFFSET",
550   "PRTOKEN_ROTATE", "PRTOKEN_TRANSLATE", "PRTOKEN_SCALE", "PRTOKEN_SHEAR",
551   "PRTOKEN_CLEAR_COLOR", "PRTOKEN_INPUT_AREA", "PRTOKEN_ERROR",
552   "PRTOKEN_INTEGER", "PRTOKEN_HEX_INTEGER", "PRTOKEN_FLOAT",
553   "PRTOKEN_TRUE", "PRTOKEN_FALSE", "PRTOKEN_QUOTED_STRING",
554   "PRTOKEN_STEREO_SYSTEM_COMMANDS",
555   "PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE", "PRTOKEN_METHOD",
556   "PRTOKEN_PREMULTIPLY", "PRTOKEN_POSTMULTIPLY",
557   "PRTOKEN_OVERRIDE_REDIRECT", "PRTOKEN_SHARELENS", "PRTOKEN_SHAREVIEW",
558   "PRTOKEN_READ_DRAWABLE", "PRTOKEN_SET_RTT_MODE",
559   "PRTOKEN_RTT_MODE_NONE", "PRTOKEN_RTT_MODE_RGB",
560   "PRTOKEN_RTT_MODE_RGBA", "PRTOKEN_THREAD_MODEL",
561   "PRTOKEN_SINGLE_THREADED", "PRTOKEN_THREAD_PER_CAMERA",
562   "PRTOKEN_THREAD_PER_RENDER_SURFACE", "';'", "'{'", "'}'", "','",
563   "$accept", "config", "entries", "entry", "system_params",
564   "system_param", "threadModelDirective", "stereo_param", "camera_group",
565   "camera_group_attributes", "cameras", "camera", "@1",
566   "camera_attributes", "camera_attribute", "camera_offset", "@2",
567   "camera_offset_attributes", "camera_offset_attribute",
568   "offset_multiply_method", "lens", "lens_attributes", "lens_attribute",
569   "render_surface", "@3", "render_surface_attributes",
570   "render_surface_attribute", "drawableType", "rtt_mode", "visual", "@4",
571   "@5", "visual_attributes", "visual_attribute", "input_area", "@6",
572   "input_area_entries", "input_area_entry", "real", "floatparam",
573   "intparam", "name", "string", "hex_integer", "bool", 0
574 };
575 #endif
576 
577 # ifdef YYPRINT
578 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
579    token YYLEX-NUM.  */
580 static const unsigned short yytoknum[] =
581 {
582        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
583      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
584      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
585      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
586      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
587      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
588      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
589      325,   326,    59,   123,   125,    44
590 };
591 # endif
592 
593 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
594 static const unsigned char yyr1[] =
595 {
596        0,    76,    77,    78,    78,    79,    79,    79,    79,    79,
597       79,    79,    80,    80,    81,    82,    82,    82,    83,    84,
598       85,    86,    86,    86,    88,    87,    89,    89,    90,    90,
599       90,    90,    90,    90,    90,    90,    90,    92,    91,    93,
600       93,    94,    94,    94,    94,    94,    95,    95,    96,    97,
601       97,    98,    98,    98,    98,    98,    98,    98,    98,   100,
602       99,   101,   101,   102,   102,   102,   102,   102,   102,   102,
603      102,   102,   102,   102,   102,   102,   102,   103,   103,   104,
604      104,   104,   106,   105,   107,   105,   108,   108,   109,   109,
605      109,   109,   109,   109,   109,   109,   109,   109,   109,   109,
606      109,   109,   109,   109,   109,   109,   109,   109,   109,   111,
607      110,   112,   112,   113,   114,   114,   115,   116,   117,   118,
608      119,   120,   120
609 };
610 
611 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
612 static const unsigned char yyr2[] =
613 {
614        0,     2,     1,     1,     2,     1,     1,     1,     1,     1,
615        1,     1,     1,     2,     3,     1,     1,     1,     5,     4,
616        1,     0,     1,     2,     0,     6,     1,     2,     0,     3,
617        1,     6,     3,     3,     6,     1,     1,     0,     5,     1,
618        2,     4,     6,     5,     5,     3,     1,     1,     4,     1,
619        2,     0,     8,    10,     6,     8,     8,    10,     4,     0,
620        6,     1,     2,     0,     3,     1,     6,     6,     3,     3,
621        3,     3,     6,     3,     3,     3,     3,     1,     1,     1,
622        1,     1,     0,     6,     0,     5,     1,     3,     1,     2,
623        2,     2,     1,     1,     1,     2,     2,     2,     2,     2,
624        2,     2,     2,     2,     2,     2,     2,     1,     2,     0,
625        5,     1,     2,     3,     1,     1,     1,     1,     1,     1,
626        1,     1,     1
627 };
628 
629 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
630    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
631    means the default is an error.  */
632 static const unsigned char yydefact[] =
633 {
634        0,    84,     0,     0,     0,   109,     0,     0,     0,     2,
635        3,    11,    12,    10,     9,     7,     6,     5,     8,   118,
636        0,    82,    59,    21,    24,     0,   117,     0,    15,    16,
637       17,     0,     1,     4,    13,     0,     0,     0,     0,    20,
638       22,     0,     0,   119,     0,    14,    88,     0,     0,     0,
639       92,    93,    94,     0,     0,     0,     0,     0,     0,     0,
640        0,     0,     0,     0,     0,   107,     0,    86,     0,     0,
641       63,    19,    23,    28,     0,     0,   111,     0,   120,    89,
642       90,    91,    95,    96,    97,    98,    99,   100,   101,   102,
643      103,   104,   105,   106,    85,     0,   108,     0,    84,     0,
644        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
645        0,    61,    65,     0,     0,     0,     0,     0,     0,     0,
646        0,    26,    36,    35,    30,     0,   110,   112,    18,    87,
647       83,    82,     0,   116,     0,     0,     0,     0,   121,   122,
648        0,    77,    78,     0,     0,     0,     0,    79,    80,    81,
649        0,    60,    62,    59,   115,   114,     0,    51,    37,     0,
650        0,     0,    25,    27,   113,    64,     0,     0,    68,    69,
651       70,    71,    74,     0,    73,    75,    76,    29,     0,     0,
652        0,     0,     0,     0,    49,     0,     0,    32,    33,     0,
653        0,     0,     0,     0,     0,     0,     0,    48,    50,     0,
654        0,     0,     0,     0,     0,    39,     0,     0,     0,     0,
655        0,     0,     0,     0,     0,     0,     0,     0,     0,    46,
656       47,     0,    38,    40,     0,    66,    67,    72,    31,     0,
657        0,     0,    58,     0,     0,     0,     0,    45,    34,     0,
658        0,     0,     0,     0,     0,    41,     0,    54,     0,     0,
659        0,    43,    44,     0,     0,     0,    42,    56,     0,    55,
660       52,     0,     0,     0,    57,    53
661 };
662 
663 /* YYDEFGOTO[NTERM-NUM]. */
664 static const short yydefgoto[] =
665 {
666       -1,     8,     9,    10,    11,    12,    31,    13,    14,    38,
667       39,    15,    41,   120,   121,   122,   185,   204,   205,   221,
668      123,   183,   184,    16,    37,   110,   111,   143,   150,    17,
669       36,    20,    66,    67,    18,    25,    75,    76,   156,   134,
670       68,    21,    44,    79,   140
671 };
672 
673 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
674    STATE-NUM.  */
675 #define YYPACT_NINF -130
676 static const short yypact[] =
677 {
678       36,   -51,   -51,   -66,   -51,  -130,   -33,   -34,    26,    36,
679     -130,    10,  -130,  -130,  -130,  -130,  -130,  -130,  -130,  -130,
680       13,  -130,  -130,    57,  -130,    22,  -130,    45,  -130,  -130,
681     -130,    39,  -130,  -130,  -130,   230,    50,    51,    60,    57,
682     -130,    52,   111,  -130,    45,  -130,  -130,    86,   -33,   -33,
683     -130,  -130,  -130,   -33,   -33,   -33,   -33,   -33,   -33,   -33,
684      -33,   -33,   -33,   -33,   -33,  -130,   -62,  -130,   -33,   230,
685      202,  -130,  -130,    66,   -51,   -10,  -130,    65,  -130,  -130,
686     -130,  -130,  -130,  -130,  -130,  -130,  -130,  -130,  -130,  -130,
687     -130,  -130,  -130,  -130,  -130,   230,  -130,   -54,   -51,   -33,
688       96,   -51,   -33,   -33,    16,    73,   -33,    16,   -51,    15,
689        3,  -130,  -130,   -51,    24,    76,    77,    24,    16,    16,
690       48,  -130,  -130,  -130,  -130,    67,  -130,  -130,  -130,  -130,
691     -130,    79,   -33,  -130,    96,    80,    81,    87,  -130,  -130,
692       93,  -130,  -130,    94,   -33,   100,   109,  -130,  -130,  -130,
693      110,  -130,  -130,   112,  -130,  -130,    24,   131,  -130,    24,
694      114,   115,  -130,  -130,  -130,  -130,   -33,    96,  -130,  -130,
695     -130,  -130,  -130,   -33,  -130,  -130,  -130,  -130,    24,    24,
696       24,    24,    24,   -30,  -130,    88,    24,  -130,  -130,   -33,
697       96,   -33,    24,    24,    24,    24,    24,  -130,  -130,    24,
698       24,    24,    24,    61,    72,  -130,    24,   116,   117,   118,
699      122,    24,    24,    24,   126,    24,    24,    24,    24,  -130,
700     -130,   127,  -130,  -130,   128,  -130,  -130,  -130,  -130,    24,
701       24,    24,  -130,    24,    24,    24,   134,  -130,  -130,    24,
702      -32,    24,    24,   135,   137,  -130,    24,  -130,    24,    24,
703      140,  -130,  -130,   -27,   141,   -26,  -130,  -130,    24,  -130,
704     -130,    24,   142,   144,  -130,  -130
705 };
706 
707 /* YYPGOTO[NTERM-NUM].  */
708 static const short yypgoto[] =
709 {
710     -130,  -130,  -130,   209,  -130,   208,  -130,  -130,  -130,  -130,
711     -130,   -12,  -130,  -130,   101,  -130,  -130,  -130,    18,  -130,
712     -130,  -130,    41,   -55,  -130,  -130,   145,  -130,  -130,   -69,
713     -130,  -130,   156,   159,  -130,  -130,  -130,   151,   -38,  -129,
714       -6,     0,   212,  -130,   -31
715 };
716 
717 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
718    positive, shift that token.  If negative, reduce the rule which
719    number is the opposite.  If zero, do what YYDEFACT says.
720    If YYTABLE_NINF, syntax error.  */
721 #define YYTABLE_NINF -1
722 static const unsigned short yytable[] =
723 {
724       27,   112,    22,    19,    24,   167,    98,    23,   179,   180,
725      181,    40,    94,    95,    74,   182,    26,   154,   124,   155,
726      130,    95,   154,   154,   155,   155,    32,    72,    99,   100,
727      101,   102,   103,   104,   105,    28,    29,    30,   190,     1,
728      247,   112,    80,    81,   197,   257,   260,    82,    83,    84,
729       85,    86,    87,    88,    89,    90,    91,    92,    93,   106,
730        2,   208,    96,   107,   126,   124,   108,   109,   138,   139,
731        3,     4,   113,   154,   125,   155,   145,   151,     7,   159,
732      147,   148,   149,     5,   114,   115,    35,   160,   161,   116,
733      113,     6,     4,   132,   117,    42,   136,   137,   131,    43,
734      144,   135,   114,   115,     7,   141,   142,   116,   146,   118,
735      119,    45,   117,   153,   199,   200,   201,   202,   178,   219,
736      220,   186,   162,    69,    70,    73,   166,   118,   119,   203,
737      199,   200,   201,   202,    71,    74,    78,   128,   173,   164,
738      192,   193,   194,   195,   196,   203,   222,   133,   206,   157,
739      158,   165,   168,   169,   210,   211,   212,   213,   214,   170,
740      189,   215,   216,   217,   218,   171,   172,   191,   224,   179,
741      180,   181,   174,   229,   230,   231,   182,   233,   234,   235,
742      236,   175,   176,   207,   177,   209,   187,   188,   225,   226,
743      227,   239,   240,   241,   228,   242,   243,   244,   232,   237,
744      238,   246,   248,   249,   250,    98,   245,   251,   253,   252,
745      254,   255,   256,   259,   264,   258,   265,   261,    33,    34,
746      262,   163,   223,   263,   198,    97,   127,    99,   100,   101,
747      102,   103,   104,   105,    46,    47,    48,    49,    50,    51,
748       52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
749       62,    63,    64,    65,   129,   152,    77,     0,   106,     0,
750        0,     0,   107,     0,     0,   108,   109,     0,     0,     0,
751        0,     0,     0,     0,     0,     0,     0,     0,     0,    26
752 };
753 
754 static const short yycheck[] =
755 {
756        6,    70,     2,    54,     4,   134,     3,    73,    38,    39,
757       40,    23,    74,    75,    24,    45,    49,    49,    73,    51,
758       74,    75,    49,    49,    51,    51,     0,    39,    25,    26,
759       27,    28,    29,    30,    31,    69,    70,    71,   167,     3,
760       72,   110,    48,    49,    74,    72,    72,    53,    54,    55,
761       56,    57,    58,    59,    60,    61,    62,    63,    64,    56,
762       24,   190,    68,    60,    74,   120,    63,    64,    52,    53,
763       34,    35,    24,    49,    74,    51,   107,    74,    68,   117,
764       65,    66,    67,    47,    36,    37,    73,   118,   119,    41,
765       24,    55,    35,    99,    46,    73,   102,   103,    98,    54,
766      106,   101,    36,    37,    68,    32,    33,    41,   108,    61,
767       62,    72,    46,   113,    42,    43,    44,    45,   156,    58,
768       59,   159,    74,    73,    73,    73,   132,    61,    62,    57,
769       42,    43,    44,    45,    74,    24,    50,    72,   144,    72,
770      178,   179,   180,   181,   182,    57,    74,    51,   186,    73,
771       73,    72,    72,    72,   192,   193,   194,   195,   196,    72,
772      166,   199,   200,   201,   202,    72,    72,   173,   206,    38,
773       39,    40,    72,   211,   212,   213,    45,   215,   216,   217,
774      218,    72,    72,   189,    72,   191,    72,    72,    72,    72,
775       72,   229,   230,   231,    72,   233,   234,   235,    72,    72,
776       72,   239,   240,   241,   242,     3,    72,    72,   246,    72,
777      248,   249,    72,    72,    72,   253,    72,   255,     9,    11,
778      258,   120,   204,   261,   183,    69,    75,    25,    26,    27,
779       28,    29,    30,    31,     4,     5,     6,     7,     8,     9,
780       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
781       20,    21,    22,    23,    95,   110,    44,    -1,    56,    -1,
782       -1,    -1,    60,    -1,    -1,    63,    64,    -1,    -1,    -1,
783       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    49
784 };
785 
786 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
787    symbol of state STATE-NUM.  */
788 static const unsigned char yystos[] =
789 {
790        0,     3,    24,    34,    35,    47,    55,    68,    77,    78,
791       79,    80,    81,    83,    84,    87,    99,   105,   110,    54,
792      107,   117,   117,    73,   117,   111,    49,   116,    69,    70,
793       71,    82,     0,    79,    81,    73,   106,   100,    85,    86,
794       87,    88,    73,    54,   118,    72,     4,     5,     6,     7,
795        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
796       18,    19,    20,    21,    22,    23,   108,   109,   116,    73,
797       73,    74,    87,    73,    24,   112,   113,   118,    50,   119,
798      116,   116,   116,   116,   116,   116,   116,   116,   116,   116,
799      116,   116,   116,   116,    74,    75,   116,   108,     3,    25,
800       26,    27,    28,    29,    30,    31,    56,    60,    63,    64,
801      101,   102,   105,    24,    36,    37,    41,    46,    61,    62,
802       89,    90,    91,    96,    99,   117,    74,   113,    72,   109,
803       74,   117,   116,    51,   115,   117,   116,   116,    52,    53,
804      120,    32,    33,   103,   116,   120,   117,    65,    66,    67,
805      104,    74,   102,   117,    49,    51,   114,    73,    73,   114,
806      120,   120,    74,    90,    72,    72,   116,   115,    72,    72,
807       72,    72,    72,   116,    72,    72,    72,    72,   114,    38,
808       39,    40,    45,    97,    98,    92,   114,    72,    72,   116,
809      115,   116,   114,   114,   114,   114,   114,    74,    98,    42,
810       43,    44,    45,    57,    93,    94,   114,   116,   115,   116,
811      114,   114,   114,   114,   114,   114,   114,   114,   114,    58,
812       59,    95,    74,    94,   114,    72,    72,    72,    72,   114,
813      114,   114,    72,   114,   114,   114,   114,    72,    72,   114,
814      114,   114,   114,   114,   114,    72,   114,    72,   114,   114,
815      114,    72,    72,   114,   114,   114,    72,    72,   114,    72,
816       72,   114,   114,   114,    72,    72
817 };
818 
819 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
820 # define YYSIZE_T __SIZE_TYPE__
821 #endif
822 #if ! defined (YYSIZE_T) && defined (size_t)
823 # define YYSIZE_T size_t
824 #endif
825 #if ! defined (YYSIZE_T)
826 # if defined (__STDC__) || defined (__cplusplus)
827 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
828 #  define YYSIZE_T size_t
829 # endif
830 #endif
831 #if ! defined (YYSIZE_T)
832 # define YYSIZE_T unsigned int
833 #endif
834 
835 #define yyerrok        (yyerrstatus = 0)
836 #define yyclearin    (yychar = YYEMPTY)
837 #define YYEMPTY        (-2)
838 #define YYEOF        0
839 
840 #define YYACCEPT    goto yyacceptlab
841 #define YYABORT        goto yyabortlab
842 #define YYERROR        goto yyerrlab1
843 
844 /* Like YYERROR except do call yyerror.  This remains here temporarily
845    to ease the transition to the new meaning of YYERROR, for GCC.
846    Once GCC version 2 has supplanted version 1, this can go.  */
847 
848 #define YYFAIL        goto yyerrlab
849 
850 #define YYRECOVERING()  (!!yyerrstatus)
851 
852 #define YYBACKUP(Token, Value)                    \
853 do                                \
854   if (yychar == YYEMPTY && yylen == 1)                \
855     {                                \
856       yychar = (Token);                        \
857       yylval = (Value);                        \
858       yytoken = YYTRANSLATE (yychar);                \
859       YYPOPSTACK;                        \
860       goto yybackup;                        \
861     }                                \
862   else                                \
863     {                                 \
864       yyerror ("syntax error: cannot back up");\
865       YYERROR;                            \
866     }                                \
867 while (0)
868 
869 #define YYTERROR    1
870 #define YYERRCODE    256
871 
872 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
873    are run).  */
874 
875 #ifndef YYLLOC_DEFAULT
876 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
877   Current.first_line   = Rhs[1].first_line;      \
878   Current.first_column = Rhs[1].first_column;    \
879   Current.last_line    = Rhs[N].last_line;       \
880   Current.last_column  = Rhs[N].last_column;
881 #endif
882 
883 /* YYLEX -- calling `yylex' with the right arguments.  */
884 
885 #ifdef YYLEX_PARAM
886 # define YYLEX yylex (YYLEX_PARAM)
887 #else
888 # define YYLEX yylex ()
889 #endif
890 
891 /* Enable debugging if requested.  */
892 #if YYDEBUG
893 
894 # ifndef YYFPRINTF
895 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
896 #  define YYFPRINTF fprintf
897 # endif
898 
899 # define YYDPRINTF(Args)            \
900 do {                        \
901   if (yydebug)                    \
902     YYFPRINTF Args;                \
903 } while (0)
904 
905 # define YYDSYMPRINT(Args)            \
906 do {                        \
907   if (yydebug)                    \
908     yysymprint Args;                \
909 } while (0)
910 
911 # define YYDSYMPRINTF(Title, Token, Value, Location)        \
912 do {                                \
913   if (yydebug)                            \
914     {                                \
915       YYFPRINTF (stderr, "%s ", Title);                \
916       yysymprint (stderr,                     \
917                   Token, Value);    \
918       YYFPRINTF (stderr, "\n");                    \
919     }                                \
920 } while (0)
921 
922 /*------------------------------------------------------------------.
923 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
924 | TOP (cinluded).                                                   |
925 `------------------------------------------------------------------*/
926 
927 #if defined (__STDC__) || defined (__cplusplus)
928 static void
yy_stack_print(short * bottom,short * top)929 yy_stack_print (short *bottom, short *top)
930 #else
931 static void
932 yy_stack_print (bottom, top)
933     short *bottom;
934     short *top;
935 #endif
936 {
937   YYFPRINTF (stderr, "Stack now");
938   for (/* Nothing. */; bottom <= top; ++bottom)
939     YYFPRINTF (stderr, " %d", *bottom);
940   YYFPRINTF (stderr, "\n");
941 }
942 
943 # define YY_STACK_PRINT(Bottom, Top)                \
944 do {                                \
945   if (yydebug)                            \
946     yy_stack_print ((Bottom), (Top));                \
947 } while (0)
948 
949 
950 /*------------------------------------------------.
951 | Report that the YYRULE is going to be reduced.  |
952 `------------------------------------------------*/
953 
954 #if defined (__STDC__) || defined (__cplusplus)
955 static void
yy_reduce_print(int yyrule)956 yy_reduce_print (int yyrule)
957 #else
958 static void
959 yy_reduce_print (yyrule)
960     int yyrule;
961 #endif
962 {
963   int yyi;
964   unsigned int yylineno = yyrline[yyrule];
965   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
966              yyrule - 1, yylineno);
967   /* Print the symbols being reduced, and their result.  */
968   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
969     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
970   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
971 }
972 
973 # define YY_REDUCE_PRINT(Rule)        \
974 do {                    \
975   if (yydebug)                \
976     yy_reduce_print (Rule);        \
977 } while (0)
978 
979 /* Nonzero means print parse trace.  It is left uninitialized so that
980    multiple parsers can coexist.  */
981 int yydebug;
982 #else /* !YYDEBUG */
983 # define YYDPRINTF(Args)
984 # define YYDSYMPRINT(Args)
985 # define YYDSYMPRINTF(Title, Token, Value, Location)
986 # define YY_STACK_PRINT(Bottom, Top)
987 # define YY_REDUCE_PRINT(Rule)
988 #endif /* !YYDEBUG */
989 
990 
991 /* YYINITDEPTH -- initial size of the parser's stacks.  */
992 #ifndef    YYINITDEPTH
993 # define YYINITDEPTH 200
994 #endif
995 
996 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
997    if the built-in stack extension method is used).
998 
999    Do not make this value too large; the results are undefined if
1000    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1001    evaluated with infinite-precision integer arithmetic.  */
1002 
1003 #if YYMAXDEPTH == 0
1004 # undef YYMAXDEPTH
1005 #endif
1006 
1007 #ifndef YYMAXDEPTH
1008 # define YYMAXDEPTH 10000
1009 #endif
1010 
1011 
1012 
1013 #if YYERROR_VERBOSE
1014 
1015 # ifndef yystrlen
1016 #  if defined (__GLIBC__) && defined (_STRING_H)
1017 #   define yystrlen strlen
1018 #  else
1019 /* Return the length of YYSTR.  */
1020 static YYSIZE_T
1021 #   if defined (__STDC__) || defined (__cplusplus)
yystrlen(const char * yystr)1022 yystrlen (const char *yystr)
1023 #   else
1024 yystrlen (yystr)
1025      const char *yystr;
1026 #   endif
1027 {
1028   register const char *yys = yystr;
1029 
1030   while (*yys++ != '\0')
1031     continue;
1032 
1033   return yys - yystr - 1;
1034 }
1035 #  endif
1036 # endif
1037 
1038 # ifndef yystpcpy
1039 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1040 #   define yystpcpy stpcpy
1041 #  else
1042 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1043    YYDEST.  */
1044 static char *
1045 #   if defined (__STDC__) || defined (__cplusplus)
yystpcpy(char * yydest,const char * yysrc)1046 yystpcpy (char *yydest, const char *yysrc)
1047 #   else
1048 yystpcpy (yydest, yysrc)
1049      char *yydest;
1050      const char *yysrc;
1051 #   endif
1052 {
1053   register char *yyd = yydest;
1054   register const char *yys = yysrc;
1055 
1056   while ((*yyd++ = *yys++) != '\0')
1057     continue;
1058 
1059   return yyd - 1;
1060 }
1061 #  endif
1062 # endif
1063 
1064 #endif /* !YYERROR_VERBOSE */
1065 
1066 
1067 
1068 #if YYDEBUG
1069 /*--------------------------------.
1070 | Print this symbol on YYOUTPUT.  |
1071 `--------------------------------*/
1072 
1073 #if defined (__STDC__) || defined (__cplusplus)
1074 static void
yysymprint(FILE * yyoutput,int yytype,YYSTYPE * yyvaluep)1075 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1076 #else
1077 static void
1078 yysymprint (yyoutput, yytype, yyvaluep)
1079     FILE *yyoutput;
1080     int yytype;
1081     YYSTYPE *yyvaluep;
1082 #endif
1083 {
1084   /* Pacify ``unused variable'' warnings.  */
1085   (void) yyvaluep;
1086 
1087   if (yytype < YYNTOKENS)
1088     {
1089       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1090 # ifdef YYPRINT
1091       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1092 # endif
1093     }
1094   else
1095     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1096 
1097   switch (yytype)
1098     {
1099       default:
1100         break;
1101     }
1102   YYFPRINTF (yyoutput, ")");
1103 }
1104 
1105 #endif /* ! YYDEBUG */
1106 /*-----------------------------------------------.
1107 | Release the memory associated to this symbol.  |
1108 `-----------------------------------------------*/
1109 
1110 #if defined (__STDC__) || defined (__cplusplus)
1111 static void
yydestruct(int yytype,YYSTYPE * yyvaluep)1112 yydestruct (int yytype, YYSTYPE *yyvaluep)
1113 #else
1114 static void
1115 yydestruct (yytype, yyvaluep)
1116     int yytype;
1117     YYSTYPE *yyvaluep;
1118 #endif
1119 {
1120   /* Pacify ``unused variable'' warnings.  */
1121   (void) yytype;
1122   (void) yyvaluep;
1123 
1124 }
1125 
1126 /* Prevent warnings from -Wmissing-prototypes.  */
1127 
1128 #ifdef YYPARSE_PARAM
1129 # if defined (__STDC__) || defined (__cplusplus)
1130 int yyparse (void *YYPARSE_PARAM);
1131 # else
1132 int yyparse ();
1133 # endif
1134 #else /* ! YYPARSE_PARAM */
1135 #if defined (__STDC__) || defined (__cplusplus)
1136 int yyparse (void);
1137 #else
1138 int yyparse ();
1139 #endif
1140 #endif /* ! YYPARSE_PARAM */
1141 
1142 
1143 
1144 /* The lookahead symbol.  */
1145 int yychar;
1146 
1147 /* The semantic value of the lookahead symbol.  */
1148 YYSTYPE yylval;
1149 
1150 /* Number of syntax errors so far.  */
1151 int yynerrs;
1152 
1153 
1154 
1155 /*----------.
1156 | yyparse.  |
1157 `----------*/
1158 
1159 #ifdef YYPARSE_PARAM
1160 # if defined (__STDC__) || defined (__cplusplus)
yyparse(void * YYPARSE_PARAM)1161 int yyparse (void *YYPARSE_PARAM)
1162 # else
1163 int yyparse (YYPARSE_PARAM)
1164   void *YYPARSE_PARAM;
1165 # endif
1166 #else /* ! YYPARSE_PARAM */
1167 #if defined (__STDC__) || defined (__cplusplus)
1168 int
1169 yyparse (void)
1170 #else
1171 int
1172 yyparse ()
1173 
1174 #endif
1175 #endif
1176 {
1177 
1178   register int yystate;
1179   register int yyn;
1180   int yyresult;
1181   /* Number of tokens to shift before error messages enabled.  */
1182   int yyerrstatus;
1183   /* Lookahead token as an internal (translated) token number.  */
1184   int yytoken = 0;
1185 
1186   /* Three stacks and their tools:
1187      `yyss': related to states,
1188      `yyvs': related to semantic values,
1189      `yyls': related to locations.
1190 
1191      Refer to the stacks through separate pointers, to allow yyoverflow
1192      to reallocate them elsewhere.  */
1193 
1194   /* The state stack.  */
1195   short    yyssa[YYINITDEPTH];
1196   short *yyss = yyssa;
1197   register short *yyssp;
1198 
1199   /* The semantic value stack.  */
1200   YYSTYPE yyvsa[YYINITDEPTH];
1201   YYSTYPE *yyvs = yyvsa;
1202   register YYSTYPE *yyvsp;
1203 
1204 
1205 
1206 #define YYPOPSTACK   (yyvsp--, yyssp--)
1207 
1208   YYSIZE_T yystacksize = YYINITDEPTH;
1209 
1210   /* The variables used to return semantic value and location from the
1211      action routines.  */
1212   YYSTYPE yyval;
1213 
1214 
1215   /* When reducing, the number of symbols on the RHS of the reduced
1216      rule.  */
1217   int yylen;
1218 
1219   YYDPRINTF ((stderr, "Starting parse\n"));
1220 
1221   yystate = 0;
1222   yyerrstatus = 0;
1223   yynerrs = 0;
1224   yychar = YYEMPTY;        /* Cause a token to be read.  */
1225 
1226   /* Initialize stack pointers.
1227      Waste one element of value and location stack
1228      so that they stay on the same level as the state stack.
1229      The wasted elements are never initialized.  */
1230 
1231   yyssp = yyss;
1232   yyvsp = yyvs;
1233 
1234   goto yysetstate;
1235 
1236 /*------------------------------------------------------------.
1237 | yynewstate -- Push a new state, which is found in yystate.  |
1238 `------------------------------------------------------------*/
1239  yynewstate:
1240   /* In all cases, when you get here, the value and location stacks
1241      have just been pushed. so pushing a state here evens the stacks.
1242      */
1243   yyssp++;
1244 
1245  yysetstate:
1246   *yyssp = yystate;
1247 
1248   if (yyss + yystacksize - 1 <= yyssp)
1249     {
1250       /* Get the current used size of the three stacks, in elements.  */
1251       YYSIZE_T yysize = yyssp - yyss + 1;
1252 
1253 #ifdef yyoverflow
1254       {
1255     /* Give user a chance to reallocate the stack. Use copies of
1256        these so that the &'s don't force the real ones into
1257        memory.  */
1258     YYSTYPE *yyvs1 = yyvs;
1259     short *yyss1 = yyss;
1260 
1261 
1262     /* Each stack pointer address is followed by the size of the
1263        data in use in that stack, in bytes.  This used to be a
1264        conditional around just the two extra args, but that might
1265        be undefined if yyoverflow is a macro.  */
1266     yyoverflow ("parser stack overflow",
1267             &yyss1, yysize * sizeof (*yyssp),
1268             &yyvs1, yysize * sizeof (*yyvsp),
1269 
1270             &yystacksize);
1271 
1272     yyss = yyss1;
1273     yyvs = yyvs1;
1274       }
1275 #else /* no yyoverflow */
1276 # ifndef YYSTACK_RELOCATE
1277       goto yyoverflowlab;
1278 # else
1279       /* Extend the stack our own way.  */
1280       if (YYMAXDEPTH <= yystacksize)
1281     goto yyoverflowlab;
1282       yystacksize *= 2;
1283       if (YYMAXDEPTH < yystacksize)
1284     yystacksize = YYMAXDEPTH;
1285 
1286       {
1287     short *yyss1 = yyss;
1288     union yyalloc *yyptr =
1289       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1290     if (! yyptr)
1291       goto yyoverflowlab;
1292     YYSTACK_RELOCATE (yyss);
1293     YYSTACK_RELOCATE (yyvs);
1294 
1295 #  undef YYSTACK_RELOCATE
1296     if (yyss1 != yyssa)
1297       YYSTACK_FREE (yyss1);
1298       }
1299 # endif
1300 #endif /* no yyoverflow */
1301 
1302       yyssp = yyss + yysize - 1;
1303       yyvsp = yyvs + yysize - 1;
1304 
1305 
1306       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1307           (unsigned long int) yystacksize));
1308 
1309       if (yyss + yystacksize - 1 <= yyssp)
1310     YYABORT;
1311     }
1312 
1313   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1314 
1315   goto yybackup;
1316 
1317 /*-----------.
1318 | yybackup.  |
1319 `-----------*/
1320 yybackup:
1321 
1322 /* Do appropriate processing given the current state.  */
1323 /* Read a lookahead token if we need one and don't already have one.  */
1324 /* yyresume: */
1325 
1326   /* First try to decide what to do without reference to lookahead token.  */
1327 
1328   yyn = yypact[yystate];
1329   if (yyn == YYPACT_NINF)
1330     goto yydefault;
1331 
1332   /* Not known => get a lookahead token if don't already have one.  */
1333 
1334   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1335   if (yychar == YYEMPTY)
1336     {
1337       YYDPRINTF ((stderr, "Reading a token: "));
1338       yychar = YYLEX;
1339     }
1340 
1341   if (yychar <= YYEOF)
1342     {
1343       yychar = yytoken = YYEOF;
1344       YYDPRINTF ((stderr, "Now at end of input.\n"));
1345     }
1346   else
1347     {
1348       yytoken = YYTRANSLATE (yychar);
1349       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1350     }
1351 
1352   /* If the proper action on seeing token YYTOKEN is to reduce or to
1353      detect an error, take that action.  */
1354   yyn += yytoken;
1355   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1356     goto yydefault;
1357   yyn = yytable[yyn];
1358   if (yyn <= 0)
1359     {
1360       if (yyn == 0 || yyn == YYTABLE_NINF)
1361     goto yyerrlab;
1362       yyn = -yyn;
1363       goto yyreduce;
1364     }
1365 
1366   if (yyn == YYFINAL)
1367     YYACCEPT;
1368 
1369   /* Shift the lookahead token.  */
1370   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1371 
1372   /* Discard the token being shifted unless it is eof.  */
1373   if (yychar != YYEOF)
1374     yychar = YYEMPTY;
1375 
1376   *++yyvsp = yylval;
1377 
1378 
1379   /* Count tokens shifted since error; after three, turn off error
1380      status.  */
1381   if (yyerrstatus)
1382     yyerrstatus--;
1383 
1384   yystate = yyn;
1385   goto yynewstate;
1386 
1387 
1388 /*-----------------------------------------------------------.
1389 | yydefault -- do the default action for the current state.  |
1390 `-----------------------------------------------------------*/
1391 yydefault:
1392   yyn = yydefact[yystate];
1393   if (yyn == 0)
1394     goto yyerrlab;
1395   goto yyreduce;
1396 
1397 
1398 /*-----------------------------.
1399 | yyreduce -- Do a reduction.  |
1400 `-----------------------------*/
1401 yyreduce:
1402   /* yyn is the number of a rule to reduce with.  */
1403   yylen = yyr2[yyn];
1404 
1405   /* If YYLEN is nonzero, implement the default value of the action:
1406      `$$ = $1'.
1407 
1408      Otherwise, the following line sets YYVAL to garbage.
1409      This behavior is undocumented and Bison
1410      users should not rely upon it.  Assigning to YYVAL
1411      unconditionally makes the parser a bit smaller, and it avoids a
1412      GCC warning that YYVAL may be used uninitialized.  */
1413   yyval = yyvsp[1-yylen];
1414 
1415 
1416   YY_REDUCE_PRINT (yyn);
1417   switch (yyn)
1418     {
1419         case 14:
1420 
1421     {
1422             osgProducer::CameraGroup::ThreadModel tm = (osgProducer::CameraGroup::ThreadModel)yyvsp[-1].integer;
1423             cfg->setThreadModelDirective( tm );
1424         ;}
1425     break;
1426 
1427   case 15:
1428 
1429     { yyval.integer = CameraGroup::SingleThreaded; ;}
1430     break;
1431 
1432   case 16:
1433 
1434     { yyval.integer = CameraGroup::ThreadPerCamera; ;}
1435     break;
1436 
1437   case 17:
1438 
1439     { yyval.integer = CameraGroup::ThreadPerRenderSurface; ;}
1440     break;
1441 
1442   case 18:
1443 
1444     {
1445            cfg->addStereoSystemCommand( yyvsp[-3].integer, yyvsp[-2].string, yyvsp[-1].string );
1446         ;}
1447     break;
1448 
1449   case 24:
1450 
1451     {
1452         cfg->beginCamera( yyvsp[0].string );
1453      ;}
1454     break;
1455 
1456   case 25:
1457 
1458     {
1459         cfg->endCamera();
1460      ;}
1461     break;
1462 
1463   case 29:
1464 
1465     {
1466         cfg->setCameraRenderSurface( yyvsp[-1].string );
1467     ;}
1468     break;
1469 
1470   case 30:
1471 
1472     {
1473         cfg->setCameraRenderSurface();
1474     ;}
1475     break;
1476 
1477   case 31:
1478 
1479     {
1480         cfg->setCameraProjectionRectangle( yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1481     ;}
1482     break;
1483 
1484   case 32:
1485 
1486     {
1487         cfg->setCameraShareLens( yyvsp[-1].boolean );
1488     ;}
1489     break;
1490 
1491   case 33:
1492 
1493     {
1494         cfg->setCameraShareView( yyvsp[-1].boolean );
1495     ;}
1496     break;
1497 
1498   case 34:
1499 
1500     {
1501         cfg->setCameraClearColor( yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1502     ;}
1503     break;
1504 
1505   case 37:
1506 
1507     {
1508         cfg->beginCameraOffset();
1509     ;}
1510     break;
1511 
1512   case 38:
1513 
1514     {
1515         cfg->endCameraOffset();
1516     ;}
1517     break;
1518 
1519   case 41:
1520 
1521     {
1522         cfg->shearCameraOffset( yyvsp[-2].real, yyvsp[-1].real );
1523       ;}
1524     break;
1525 
1526   case 42:
1527 
1528     {
1529         cfg->rotateCameraOffset( yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1530       ;}
1531     break;
1532 
1533   case 43:
1534 
1535     {
1536         cfg->translateCameraOffset( yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1537       ;}
1538     break;
1539 
1540   case 44:
1541 
1542     {
1543         cfg->scaleCameraOffset( yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1544       ;}
1545     break;
1546 
1547   case 45:
1548 
1549     {
1550         cfg->setCameraOffsetMultiplyMethod( (osgProducer::Camera::Offset::MultiplyMethod)yyvsp[-1].integer );
1551       ;}
1552     break;
1553 
1554   case 46:
1555 
1556     { yyval.integer = osgProducer::Camera::Offset::PreMultiply; ;}
1557     break;
1558 
1559   case 47:
1560 
1561     { yyval.integer = osgProducer::Camera::Offset::PostMultiply; ;}
1562     break;
1563 
1564   case 52:
1565 
1566     {
1567           cfg->setCameraOrtho( yyvsp[-6].real, yyvsp[-5].real, yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1568       ;}
1569     break;
1570 
1571   case 53:
1572 
1573     {
1574           cfg->setCameraOrtho( yyvsp[-8].real, yyvsp[-7].real, yyvsp[-6].real, yyvsp[-5].real, yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1575       ;}
1576     break;
1577 
1578   case 54:
1579 
1580     {
1581           cfg->setCameraPerspective( yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1582       ;}
1583     break;
1584 
1585   case 55:
1586 
1587     {
1588           cfg->setCameraPerspective( yyvsp[-6].real, yyvsp[-5].real, yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1589       ;}
1590     break;
1591 
1592   case 56:
1593 
1594     {
1595           cfg->setCameraFrustum( yyvsp[-6].real, yyvsp[-5].real, yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1596       ;}
1597     break;
1598 
1599   case 57:
1600 
1601     {
1602           cfg->setCameraFrustum( yyvsp[-8].real, yyvsp[-7].real, yyvsp[-6].real, yyvsp[-5].real, yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1603       ;}
1604     break;
1605 
1606   case 58:
1607 
1608     {
1609           cfg->setCameraLensShear( yyvsp[-2].real, yyvsp[-1].real );
1610       ;}
1611     break;
1612 
1613   case 59:
1614 
1615     {
1616          cfg->beginRenderSurface( yyvsp[0].string );
1617      ;}
1618     break;
1619 
1620   case 60:
1621 
1622     {
1623          cfg->endRenderSurface();
1624      ;}
1625     break;
1626 
1627   case 64:
1628 
1629     {
1630         cfg->setRenderSurfaceVisualChooser( yyvsp[-1].string );
1631     ;}
1632     break;
1633 
1634   case 65:
1635 
1636     {
1637         cfg->setRenderSurfaceVisualChooser();
1638     ;}
1639     break;
1640 
1641   case 66:
1642 
1643     {
1644         cfg->setRenderSurfaceWindowRectangle( yyvsp[-4].integer, yyvsp[-3].integer, yyvsp[-2].integer, yyvsp[-1].integer );
1645     ;}
1646     break;
1647 
1648   case 67:
1649 
1650     {
1651         cfg->setRenderSurfaceInputRectangle( yyvsp[-4].real, yyvsp[-3].real, yyvsp[-2].real, yyvsp[-1].real );
1652     ;}
1653     break;
1654 
1655   case 68:
1656 
1657     {
1658         cfg->setRenderSurfaceHostName( std::string(yyvsp[-1].string) );
1659     ;}
1660     break;
1661 
1662   case 69:
1663 
1664     {
1665         cfg->setRenderSurfaceDisplayNum( yyvsp[-1].integer );
1666     ;}
1667     break;
1668 
1669   case 70:
1670 
1671     {
1672         cfg->setRenderSurfaceScreen( yyvsp[-1].integer );
1673     ;}
1674     break;
1675 
1676   case 71:
1677 
1678     {
1679         cfg->setRenderSurfaceBorder( yyvsp[-1].boolean );
1680     ;}
1681     break;
1682 
1683   case 72:
1684 
1685     {
1686         cfg->setRenderSurfaceCustomFullScreenRectangle( yyvsp[-4].integer, yyvsp[-3].integer, yyvsp[-2].integer, yyvsp[-1].integer );
1687     ;}
1688     break;
1689 
1690   case 73:
1691 
1692     {
1693         cfg->setRenderSurfaceOverrideRedirect( yyvsp[-1].boolean );
1694     ;}
1695     break;
1696 
1697   case 74:
1698 
1699     {
1700         osgProducer::RenderSurface::DrawableType drawableType = (RenderSurface::DrawableType)yyvsp[-1].integer;
1701         cfg->setRenderSurfaceDrawableType( drawableType );
1702     ;}
1703     break;
1704 
1705   case 75:
1706 
1707     {
1708         cfg->setRenderSurfaceReadDrawable( yyvsp[-1].string );
1709     ;}
1710     break;
1711 
1712   case 76:
1713 
1714     {
1715         cfg->setRenderSurfaceRenderToTextureMode( (osgProducer::RenderSurface::RenderToTextureMode)yyvsp[-1].integer );
1716     ;}
1717     break;
1718 
1719   case 77:
1720 
1721     { yyval.integer =  RenderSurface::DrawableType_Window; ;}
1722     break;
1723 
1724   case 78:
1725 
1726     { yyval.integer =  RenderSurface::DrawableType_PBuffer; ;}
1727     break;
1728 
1729   case 79:
1730 
1731     { yyval.integer = RenderSurface::RenderToTextureMode_None; ;}
1732     break;
1733 
1734   case 80:
1735 
1736     { yyval.integer = RenderSurface::RenderToRGBTexture; ;}
1737     break;
1738 
1739   case 81:
1740 
1741     { yyval.integer = RenderSurface::RenderToRGBATexture; ;}
1742     break;
1743 
1744   case 82:
1745 
1746     {
1747          cfg->beginVisual( yyvsp[0].string );
1748      ;}
1749     break;
1750 
1751   case 83:
1752 
1753     {
1754          cfg->endVisual();
1755      ;}
1756     break;
1757 
1758   case 84:
1759 
1760     {
1761          cfg->beginVisual();
1762      ;}
1763     break;
1764 
1765   case 85:
1766 
1767     {
1768          cfg->endVisual();
1769      ;}
1770     break;
1771 
1772   case 88:
1773 
1774     {
1775           cfg->setVisualSimpleConfiguration();
1776       ;}
1777     break;
1778 
1779   case 89:
1780 
1781     {
1782           cfg->setVisualByID( yyvsp[0].integer );
1783       ;}
1784     break;
1785 
1786   case 90:
1787 
1788     {
1789           cfg->addVisualAttribute( VisualChooser::BufferSize, yyvsp[0].integer );
1790       ;}
1791     break;
1792 
1793   case 91:
1794 
1795     {
1796           cfg->addVisualAttribute( VisualChooser::Level, yyvsp[0].integer );
1797       ;}
1798     break;
1799 
1800   case 92:
1801 
1802     {
1803           cfg->addVisualAttribute( VisualChooser::RGBA );
1804       ;}
1805     break;
1806 
1807   case 93:
1808 
1809     {
1810           cfg->addVisualAttribute( VisualChooser::DoubleBuffer );
1811       ;}
1812     break;
1813 
1814   case 94:
1815 
1816     {
1817           cfg->addVisualAttribute( VisualChooser::Stereo );
1818       ;}
1819     break;
1820 
1821   case 95:
1822 
1823     {
1824           cfg->addVisualAttribute( VisualChooser::AuxBuffers, yyvsp[0].integer );
1825       ;}
1826     break;
1827 
1828   case 96:
1829 
1830     {
1831           cfg->addVisualAttribute( VisualChooser::RedSize, yyvsp[0].integer );
1832       ;}
1833     break;
1834 
1835   case 97:
1836 
1837     {
1838           cfg->addVisualAttribute( VisualChooser::GreenSize, yyvsp[0].integer );
1839       ;}
1840     break;
1841 
1842   case 98:
1843 
1844     {
1845           cfg->addVisualAttribute( VisualChooser::BlueSize, yyvsp[0].integer );
1846       ;}
1847     break;
1848 
1849   case 99:
1850 
1851     {
1852           cfg->addVisualAttribute( VisualChooser::AlphaSize, yyvsp[0].integer );
1853       ;}
1854     break;
1855 
1856   case 100:
1857 
1858     {
1859           cfg->addVisualAttribute( VisualChooser::DepthSize, yyvsp[0].integer );
1860       ;}
1861     break;
1862 
1863   case 101:
1864 
1865     {
1866           cfg->addVisualAttribute( VisualChooser::StencilSize, yyvsp[0].integer );
1867       ;}
1868     break;
1869 
1870   case 102:
1871 
1872     {
1873           cfg->addVisualAttribute( VisualChooser::AccumRedSize, yyvsp[0].integer );
1874       ;}
1875     break;
1876 
1877   case 103:
1878 
1879     {
1880           cfg->addVisualAttribute( VisualChooser::AccumGreenSize, yyvsp[0].integer );
1881       ;}
1882     break;
1883 
1884   case 104:
1885 
1886     {
1887           cfg->addVisualAttribute( VisualChooser::AccumBlueSize, yyvsp[0].integer );
1888       ;}
1889     break;
1890 
1891   case 105:
1892 
1893     {
1894           cfg->addVisualAttribute( VisualChooser::AccumAlphaSize, yyvsp[0].integer );
1895       ;}
1896     break;
1897 
1898   case 106:
1899 
1900     {
1901           cfg->addVisualAttribute( VisualChooser::Samples, yyvsp[0].integer );
1902       ;}
1903     break;
1904 
1905   case 107:
1906 
1907     {
1908           cfg->addVisualAttribute( VisualChooser::SampleBuffers );
1909       ;}
1910     break;
1911 
1912   case 108:
1913 
1914     {
1915           cfg->addVisualExtendedAttribute( yyvsp[-1].integer, yyvsp[0].integer );
1916       ;}
1917     break;
1918 
1919   case 109:
1920 
1921     { cfg->beginInputArea(); ;}
1922     break;
1923 
1924   case 110:
1925 
1926     { cfg->endInputArea(); ;}
1927     break;
1928 
1929   case 113:
1930 
1931     {
1932             cfg->addInputAreaEntry( yyvsp[-1].string );
1933         ;}
1934     break;
1935 
1936   case 114:
1937 
1938     {
1939         yyval.real = osg::asciiToFloat(flexer->YYText());
1940     ;}
1941     break;
1942 
1943   case 115:
1944 
1945     {
1946         yyval.real = osg::asciiToFloat(flexer->YYText());
1947     ;}
1948     break;
1949 
1950   case 116:
1951 
1952     {
1953         yyval.real = osg::asciiToFloat(flexer->YYText());
1954     ;}
1955     break;
1956 
1957   case 117:
1958 
1959     {
1960         yyval.integer = atoi( flexer->YYText() );
1961     ;}
1962     break;
1963 
1964   case 118:
1965 
1966     {
1967         yyval.string = strdup( flexer->YYText() );
1968     ;}
1969     break;
1970 
1971   case 119:
1972 
1973     {
1974         yyval.string = strdup( flexer->YYText() );
1975     ;}
1976     break;
1977 
1978   case 120:
1979 
1980     {
1981         unsigned int n;
1982         sscanf( flexer->YYText(), "0x%x", &n );
1983         yyval.integer = n;
1984     ;}
1985     break;
1986 
1987   case 121:
1988 
1989     { yyval.boolean = true;;}
1990     break;
1991 
1992   case 122:
1993 
1994     { yyval.boolean = false; ;}
1995     break;
1996 
1997 
1998     }
1999 
2000 /* Line 991 of yacc.c.  */
2001 
2002 
2003   yyvsp -= yylen;
2004   yyssp -= yylen;
2005 
2006 
2007   YY_STACK_PRINT (yyss, yyssp);
2008 
2009   *++yyvsp = yyval;
2010 
2011 
2012   /* Now `shift' the result of the reduction.  Determine what state
2013      that goes to, based on the state we popped back to and the rule
2014      number reduced by.  */
2015 
2016   yyn = yyr1[yyn];
2017 
2018   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2019   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2020     yystate = yytable[yystate];
2021   else
2022     yystate = yydefgoto[yyn - YYNTOKENS];
2023 
2024   goto yynewstate;
2025 
2026 
2027 /*------------------------------------.
2028 | yyerrlab -- here on detecting error |
2029 `------------------------------------*/
2030 yyerrlab:
2031   /* If not already recovering from an error, report this error.  */
2032   if (!yyerrstatus)
2033     {
2034       ++yynerrs;
2035 #if YYERROR_VERBOSE
2036       yyn = yypact[yystate];
2037 
2038       if (YYPACT_NINF < yyn && yyn < YYLAST)
2039     {
2040       YYSIZE_T yysize = 0;
2041       int yytype = YYTRANSLATE (yychar);
2042       char *yymsg;
2043       int yyx, yycount;
2044 
2045       yycount = 0;
2046       /* Start YYX at -YYN if negative to avoid negative indexes in
2047          YYCHECK.  */
2048       for (yyx = yyn < 0 ? -yyn : 0;
2049            yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
2050         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2051           yysize += yystrlen (yytname[yyx]) + 15, yycount++;
2052       yysize += yystrlen ("syntax error, unexpected ") + 1;
2053       yysize += yystrlen (yytname[yytype]);
2054       yymsg = (char *) YYSTACK_ALLOC (yysize);
2055       if (yymsg != 0)
2056         {
2057           char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2058           yyp = yystpcpy (yyp, yytname[yytype]);
2059 
2060           if (yycount < 5)
2061         {
2062           yycount = 0;
2063           for (yyx = yyn < 0 ? -yyn : 0;
2064                yyx < (int) (sizeof (yytname) / sizeof (char *));
2065                yyx++)
2066             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2067               {
2068             const char *yyq = ! yycount ? ", expecting " : " or ";
2069             yyp = yystpcpy (yyp, yyq);
2070             yyp = yystpcpy (yyp, yytname[yyx]);
2071             yycount++;
2072               }
2073         }
2074           yyerror (yymsg);
2075           YYSTACK_FREE (yymsg);
2076         }
2077       else
2078         yyerror ("syntax error; also virtual memory exhausted");
2079     }
2080       else
2081 #endif /* YYERROR_VERBOSE */
2082     yyerror ("syntax error");
2083     }
2084 
2085 
2086 
2087   if (yyerrstatus == 3)
2088     {
2089       /* If just tried and failed to reuse lookahead token after an
2090      error, discard it.  */
2091 
2092       /* Return failure if at end of input.  */
2093       if (yychar == YYEOF)
2094         {
2095       /* Pop the error token.  */
2096           YYPOPSTACK;
2097       /* Pop the rest of the stack.  */
2098       while (yyss < yyssp)
2099         {
2100           YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2101           yydestruct (yystos[*yyssp], yyvsp);
2102           YYPOPSTACK;
2103         }
2104       YYABORT;
2105         }
2106 
2107       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2108       yydestruct (yytoken, &yylval);
2109       yychar = YYEMPTY;
2110 
2111     }
2112 
2113   /* Else will try to reuse lookahead token after shifting the error
2114      token.  */
2115   goto yyerrlab2;
2116 
2117 #if 0
2118 /*----------------------------------------------------.
2119 | yyerrlab1 -- error raised explicitly by an action.  |
2120 `----------------------------------------------------*/
2121 yyerrlab1:
2122 
2123   /* Suppress GCC warning that yyerrlab1 is unused when no action
2124      invokes YYERROR.  */
2125 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \
2126     && !defined __cplusplus
2127   __attribute__ ((__unused__))
2128 #endif
2129 
2130 
2131   goto yyerrlab2;
2132 #endif
2133 
2134 /*---------------------------------------------------------------.
2135 | yyerrlab2 -- pop states until the error token can be shifted.  |
2136 `---------------------------------------------------------------*/
2137 yyerrlab2:
2138   yyerrstatus = 3;    /* Each real token shifted decrements this.  */
2139 
2140   for (;;)
2141     {
2142       yyn = yypact[yystate];
2143       if (yyn != YYPACT_NINF)
2144     {
2145       yyn += YYTERROR;
2146       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2147         {
2148           yyn = yytable[yyn];
2149           if (0 < yyn)
2150         break;
2151         }
2152     }
2153 
2154       /* Pop the current state because it cannot handle the error token.  */
2155       if (yyssp == yyss)
2156     YYABORT;
2157 
2158       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2159       yydestruct (yystos[yystate], yyvsp);
2160       yyvsp--;
2161       yystate = *--yyssp;
2162 
2163       YY_STACK_PRINT (yyss, yyssp);
2164     }
2165 
2166   if (yyn == YYFINAL)
2167     YYACCEPT;
2168 
2169   YYDPRINTF ((stderr, "Shifting error token, "));
2170 
2171   *++yyvsp = yylval;
2172 
2173 
2174   yystate = yyn;
2175   goto yynewstate;
2176 
2177 
2178 /*-------------------------------------.
2179 | yyacceptlab -- YYACCEPT comes here.  |
2180 `-------------------------------------*/
2181 yyacceptlab:
2182   yyresult = 0;
2183   goto yyreturn;
2184 
2185 /*-----------------------------------.
2186 | yyabortlab -- YYABORT comes here.  |
2187 `-----------------------------------*/
2188 yyabortlab:
2189   yyresult = 1;
2190   goto yyreturn;
2191 
2192 #ifndef yyoverflow
2193 /*----------------------------------------------.
2194 | yyoverflowlab -- parser overflow comes here.  |
2195 `----------------------------------------------*/
2196 yyoverflowlab:
2197   yyerror ("parser stack overflow");
2198   yyresult = 2;
2199   /* Fall through.  */
2200 #endif
2201 
2202 yyreturn:
2203 #ifndef yyoverflow
2204   if (yyss != yyssa)
2205     YYSTACK_FREE (yyss);
2206 #endif
2207   return yyresult;
2208 }
2209 
2210 
2211 
2212 
2213 
yyerror(const char * errmsg)2214 static void yyerror( const char *errmsg )
2215 {
2216     fprintf( stderr,
2217         "CameraConfig::parseFile(\"%s\") : %s - Line %d at or before \"%s\"\n",
2218         fileName.c_str(),
2219         errmsg,
2220         flexer->lineno(),
2221         flexer->YYText() );
2222 }
2223 
parseFile(const std::string & file)2224 bool CameraConfig::parseFile( const std::string &file )
2225 {
2226     fileName.clear();
2227 
2228     fileName = findFile(file);
2229 
2230     if( fileName.empty() )
2231     {
2232         fprintf( stderr, "CameraConfig::parseFile() - Can't find file \"%s\".\n", file.c_str() );
2233         return false;
2234     }
2235 
2236     bool retval = true;
2237 
2238 #if defined (SUPPORT_CPP)
2239 
2240     const char *cpp_path =
2241   #if defined(__APPLE__)
2242                 "/usr/bin/cpp";
2243   #else
2244                 "/lib/cpp";
2245   #endif
2246 
2247     if( access( cpp_path, X_OK ) == 0 )
2248     {
2249 
2250         int pd[2];
2251         int result = pipe( pd );
2252         if (result<0)
2253         {
2254             fprintf( stderr, "CameraConfig::parseFile() - pipe() failed, errno= \"%d\".\n",  errno);
2255             return false;
2256         }
2257 
2258         flexer = new yyFlexLexer;
2259         if( fork() == 0 )
2260         {
2261             // we don't want to read from the pipe in the child, so close it.
2262             close( pd[0] );
2263             close( 1 );
2264             int result = dup( pd[1] );
2265             if (result<0)
2266             {
2267                 fprintf( stderr, "CameraConfig::parseFile() - dup() failed, errno= \"%d\".\n",  errno);
2268                 return false;
2269             }
2270 
2271 
2272             /* This was here to allow reading a config file from stdin.
2273              * This has never been directly supported, so commenting out.
2274             if( fileName.empty() )
2275                 execlp( cpp_path, "cpp",  "-P", 0L );
2276             else
2277             */
2278             execlp( cpp_path, "cpp",  "-P", fileName.c_str(), (char *)NULL );
2279 
2280             // This should not execute unless an error happens
2281             perror( "execlp" );
2282         }
2283         else
2284         {
2285             close( pd[1]);
2286             close( 0 );
2287             int result = dup( pd[0] );
2288             if (result<0)
2289             {
2290                 fprintf( stderr, "CameraConfig::parseFile() - dup() failed, errno= \"%d\".\n",  errno);
2291                 return false;
2292             }
2293 
2294             cfg = this;
2295 
2296             retval = ConfigParser_parse() == 0 ? true : false;
2297 
2298             // Wait on child process to finish
2299             int stat;
2300             wait( &stat );
2301         }
2302     }
2303     else
2304 #endif
2305     {
2306         osgDB::ifstream ifs(fileName.c_str());
2307         flexer = new yyFlexLexer(&ifs);
2308         cfg = this;
2309         retval = ConfigParser_parse() == 0 ? true : false;
2310         ifs.close();
2311         delete flexer;
2312     }
2313     return retval;
2314 }
2315 
2316 
2317