Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/RenderSystems/GL/src/nvparse/_ts1.0_parser.cpp @ 3

Last change on this file since 3 was 3, checked in by anonymous, 17 years ago

=update

File size: 54.0 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23
24You may alternatively use this source under the terms of a specific version of
25the OGRE Unrestricted License provided you have obtained such a license from
26Torus Knot Software Ltd.
27-----------------------------------------------------------------------------
28*/
29/* A Bison parser, made by GNU Bison 1.875.  */
30
31/* Skeleton parser for Yacc-like parsing with Bison,
32   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
33
34   This program is free software; you can redistribute it and/or modify
35   it under the terms of the GNU General Public License as published by
36   the Free Software Foundation; either version 2, or (at your option)
37   any later version.
38
39   This program is distributed in the hope that it will be useful,
40   but WITHOUT ANY WARRANTY; without even the implied warranty of
41   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42   GNU General Public License for more details.
43
44   You should have received a copy of the GNU General Public License
45   along with this program; if not, write to the Free Software
46   Foundation, Inc., 59 Temple Place - Suite 330,
47   Boston, MA 02111-1307, USA.  */
48
49/* As a special exception, when this file is copied by Bison into a
50   Bison output file, you may use that output file without restriction.
51   This special exception was added by the Free Software Foundation
52   in version 1.24 of Bison.  */
53
54/* Written by Richard Stallman by simplifying the original so called
55   ``semantic'' parser.  */
56
57/* All symbols defined below should begin with yy or YY, to avoid
58   infringing on user name space.  This should be done even for local
59   variables, as they might otherwise be expanded by user macros.
60   There are some unavoidable exceptions within include files to
61   define necessary library symbols; they are noted "INFRINGES ON
62   USER NAME SPACE" below.  */
63
64/* Identify Bison output.  */
65#define YYBISON 1
66
67/* Skeleton name.  */
68#define YYSKELETON_NAME "yacc.c"
69
70/* Pure parsers.  */
71#define YYPURE 0
72
73/* Using locations.  */
74#define YYLSP_NEEDED 0
75
76/* If NAME_PREFIX is specified substitute the variables and functions
77   names.  */
78#define yyparse ts10_parse
79#define yylex   ts10_lex
80#define yyerror ts10_error
81#define yylval  ts10_lval
82#define yychar  ts10_char
83#define yydebug ts10_debug
84#define yynerrs ts10_nerrs
85
86
87/* Tokens.  */
88#ifndef YYTOKENTYPE
89# define YYTOKENTYPE
90   /* Put the tokens into the symbol table, so that GDB and other debuggers
91      know about them.  */
92   enum yytokentype {
93     floatValue = 258,
94     gequal = 259,
95     less = 260,
96     texVariable = 261,
97     expandString = 262,
98     openParen = 263,
99     closeParen = 264,
100     semicolon = 265,
101     comma = 266,
102     nop = 267,
103     texture_1d = 268,
104     texture_2d = 269,
105     texture_rectangle = 270,
106     texture_3d = 271,
107     texture_cube_map = 272,
108     cull_fragment = 273,
109     pass_through = 274,
110     offset_2d_scale = 275,
111     offset_2d = 276,
112     offset_rectangle_scale = 277,
113     offset_rectangle = 278,
114     dependent_ar = 279,
115     dependent_gb = 280,
116     dot_product_2d_1of2 = 281,
117     dot_product_2d_2of2 = 282,
118     dot_product_rectangle_1of2 = 283,
119     dot_product_rectangle_2of2 = 284,
120     dot_product_depth_replace_1of2 = 285,
121     dot_product_depth_replace_2of2 = 286,
122     dot_product_3d_1of3 = 287,
123     dot_product_3d_2of3 = 288,
124     dot_product_3d_3of3 = 289,
125     dot_product_cube_map_1of3 = 290,
126     dot_product_cube_map_2of3 = 291,
127     dot_product_cube_map_3of3 = 292,
128     dot_product_reflect_cube_map_eye_from_qs_1of3 = 293,
129     dot_product_reflect_cube_map_eye_from_qs_2of3 = 294,
130     dot_product_reflect_cube_map_eye_from_qs_3of3 = 295,
131     dot_product_reflect_cube_map_const_eye_1of3 = 296,
132     dot_product_reflect_cube_map_const_eye_2of3 = 297,
133     dot_product_reflect_cube_map_const_eye_3of3 = 298,
134     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 = 299,
135     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 = 300,
136     dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 = 301,
137     dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 = 302,
138     dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 = 303,
139     dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 = 304
140   };
141#endif
142#define floatValue 258
143#define gequal 259
144#define less 260
145#define texVariable 261
146#define expandString 262
147#define openParen 263
148#define closeParen 264
149#define semicolon 265
150#define comma 266
151#define nop 267
152#define texture_1d 268
153#define texture_2d 269
154#define texture_rectangle 270
155#define texture_3d 271
156#define texture_cube_map 272
157#define cull_fragment 273
158#define pass_through 274
159#define offset_2d_scale 275
160#define offset_2d 276
161#define offset_rectangle_scale 277
162#define offset_rectangle 278
163#define dependent_ar 279
164#define dependent_gb 280
165#define dot_product_2d_1of2 281
166#define dot_product_2d_2of2 282
167#define dot_product_rectangle_1of2 283
168#define dot_product_rectangle_2of2 284
169#define dot_product_depth_replace_1of2 285
170#define dot_product_depth_replace_2of2 286
171#define dot_product_3d_1of3 287
172#define dot_product_3d_2of3 288
173#define dot_product_3d_3of3 289
174#define dot_product_cube_map_1of3 290
175#define dot_product_cube_map_2of3 291
176#define dot_product_cube_map_3of3 292
177#define dot_product_reflect_cube_map_eye_from_qs_1of3 293
178#define dot_product_reflect_cube_map_eye_from_qs_2of3 294
179#define dot_product_reflect_cube_map_eye_from_qs_3of3 295
180#define dot_product_reflect_cube_map_const_eye_1of3 296
181#define dot_product_reflect_cube_map_const_eye_2of3 297
182#define dot_product_reflect_cube_map_const_eye_3of3 298
183#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3 299
184#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3 300
185#define dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3 301
186#define dot_product_cube_map_and_reflect_cube_map_const_eye_1of3 302
187#define dot_product_cube_map_and_reflect_cube_map_const_eye_2of3 303
188#define dot_product_cube_map_and_reflect_cube_map_const_eye_3of3 304
189
190
191
192
193/* Copy the first part of user declarations.  */
194#line 3 "ts1.0_grammar.y"
195
196void yyerror(char* s);
197int yylex ( void );
198
199#ifdef _WIN32
200# include <windows.h>
201#endif
202#include <stdio.h>
203#include <stdlib.h>
204#include "ts1.0_inst.h"
205#include "ts1.0_inst_list.h"
206#include "nvparse_errors.h"
207#include "nvparse_externs.h"
208
209
210
211/* Enabling traces.  */
212#ifndef YYDEBUG
213# define YYDEBUG 0
214#endif
215
216/* Enabling verbose error messages.  */
217#ifdef YYERROR_VERBOSE
218# undef YYERROR_VERBOSE
219# define YYERROR_VERBOSE 1
220#else
221# define YYERROR_VERBOSE 0
222#endif
223
224#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
225#line 18 "ts1.0_grammar.y"
226typedef union YYSTYPE {
227  float fval;
228  InstPtr inst;
229  InstListPtr instList;
230  MappedVariablePtr variable;
231} YYSTYPE;
232/* Line 191 of yacc.c.  */
233#line 205 "_ts1.0_parser.c"
234# define yystype YYSTYPE /* obsolescent; will be withdrawn */
235# define YYSTYPE_IS_DECLARED 1
236# define YYSTYPE_IS_TRIVIAL 1
237#endif
238
239
240
241/* Copy the second part of user declarations.  */
242
243
244/* Line 214 of yacc.c.  */
245#line 217 "_ts1.0_parser.c"
246
247#if ! defined (yyoverflow) || YYERROR_VERBOSE
248
249/* The parser invokes alloca or malloc; define the necessary symbols.  */
250
251# if YYSTACK_USE_ALLOCA
252#  define YYSTACK_ALLOC alloca
253# else
254#  ifndef YYSTACK_USE_ALLOCA
255#   if defined (alloca) || defined (_ALLOCA_H)
256#    define YYSTACK_ALLOC alloca
257#   else
258#    ifdef __GNUC__
259#     define YYSTACK_ALLOC __builtin_alloca
260#    endif
261#   endif
262#  endif
263# endif
264
265# ifdef YYSTACK_ALLOC
266   /* Pacify GCC's `empty if-body' warning. */
267#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
268# else
269#  if defined (__STDC__) || defined (__cplusplus)
270#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
271#   define YYSIZE_T size_t
272#  endif
273#  define YYSTACK_ALLOC malloc
274#  define YYSTACK_FREE free
275# endif
276#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
277
278
279#if (! defined (yyoverflow) \
280     && (! defined (__cplusplus) \
281         || (YYSTYPE_IS_TRIVIAL)))
282
283/* A type that is properly aligned for any stack member.  */
284union yyalloc
285{
286  short yyss;
287  YYSTYPE yyvs;
288  };
289
290/* The size of the maximum gap between one aligned stack and the next.  */
291# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
292
293/* The size of an array large to enough to hold all stacks, each with
294   N elements.  */
295# define YYSTACK_BYTES(N) \
296     ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
297      + YYSTACK_GAP_MAXIMUM)
298
299/* Copy COUNT objects from FROM to TO.  The source and destination do
300   not overlap.  */
301# ifndef YYCOPY
302#  if 1 < __GNUC__
303#   define YYCOPY(To, From, Count) \
304      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
305#  else
306#   define YYCOPY(To, From, Count)              \
307      do                                        \
308        {                                       \
309          register YYSIZE_T yyi;                \
310          for (yyi = 0; yyi < (Count); yyi++)   \
311            (To)[yyi] = (From)[yyi];            \
312        }                                       \
313      while (0)
314#  endif
315# endif
316
317/* Relocate STACK from its old location to the new one.  The
318   local variables YYSIZE and YYSTACKSIZE give the old and new number of
319   elements in the stack, and YYPTR gives the new location of the
320   stack.  Advance YYPTR to a properly aligned location for the next
321   stack.  */
322# define YYSTACK_RELOCATE(Stack)                                        \
323    do                                                                  \
324      {                                                                 \
325        YYSIZE_T yynewbytes;                                            \
326        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
327        Stack = &yyptr->Stack;                                          \
328        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
329        yyptr += yynewbytes / sizeof (*yyptr);                          \
330      }                                                                 \
331    while (0)
332
333#endif
334
335#if defined (__STDC__) || defined (__cplusplus)
336   typedef signed char yysigned_char;
337#else
338   typedef short yysigned_char;
339#endif
340
341/* YYFINAL -- State number of the termination state. */
342#define YYFINAL  80
343/* YYLAST -- Last index in YYTABLE.  */
344#define YYLAST   223
345
346/* YYNTOKENS -- Number of terminals. */
347#define YYNTOKENS  50
348/* YYNNTS -- Number of nonterminals. */
349#define YYNNTS  6
350/* YYNRULES -- Number of rules. */
351#define YYNRULES  46
352/* YYNRULES -- Number of states. */
353#define YYNSTATES  218
354
355/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
356#define YYUNDEFTOK  2
357#define YYMAXUTOK   304
358
359#define YYTRANSLATE(YYX)                                                \
360  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
361
362/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
363static const unsigned char yytranslate[] =
364{
365       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
366       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
367       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
368       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
369       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
370       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
371       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
372       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
373       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
374       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
375       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
376       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
377       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
378       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
379       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
380       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
381       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
382       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
383       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
384       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
385       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
386       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
387       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
388       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
389       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
390       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
391       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
392      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
393      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
394      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
395      45,    46,    47,    48,    49
396};
397
398#if YYDEBUG
399/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
400   YYRHS.  */
401static const unsigned short yyprhs[] =
402{
403       0,     0,     3,     5,     9,    12,    17,    19,    23,    27,
404      31,    35,    39,    43,    54,    58,    75,    88,   105,   118,
405     123,   128,   133,   138,   143,   148,   153,   158,   163,   168,
406     173,   178,   183,   188,   193,   198,   203,   214,   219,   224,
407     229,   234,   239,   250,   255,   260,   262
408};
409
410/* YYRHS -- A `-1'-separated list of the rules' RHS. */
411static const yysigned_char yyrhs[] =
412{
413      51,     0,    -1,    52,    -1,    52,    54,    10,    -1,    54,
414      10,    -1,     7,     8,     6,     9,    -1,     6,    -1,    12,
415       8,     9,    -1,    13,     8,     9,    -1,    14,     8,     9,
416      -1,    15,     8,     9,    -1,    16,     8,     9,    -1,    17,
417       8,     9,    -1,    18,     8,    55,    11,    55,    11,    55,
418      11,    55,     9,    -1,    19,     8,     9,    -1,    20,     8,
419       6,    11,     3,    11,     3,    11,     3,    11,     3,    11,
420       3,    11,     3,     9,    -1,    21,     8,     6,    11,     3,
421      11,     3,    11,     3,    11,     3,     9,    -1,    22,     8,
422       6,    11,     3,    11,     3,    11,     3,    11,     3,    11,
423       3,    11,     3,     9,    -1,    23,     8,     6,    11,     3,
424      11,     3,    11,     3,    11,     3,     9,    -1,    24,     8,
425       6,     9,    -1,    25,     8,     6,     9,    -1,    26,     8,
426      53,     9,    -1,    27,     8,    53,     9,    -1,    28,     8,
427      53,     9,    -1,    29,     8,    53,     9,    -1,    30,     8,
428      53,     9,    -1,    31,     8,    53,     9,    -1,    32,     8,
429      53,     9,    -1,    33,     8,    53,     9,    -1,    34,     8,
430      53,     9,    -1,    35,     8,    53,     9,    -1,    36,     8,
431      53,     9,    -1,    37,     8,    53,     9,    -1,    38,     8,
432      53,     9,    -1,    39,     8,    53,     9,    -1,    40,     8,
433      53,     9,    -1,    41,     8,    53,    11,     3,    11,     3,
434      11,     3,     9,    -1,    42,     8,    53,     9,    -1,    43,
435       8,    53,     9,    -1,    44,     8,    53,     9,    -1,    45,
436       8,    53,     9,    -1,    46,     8,    53,     9,    -1,    47,
437       8,    53,    11,     3,    11,     3,    11,     3,     9,    -1,
438      48,     8,    53,     9,    -1,    49,     8,    53,     9,    -1,
439       4,    -1,     5,    -1
440};
441
442/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
443static const unsigned short yyrline[] =
444{
445       0,    73,    73,    81,    87,    97,   103,   111,   115,   119,
446     123,   127,   131,   135,   139,   143,   147,   151,   155,   159,
447     163,   167,   172,   177,   182,   187,   192,   197,   202,   207,
448     212,   217,   222,   227,   232,   237,   242,   247,   252,   257,
449     262,   267,   272,   277,   282,   289,   293
450};
451#endif
452
453#if YYDEBUG || YYERROR_VERBOSE
454/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
455   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
456static const char *const yytname[] =
457{
458  "$end", "error", "$undefined", "floatValue", "gequal", "less", 
459  "texVariable", "expandString", "openParen", "closeParen", "semicolon", 
460  "comma", "nop", "texture_1d", "texture_2d", "texture_rectangle", 
461  "texture_3d", "texture_cube_map", "cull_fragment", "pass_through", 
462  "offset_2d_scale", "offset_2d", "offset_rectangle_scale", 
463  "offset_rectangle", "dependent_ar", "dependent_gb", 
464  "dot_product_2d_1of2", "dot_product_2d_2of2", 
465  "dot_product_rectangle_1of2", "dot_product_rectangle_2of2", 
466  "dot_product_depth_replace_1of2", "dot_product_depth_replace_2of2", 
467  "dot_product_3d_1of3", "dot_product_3d_2of3", "dot_product_3d_3of3", 
468  "dot_product_cube_map_1of3", "dot_product_cube_map_2of3", 
469  "dot_product_cube_map_3of3", 
470  "dot_product_reflect_cube_map_eye_from_qs_1of3", 
471  "dot_product_reflect_cube_map_eye_from_qs_2of3", 
472  "dot_product_reflect_cube_map_eye_from_qs_3of3", 
473  "dot_product_reflect_cube_map_const_eye_1of3", 
474  "dot_product_reflect_cube_map_const_eye_2of3", 
475  "dot_product_reflect_cube_map_const_eye_3of3", 
476  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_1of3", 
477  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_2of3", 
478  "dot_product_cube_map_and_reflect_cube_map_eye_from_qs_3of3", 
479  "dot_product_cube_map_and_reflect_cube_map_const_eye_1of3", 
480  "dot_product_cube_map_and_reflect_cube_map_const_eye_2of3", 
481  "dot_product_cube_map_and_reflect_cube_map_const_eye_3of3", "$accept", 
482  "WholeEnchilada", "InstListDesc", "MappedVariableDesc", "InstDesc", 
483  "CondDesc", 0
484};
485#endif
486
487# ifdef YYPRINT
488/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
489   token YYLEX-NUM.  */
490static const unsigned short yytoknum[] =
491{
492       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
493     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
494     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
495     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
496     295,   296,   297,   298,   299,   300,   301,   302,   303,   304
497};
498# endif
499
500/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
501static const unsigned char yyr1[] =
502{
503       0,    50,    51,    52,    52,    53,    53,    54,    54,    54,
504      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
505      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
506      54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
507      54,    54,    54,    54,    54,    55,    55
508};
509
510/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
511static const unsigned char yyr2[] =
512{
513       0,     2,     1,     3,     2,     4,     1,     3,     3,     3,
514       3,     3,     3,    10,     3,    16,    12,    16,    12,     4,
515       4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
516       4,     4,     4,     4,     4,     4,    10,     4,     4,     4,
517       4,     4,    10,     4,     4,     1,     1
518};
519
520/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
521   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
522   means the default is an error.  */
523static const unsigned char yydefact[] =
524{
525       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
526       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
527       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
528       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
529       2,     0,     0,     0,     0,     0,     0,     0,     0,     0,
530       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
531       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
532       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
533       1,     0,     4,     7,     8,     9,    10,    11,    12,    45,
534      46,     0,    14,     0,     0,     0,     0,     0,     0,     6,
535       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
536       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
537       0,     0,     0,     0,     0,     3,     0,     0,     0,     0,
538       0,    19,    20,     0,    21,    22,    23,    24,    25,    26,
539      27,    28,    29,    30,    31,    32,    33,    34,    35,     0,
540      37,    38,    39,    40,    41,     0,    43,    44,     0,     0,
541       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
542       0,     5,     0,     0,     0,     0,     0,     0,     0,     0,
543       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
544       0,     0,     0,     0,     0,    13,     0,     0,     0,     0,
545      36,    42,     0,     0,     0,     0,     0,    16,     0,    18,
546       0,     0,     0,     0,     0,     0,    15,    17
547};
548
549/* YYDEFGOTO[NTERM-NUM]. */
550static const yysigned_char yydefgoto[] =
551{
552      -1,    39,    40,   101,    41,    91
553};
554
555/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
556   STATE-NUM.  */
557#define YYPACT_NINF -127
558static const short yypact[] =
559{
560     -11,    31,    35,    39,    40,    41,    42,    43,    44,    45,
561      46,    71,    72,    73,    74,    75,    76,    77,    78,    79,
562      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
563      90,    91,    92,    93,    94,    95,    96,    97,    98,   107,
564     -11,    36,    99,   100,   101,   102,   103,   104,    37,   105,
565     109,   110,   111,   112,   113,   114,    38,    38,    38,    38,
566      38,    38,    38,    38,    38,    38,    38,    38,    38,    38,
567      38,    38,    38,    38,    38,    38,    38,    38,    38,    38,
568    -127,   115,  -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,
569    -127,   116,  -127,   117,   118,   119,   120,   123,   124,  -127,
570     126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
571     136,   137,   138,   139,   140,   141,   142,   143,   145,   146,
572     147,   148,   149,   150,   152,  -127,    37,   121,   155,   159,
573     160,  -127,  -127,   158,  -127,  -127,  -127,  -127,  -127,  -127,
574    -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,  -127,   162,
575    -127,  -127,  -127,  -127,  -127,   163,  -127,  -127,   156,   157,
576     161,   164,   165,   168,   167,   169,    37,   166,   170,   171,
577     176,  -127,   178,   179,   172,   173,   174,   175,   177,   180,
578     181,    37,   184,   186,   187,   190,   191,   192,   188,   185,
579     189,   193,   194,   197,   198,  -127,   195,   196,   199,   200,
580    -127,  -127,   201,   202,   203,   204,   205,  -127,   206,  -127,
581     207,   208,   212,   213,   211,   214,  -127,  -127
582};
583
584/* YYPGOTO[NTERM-NUM].  */
585static const short yypgoto[] =
586{
587    -127,  -127,  -127,    -1,   182,  -126
588};
589
590/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
591   positive, shift that token.  If negative, reduce the rule which
592   number is the opposite.  If zero, do what YYDEFACT says.
593   If YYTABLE_NINF, syntax error.  */
594#define YYTABLE_NINF -1
595static const unsigned char yytable[] =
596{
597     158,     1,     2,     3,     4,     5,     6,     7,     8,     9,
598      10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
599      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
600      30,    31,    32,    33,    34,    35,    36,    37,    38,    42,
601     174,    89,    90,    43,    99,   100,    82,    44,    45,    46,
602      47,    48,    49,    50,    51,   188,   102,   103,   104,   105,
603     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
604     116,   117,   118,   119,   120,   121,   122,   123,   124,    52,
605      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
606      63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
607      73,    74,    75,    76,    77,    78,    79,    80,    83,    84,
608      85,    86,    87,    88,    92,    93,    94,    95,    96,    97,
609      98,     0,     0,     0,   159,   125,     0,   126,   127,   128,
610     129,   130,   131,   132,   133,     0,   134,   135,   136,   137,
611     138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
612     148,     0,   150,   149,   151,   152,   153,   154,   160,   156,
613     155,   157,   161,   162,   163,   164,   165,   166,   167,   175,
614       0,     0,   168,   176,   177,   169,   170,   171,   172,   178,
615     173,   179,   180,   181,   182,   183,   184,   189,   185,   190,
616     191,   186,   187,   192,   193,   194,   196,   195,   202,   203,
617     197,     0,   204,   205,   198,   199,   200,   201,   210,   211,
618       0,   207,   206,   209,   208,   214,   215,     0,   212,   213,
619     216,     0,    81,   217
620};
621
622static const short yycheck[] =
623{
624     126,    12,    13,    14,    15,    16,    17,    18,    19,    20,
625      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
626      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
627      41,    42,    43,    44,    45,    46,    47,    48,    49,     8,
628     166,     4,     5,     8,     6,     7,    10,     8,     8,     8,
629       8,     8,     8,     8,     8,   181,    57,    58,    59,    60,
630      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
631      71,    72,    73,    74,    75,    76,    77,    78,    79,     8,
632       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
633       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
634       8,     8,     8,     8,     8,     8,     8,     0,     9,     9,
635       9,     9,     9,     9,     9,     6,     6,     6,     6,     6,
636       6,    -1,    -1,    -1,     3,    10,    -1,    11,    11,    11,
637      11,    11,     9,     9,     8,    -1,     9,     9,     9,     9,
638       9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
639       9,    -1,     9,    11,     9,     9,     9,     9,     3,     9,
640      11,     9,     3,     3,     6,     3,     3,    11,    11,     3,
641      -1,    -1,    11,     3,     3,    11,    11,     9,    11,     3,
642      11,     3,     3,    11,    11,    11,    11,     3,    11,     3,
643       3,    11,    11,     3,     3,     3,    11,     9,     3,     3,
644      11,    -1,     3,     3,    11,    11,     9,     9,     3,     3,
645      -1,     9,    11,     9,    11,     3,     3,    -1,    11,    11,
646       9,    -1,    40,     9
647};
648
649/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
650   symbol of state STATE-NUM.  */
651static const unsigned char yystos[] =
652{
653       0,    12,    13,    14,    15,    16,    17,    18,    19,    20,
654      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
655      31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
656      41,    42,    43,    44,    45,    46,    47,    48,    49,    51,
657      52,    54,     8,     8,     8,     8,     8,     8,     8,     8,
658       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
659       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
660       8,     8,     8,     8,     8,     8,     8,     8,     8,     8,
661       0,    54,    10,     9,     9,     9,     9,     9,     9,     4,
662       5,    55,     9,     6,     6,     6,     6,     6,     6,     6,
663       7,    53,    53,    53,    53,    53,    53,    53,    53,    53,
664      53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
665      53,    53,    53,    53,    53,    10,    11,    11,    11,    11,
666      11,     9,     9,     8,     9,     9,     9,     9,     9,     9,
667       9,     9,     9,     9,     9,     9,     9,     9,     9,    11,
668       9,     9,     9,     9,     9,    11,     9,     9,    55,     3,
669       3,     3,     3,     6,     3,     3,    11,    11,    11,    11,
670      11,     9,    11,    11,    55,     3,     3,     3,     3,     3,
671       3,    11,    11,    11,    11,    11,    11,    11,    55,     3,
672       3,     3,     3,     3,     3,     9,    11,    11,    11,    11,
673       9,     9,     3,     3,     3,     3,    11,     9,    11,     9,
674       3,     3,    11,    11,     3,     3,     9,     9
675};
676
677#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
678# define YYSIZE_T __SIZE_TYPE__
679#endif
680#if ! defined (YYSIZE_T) && defined (size_t)
681# define YYSIZE_T size_t
682#endif
683#if ! defined (YYSIZE_T)
684# if defined (__STDC__) || defined (__cplusplus)
685#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
686#  define YYSIZE_T size_t
687# endif
688#endif
689#if ! defined (YYSIZE_T)
690# define YYSIZE_T unsigned int
691#endif
692
693#define yyerrok         (yyerrstatus = 0)
694#define yyclearin       (yychar = YYEMPTY)
695#define YYEMPTY         (-2)
696#define YYEOF           0
697
698#define YYACCEPT        goto yyacceptlab
699#define YYABORT         goto yyabortlab
700#define YYERROR         goto yyerrlab1
701
702
703/* Like YYERROR except do call yyerror.  This remains here temporarily
704   to ease the transition to the new meaning of YYERROR, for GCC.
705   Once GCC version 2 has supplanted version 1, this can go.  */
706
707#define YYFAIL          goto yyerrlab
708
709#define YYRECOVERING()  (!!yyerrstatus)
710
711#define YYBACKUP(Token, Value)                                  \
712do                                                              \
713  if (yychar == YYEMPTY && yylen == 1)                          \
714    {                                                           \
715      yychar = (Token);                                         \
716      yylval = (Value);                                         \
717      yytoken = YYTRANSLATE (yychar);                           \
718      YYPOPSTACK;                                               \
719      goto yybackup;                                            \
720    }                                                           \
721  else                                                          \
722    {                                                           \
723      yyerror ("syntax error: cannot back up");\
724      YYERROR;                                                  \
725    }                                                           \
726while (0)
727
728#define YYTERROR        1
729#define YYERRCODE       256
730
731/* YYLLOC_DEFAULT -- Compute the default location (before the actions
732   are run).  */
733
734#ifndef YYLLOC_DEFAULT
735# define YYLLOC_DEFAULT(Current, Rhs, N)         \
736  Current.first_line   = Rhs[1].first_line;      \
737  Current.first_column = Rhs[1].first_column;    \
738  Current.last_line    = Rhs[N].last_line;       \
739  Current.last_column  = Rhs[N].last_column;
740#endif
741
742/* YYLEX -- calling `yylex' with the right arguments.  */
743
744#ifdef YYLEX_PARAM
745# define YYLEX yylex (YYLEX_PARAM)
746#else
747# define YYLEX yylex ()
748#endif
749
750/* Enable debugging if requested.  */
751#if YYDEBUG
752
753# ifndef YYFPRINTF
754#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
755#  define YYFPRINTF fprintf
756# endif
757
758# define YYDPRINTF(Args)                        \
759do {                                            \
760  if (yydebug)                                  \
761    YYFPRINTF Args;                             \
762} while (0)
763
764# define YYDSYMPRINT(Args)                      \
765do {                                            \
766  if (yydebug)                                  \
767    yysymprint Args;                            \
768} while (0)
769
770# define YYDSYMPRINTF(Title, Token, Value, Location)            \
771do {                                                            \
772  if (yydebug)                                                  \
773    {                                                           \
774      YYFPRINTF (stderr, "%s ", Title);                         \
775      yysymprint (stderr,                                       \
776                  Token, Value);        \
777      YYFPRINTF (stderr, "\n");                                 \
778    }                                                           \
779} while (0)
780
781/*------------------------------------------------------------------.
782| yy_stack_print -- Print the state stack from its BOTTOM up to its |
783| TOP (cinluded).                                                   |
784`------------------------------------------------------------------*/
785
786#if defined (__STDC__) || defined (__cplusplus)
787static void
788yy_stack_print (short *bottom, short *top)
789#else
790static void
791yy_stack_print (bottom, top)
792    short *bottom;
793    short *top;
794#endif
795{
796  YYFPRINTF (stderr, "Stack now");
797  for (/* Nothing. */; bottom <= top; ++bottom)
798    YYFPRINTF (stderr, " %d", *bottom);
799  YYFPRINTF (stderr, "\n");
800}
801
802# define YY_STACK_PRINT(Bottom, Top)                            \
803do {                                                            \
804  if (yydebug)                                                  \
805    yy_stack_print ((Bottom), (Top));                           \
806} while (0)
807
808
809/*------------------------------------------------.
810| Report that the YYRULE is going to be reduced.  |
811`------------------------------------------------*/
812
813#if defined (__STDC__) || defined (__cplusplus)
814static void
815yy_reduce_print (int yyrule)
816#else
817static void
818yy_reduce_print (yyrule)
819    int yyrule;
820#endif
821{
822  int yyi;
823  unsigned int yylineno = yyrline[yyrule];
824  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
825             yyrule - 1, yylineno);
826  /* Print the symbols being reduced, and their result.  */
827  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
828    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
829  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
830}
831
832# define YY_REDUCE_PRINT(Rule)          \
833do {                                    \
834  if (yydebug)                          \
835    yy_reduce_print (Rule);             \
836} while (0)
837
838/* Nonzero means print parse trace.  It is left uninitialized so that
839   multiple parsers can coexist.  */
840int yydebug;
841#else /* !YYDEBUG */
842# define YYDPRINTF(Args)
843# define YYDSYMPRINT(Args)
844# define YYDSYMPRINTF(Title, Token, Value, Location)
845# define YY_STACK_PRINT(Bottom, Top)
846# define YY_REDUCE_PRINT(Rule)
847#endif /* !YYDEBUG */
848
849
850/* YYINITDEPTH -- initial size of the parser's stacks.  */
851#ifndef YYINITDEPTH
852# define YYINITDEPTH 200
853#endif
854
855/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
856   if the built-in stack extension method is used).
857
858   Do not make this value too large; the results are undefined if
859   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
860   evaluated with infinite-precision integer arithmetic.  */
861
862#if YYMAXDEPTH == 0
863# undef YYMAXDEPTH
864#endif
865
866#ifndef YYMAXDEPTH
867# define YYMAXDEPTH 10000
868#endif
869
870
871
872#if YYERROR_VERBOSE
873
874# ifndef yystrlen
875#  if defined (__GLIBC__) && defined (_STRING_H)
876#   define yystrlen strlen
877#  else
878/* Return the length of YYSTR.  */
879static YYSIZE_T
880#   if defined (__STDC__) || defined (__cplusplus)
881yystrlen (const char *yystr)
882#   else
883yystrlen (yystr)
884     const char *yystr;
885#   endif
886{
887  register const char *yys = yystr;
888
889  while (*yys++ != '\0')
890    continue;
891
892  return yys - yystr - 1;
893}
894#  endif
895# endif
896
897# ifndef yystpcpy
898#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
899#   define yystpcpy stpcpy
900#  else
901/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
902   YYDEST.  */
903static char *
904#   if defined (__STDC__) || defined (__cplusplus)
905yystpcpy (char *yydest, const char *yysrc)
906#   else
907yystpcpy (yydest, yysrc)
908     char *yydest;
909     const char *yysrc;
910#   endif
911{
912  register char *yyd = yydest;
913  register const char *yys = yysrc;
914
915  while ((*yyd++ = *yys++) != '\0')
916    continue;
917
918  return yyd - 1;
919}
920#  endif
921# endif
922
923#endif /* !YYERROR_VERBOSE */
924
925
926
927#if YYDEBUG
928/*--------------------------------.
929| Print this symbol on YYOUTPUT.  |
930`--------------------------------*/
931
932#if defined (__STDC__) || defined (__cplusplus)
933static void
934yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
935#else
936static void
937yysymprint (yyoutput, yytype, yyvaluep)
938    FILE *yyoutput;
939    int yytype;
940    YYSTYPE *yyvaluep;
941#endif
942{
943  /* Pacify ``unused variable'' warnings.  */
944  (void) yyvaluep;
945
946  if (yytype < YYNTOKENS)
947    {
948      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
949# ifdef YYPRINT
950      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
951# endif
952    }
953  else
954    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
955
956  switch (yytype)
957    {
958      default:
959        break;
960    }
961  YYFPRINTF (yyoutput, ")");
962}
963
964#endif /* ! YYDEBUG */
965/*-----------------------------------------------.
966| Release the memory associated to this symbol.  |
967`-----------------------------------------------*/
968
969#if defined (__STDC__) || defined (__cplusplus)
970static void
971yydestruct (int yytype, YYSTYPE *yyvaluep)
972#else
973static void
974yydestruct (yytype, yyvaluep)
975    int yytype;
976    YYSTYPE *yyvaluep;
977#endif
978{
979  /* Pacify ``unused variable'' warnings.  */
980  (void) yyvaluep;
981
982  switch (yytype)
983    {
984
985      default:
986        break;
987    }
988}
989
990
991/* Prevent warnings from -Wmissing-prototypes.  */
992
993#ifdef YYPARSE_PARAM
994# if defined (__STDC__) || defined (__cplusplus)
995int yyparse (void *YYPARSE_PARAM);
996# else
997int yyparse ();
998# endif
999#else /* ! YYPARSE_PARAM */
1000#if defined (__STDC__) || defined (__cplusplus)
1001int yyparse (void);
1002#else
1003int yyparse ();
1004#endif
1005#endif /* ! YYPARSE_PARAM */
1006
1007
1008
1009/* The lookahead symbol.  */
1010int yychar;
1011
1012/* The semantic value of the lookahead symbol.  */
1013YYSTYPE yylval;
1014
1015/* Number of syntax errors so far.  */
1016int yynerrs;
1017
1018
1019
1020/*----------.
1021| yyparse.  |
1022`----------*/
1023
1024#ifdef YYPARSE_PARAM
1025# if defined (__STDC__) || defined (__cplusplus)
1026int yyparse (void *YYPARSE_PARAM)
1027# else
1028int yyparse (YYPARSE_PARAM)
1029  void *YYPARSE_PARAM;
1030# endif
1031#else /* ! YYPARSE_PARAM */
1032#if defined (__STDC__) || defined (__cplusplus)
1033int
1034yyparse (void)
1035#else
1036int
1037yyparse ()
1038
1039#endif
1040#endif
1041{
1042 
1043  register int yystate;
1044  register int yyn;
1045  int yyresult;
1046  /* Number of tokens to shift before error messages enabled.  */
1047  int yyerrstatus;
1048  /* Lookahead token as an internal (translated) token number.  */
1049  int yytoken = 0;
1050
1051  /* Three stacks and their tools:
1052     `yyss': related to states,
1053     `yyvs': related to semantic values,
1054     `yyls': related to locations.
1055
1056     Refer to the stacks thru separate pointers, to allow yyoverflow
1057     to reallocate them elsewhere.  */
1058
1059  /* The state stack.  */
1060  short yyssa[YYINITDEPTH];
1061  short *yyss = yyssa;
1062  register short *yyssp;
1063
1064  /* The semantic value stack.  */
1065  YYSTYPE yyvsa[YYINITDEPTH];
1066  YYSTYPE *yyvs = yyvsa;
1067  register YYSTYPE *yyvsp;
1068
1069
1070
1071#define YYPOPSTACK   (yyvsp--, yyssp--)
1072
1073  YYSIZE_T yystacksize = YYINITDEPTH;
1074
1075  /* The variables used to return semantic value and location from the
1076     action routines.  */
1077  YYSTYPE yyval;
1078
1079
1080  /* When reducing, the number of symbols on the RHS of the reduced
1081     rule.  */
1082  int yylen;
1083
1084  YYDPRINTF ((stderr, "Starting parse\n"));
1085
1086  yystate = 0;
1087  yyerrstatus = 0;
1088  yynerrs = 0;
1089  yychar = YYEMPTY;             /* Cause a token to be read.  */
1090
1091  /* Initialize stack pointers.
1092     Waste one element of value and location stack
1093     so that they stay on the same level as the state stack.
1094     The wasted elements are never initialized.  */
1095
1096  yyssp = yyss;
1097  yyvsp = yyvs;
1098
1099  goto yysetstate;
1100
1101/*------------------------------------------------------------.
1102| yynewstate -- Push a new state, which is found in yystate.  |
1103`------------------------------------------------------------*/
1104 yynewstate:
1105  /* In all cases, when you get here, the value and location stacks
1106     have just been pushed. so pushing a state here evens the stacks.
1107     */
1108  yyssp++;
1109
1110 yysetstate:
1111  *yyssp = yystate;
1112
1113  if (yyss + yystacksize - 1 <= yyssp)
1114    {
1115      /* Get the current used size of the three stacks, in elements.  */
1116      YYSIZE_T yysize = yyssp - yyss + 1;
1117
1118#ifdef yyoverflow
1119      {
1120        /* Give user a chance to reallocate the stack. Use copies of
1121           these so that the &'s don't force the real ones into
1122           memory.  */
1123        YYSTYPE *yyvs1 = yyvs;
1124        short *yyss1 = yyss;
1125
1126
1127        /* Each stack pointer address is followed by the size of the
1128           data in use in that stack, in bytes.  This used to be a
1129           conditional around just the two extra args, but that might
1130           be undefined if yyoverflow is a macro.  */
1131        yyoverflow ("parser stack overflow",
1132                    &yyss1, yysize * sizeof (*yyssp),
1133                    &yyvs1, yysize * sizeof (*yyvsp),
1134
1135                    &yystacksize);
1136
1137        yyss = yyss1;
1138        yyvs = yyvs1;
1139      }
1140#else /* no yyoverflow */
1141# ifndef YYSTACK_RELOCATE
1142      goto yyoverflowlab;
1143# else
1144      /* Extend the stack our own way.  */
1145      if (YYMAXDEPTH <= yystacksize)
1146        goto yyoverflowlab;
1147      yystacksize *= 2;
1148      if (YYMAXDEPTH < yystacksize)
1149        yystacksize = YYMAXDEPTH;
1150
1151      {
1152        short *yyss1 = yyss;
1153        union yyalloc *yyptr =
1154          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1155        if (! yyptr)
1156          goto yyoverflowlab;
1157        YYSTACK_RELOCATE (yyss);
1158        YYSTACK_RELOCATE (yyvs);
1159
1160#  undef YYSTACK_RELOCATE
1161        if (yyss1 != yyssa)
1162          YYSTACK_FREE (yyss1);
1163      }
1164# endif
1165#endif /* no yyoverflow */
1166
1167      yyssp = yyss + yysize - 1;
1168      yyvsp = yyvs + yysize - 1;
1169
1170
1171      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1172                  (unsigned long int) yystacksize));
1173
1174      if (yyss + yystacksize - 1 <= yyssp)
1175        YYABORT;
1176    }
1177
1178  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1179
1180  goto yybackup;
1181
1182/*-----------.
1183| yybackup.  |
1184`-----------*/
1185yybackup:
1186
1187/* Do appropriate processing given the current state.  */
1188/* Read a lookahead token if we need one and don't already have one.  */
1189/* yyresume: */
1190
1191  /* First try to decide what to do without reference to lookahead token.  */
1192
1193  yyn = yypact[yystate];
1194  if (yyn == YYPACT_NINF)
1195    goto yydefault;
1196
1197  /* Not known => get a lookahead token if don't already have one.  */
1198
1199  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1200  if (yychar == YYEMPTY)
1201    {
1202      YYDPRINTF ((stderr, "Reading a token: "));
1203      yychar = YYLEX;
1204    }
1205
1206  if (yychar <= YYEOF)
1207    {
1208      yychar = yytoken = YYEOF;
1209      YYDPRINTF ((stderr, "Now at end of input.\n"));
1210    }
1211  else
1212    {
1213      yytoken = YYTRANSLATE (yychar);
1214      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1215    }
1216
1217  /* If the proper action on seeing token YYTOKEN is to reduce or to
1218     detect an error, take that action.  */
1219  yyn += yytoken;
1220  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1221    goto yydefault;
1222  yyn = yytable[yyn];
1223  if (yyn <= 0)
1224    {
1225      if (yyn == 0 || yyn == YYTABLE_NINF)
1226        goto yyerrlab;
1227      yyn = -yyn;
1228      goto yyreduce;
1229    }
1230
1231  if (yyn == YYFINAL)
1232    YYACCEPT;
1233
1234  /* Shift the lookahead token.  */
1235  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1236
1237  /* Discard the token being shifted unless it is eof.  */
1238  if (yychar != YYEOF)
1239    yychar = YYEMPTY;
1240
1241  *++yyvsp = yylval;
1242
1243
1244  /* Count tokens shifted since error; after three, turn off error
1245     status.  */
1246  if (yyerrstatus)
1247    yyerrstatus--;
1248
1249  yystate = yyn;
1250  goto yynewstate;
1251
1252
1253/*-----------------------------------------------------------.
1254| yydefault -- do the default action for the current state.  |
1255`-----------------------------------------------------------*/
1256yydefault:
1257  yyn = yydefact[yystate];
1258  if (yyn == 0)
1259    goto yyerrlab;
1260  goto yyreduce;
1261
1262
1263/*-----------------------------.
1264| yyreduce -- Do a reduction.  |
1265`-----------------------------*/
1266yyreduce:
1267  /* yyn is the number of a rule to reduce with.  */
1268  yylen = yyr2[yyn];
1269
1270  /* If YYLEN is nonzero, implement the default value of the action:
1271     `$$ = $1'.
1272
1273     Otherwise, the following line sets YYVAL to garbage.
1274     This behavior is undocumented and Bison
1275     users should not rely upon it.  Assigning to YYVAL
1276     unconditionally makes the parser a bit smaller, and it avoids a
1277     GCC warning that YYVAL may be used uninitialized.  */
1278  yyval = yyvsp[1-yylen];
1279
1280
1281  YY_REDUCE_PRINT (yyn);
1282  switch (yyn)
1283    {
1284        case 2:
1285#line 74 "ts1.0_grammar.y"
1286    {
1287                        yyvsp[0].instList->Validate();
1288                        yyvsp[0].instList->Invoke();
1289                    delete yyvsp[0].instList;
1290                ;}
1291    break;
1292
1293  case 3:
1294#line 82 "ts1.0_grammar.y"
1295    {
1296                    *(yyvsp[-2].instList) += yyvsp[-1].inst;
1297                        delete yyvsp[-1].inst;
1298                    yyval.instList = yyvsp[-2].instList;
1299                ;}
1300    break;
1301
1302  case 4:
1303#line 88 "ts1.0_grammar.y"
1304    {
1305                    InstListPtr instList = new InstList;
1306                    *instList += yyvsp[-1].inst;
1307                        delete yyvsp[-1].inst;
1308                    yyval.instList = instList;
1309                ;}
1310    break;
1311
1312  case 5:
1313#line 98 "ts1.0_grammar.y"
1314    {
1315                        yyval.variable = new MappedVariable;
1316                        yyval.variable->var = yyvsp[-1].fval;
1317                        yyval.variable->expand = true;
1318                ;}
1319    break;
1320
1321  case 6:
1322#line 104 "ts1.0_grammar.y"
1323    {
1324                        yyval.variable = new MappedVariable;
1325                        yyval.variable->var = yyvsp[0].fval;
1326                        yyval.variable->expand = false;
1327                ;}
1328    break;
1329
1330  case 7:
1331#line 112 "ts1.0_grammar.y"
1332    {
1333                    yyval.inst = new Inst(TSP_NOP);
1334                ;}
1335    break;
1336
1337  case 8:
1338#line 116 "ts1.0_grammar.y"
1339    {
1340                    yyval.inst = new Inst(TSP_TEXTURE_1D);
1341                ;}
1342    break;
1343
1344  case 9:
1345#line 120 "ts1.0_grammar.y"
1346    {
1347                    yyval.inst = new Inst(TSP_TEXTURE_2D);
1348                ;}
1349    break;
1350
1351  case 10:
1352#line 124 "ts1.0_grammar.y"
1353    {
1354                    yyval.inst = new Inst(TSP_TEXTURE_RECTANGLE);
1355                ;}
1356    break;
1357
1358  case 11:
1359#line 128 "ts1.0_grammar.y"
1360    {
1361                    yyval.inst = new Inst(TSP_TEXTURE_3D);
1362                ;}
1363    break;
1364
1365  case 12:
1366#line 132 "ts1.0_grammar.y"
1367    {
1368                    yyval.inst = new Inst(TSP_TEXTURE_CUBE_MAP);
1369                ;}
1370    break;
1371
1372  case 13:
1373#line 136 "ts1.0_grammar.y"
1374    {
1375                    yyval.inst = new Inst(TSP_CULL_FRAGMENT, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1376                ;}
1377    break;
1378
1379  case 14:
1380#line 140 "ts1.0_grammar.y"
1381    {
1382                    yyval.inst = new Inst(TSP_PASS_THROUGH);
1383                ;}
1384    break;
1385
1386  case 15:
1387#line 144 "ts1.0_grammar.y"
1388    {
1389                    yyval.inst = new Inst(TSP_OFFSET_2D_SCALE, yyvsp[-13].fval, yyvsp[-11].fval, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1390                ;}
1391    break;
1392
1393  case 16:
1394#line 148 "ts1.0_grammar.y"
1395    {
1396                    yyval.inst = new Inst(TSP_OFFSET_2D, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1397                ;}
1398    break;
1399
1400  case 17:
1401#line 152 "ts1.0_grammar.y"
1402    {
1403                    yyval.inst = new Inst(TSP_OFFSET_RECTANGLE_SCALE, yyvsp[-13].fval, yyvsp[-11].fval, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1404                ;}
1405    break;
1406
1407  case 18:
1408#line 156 "ts1.0_grammar.y"
1409    {
1410                    yyval.inst = new Inst(TSP_OFFSET_RECTANGLE, yyvsp[-9].fval, yyvsp[-7].fval, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1411                ;}
1412    break;
1413
1414  case 19:
1415#line 160 "ts1.0_grammar.y"
1416    {
1417                    yyval.inst = new Inst(TSP_DEPENDENT_AR, yyvsp[-1].fval);
1418                ;}
1419    break;
1420
1421  case 20:
1422#line 164 "ts1.0_grammar.y"
1423    {
1424                    yyval.inst = new Inst(TSP_DEPENDENT_GB, yyvsp[-1].fval);
1425                ;}
1426    break;
1427
1428  case 21:
1429#line 168 "ts1.0_grammar.y"
1430    {
1431                    yyval.inst = new Inst(TSP_DOT_PRODUCT_2D_1_OF_2, yyvsp[-1].variable);
1432                        delete yyvsp[-1].variable;
1433                ;}
1434    break;
1435
1436  case 22:
1437#line 173 "ts1.0_grammar.y"
1438    {
1439                    yyval.inst = new Inst(TSP_DOT_PRODUCT_2D_2_OF_2, yyvsp[-1].variable);
1440                        delete yyvsp[-1].variable;
1441                ;}
1442    break;
1443
1444  case 23:
1445#line 178 "ts1.0_grammar.y"
1446    {
1447                    yyval.inst = new Inst(TSP_DOT_PRODUCT_RECTANGLE_1_OF_2, yyvsp[-1].variable);
1448                        delete yyvsp[-1].variable;
1449                ;}
1450    break;
1451
1452  case 24:
1453#line 183 "ts1.0_grammar.y"
1454    {
1455                    yyval.inst = new Inst(TSP_DOT_PRODUCT_RECTANGLE_2_OF_2, yyvsp[-1].variable);
1456                        delete yyvsp[-1].variable;
1457                ;}
1458    break;
1459
1460  case 25:
1461#line 188 "ts1.0_grammar.y"
1462    {
1463                    yyval.inst = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_1_OF_2, yyvsp[-1].variable);
1464                        delete yyvsp[-1].variable;
1465                ;}
1466    break;
1467
1468  case 26:
1469#line 193 "ts1.0_grammar.y"
1470    {
1471                    yyval.inst = new Inst(TSP_DOT_PRODUCT_DEPTH_REPLACE_2_OF_2, yyvsp[-1].variable);
1472                        delete yyvsp[-1].variable;
1473                ;}
1474    break;
1475
1476  case 27:
1477#line 198 "ts1.0_grammar.y"
1478    {
1479                    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_1_OF_3, yyvsp[-1].variable);
1480                        delete yyvsp[-1].variable;
1481                ;}
1482    break;
1483
1484  case 28:
1485#line 203 "ts1.0_grammar.y"
1486    {
1487                    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_2_OF_3, yyvsp[-1].variable);
1488                        delete yyvsp[-1].variable;
1489                ;}
1490    break;
1491
1492  case 29:
1493#line 208 "ts1.0_grammar.y"
1494    {
1495                    yyval.inst = new Inst(TSP_DOT_PRODUCT_3D_3_OF_3, yyvsp[-1].variable);
1496                        delete yyvsp[-1].variable;
1497                ;}
1498    break;
1499
1500  case 30:
1501#line 213 "ts1.0_grammar.y"
1502    {
1503                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_1_OF_3, yyvsp[-1].variable);
1504                        delete yyvsp[-1].variable;
1505                ;}
1506    break;
1507
1508  case 31:
1509#line 218 "ts1.0_grammar.y"
1510    {
1511                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_2_OF_3, yyvsp[-1].variable);
1512                        delete yyvsp[-1].variable;
1513                ;}
1514    break;
1515
1516  case 32:
1517#line 223 "ts1.0_grammar.y"
1518    {
1519                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_3_OF_3, yyvsp[-1].variable);
1520                        delete yyvsp[-1].variable;
1521                ;}
1522    break;
1523
1524  case 33:
1525#line 228 "ts1.0_grammar.y"
1526    {
1527                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, yyvsp[-1].variable);
1528                        delete yyvsp[-1].variable;
1529                ;}
1530    break;
1531
1532  case 34:
1533#line 233 "ts1.0_grammar.y"
1534    {
1535                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, yyvsp[-1].variable);
1536                        delete yyvsp[-1].variable;
1537                ;}
1538    break;
1539
1540  case 35:
1541#line 238 "ts1.0_grammar.y"
1542    {
1543                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, yyvsp[-1].variable);
1544                        delete yyvsp[-1].variable;
1545                ;}
1546    break;
1547
1548  case 36:
1549#line 243 "ts1.0_grammar.y"
1550    {
1551                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, yyvsp[-7].variable, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1552                        delete yyvsp[-7].variable;
1553                ;}
1554    break;
1555
1556  case 37:
1557#line 248 "ts1.0_grammar.y"
1558    {
1559                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, yyvsp[-1].variable);
1560                        delete yyvsp[-1].variable;
1561                ;}
1562    break;
1563
1564  case 38:
1565#line 253 "ts1.0_grammar.y"
1566    {
1567                    yyval.inst = new Inst(TSP_DOT_PRODUCT_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, yyvsp[-1].variable);
1568                        delete yyvsp[-1].variable;
1569                ;}
1570    break;
1571
1572  case 39:
1573#line 258 "ts1.0_grammar.y"
1574    {
1575                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_1_OF_3, yyvsp[-1].variable);
1576                        delete yyvsp[-1].variable;
1577                ;}
1578    break;
1579
1580  case 40:
1581#line 263 "ts1.0_grammar.y"
1582    {
1583                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_2_OF_3, yyvsp[-1].variable);
1584                        delete yyvsp[-1].variable;
1585                ;}
1586    break;
1587
1588  case 41:
1589#line 268 "ts1.0_grammar.y"
1590    {
1591                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_EYE_FROM_QS_3_OF_3, yyvsp[-1].variable);
1592                        delete yyvsp[-1].variable;
1593                ;}
1594    break;
1595
1596  case 42:
1597#line 273 "ts1.0_grammar.y"
1598    {
1599                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_1_OF_3, yyvsp[-7].variable, yyvsp[-5].fval, yyvsp[-3].fval, yyvsp[-1].fval);
1600                        delete yyvsp[-7].variable;
1601                ;}
1602    break;
1603
1604  case 43:
1605#line 278 "ts1.0_grammar.y"
1606    {
1607                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_2_OF_3, yyvsp[-1].variable);
1608                        delete yyvsp[-1].variable;
1609                ;}
1610    break;
1611
1612  case 44:
1613#line 283 "ts1.0_grammar.y"
1614    {
1615                    yyval.inst = new Inst(TSP_DOT_PRODUCT_CUBE_MAP_AND_REFLECT_CUBE_MAP_CONST_EYE_3_OF_3, yyvsp[-1].variable);
1616                        delete yyvsp[-1].variable;
1617                ;}
1618    break;
1619
1620  case 45:
1621#line 290 "ts1.0_grammar.y"
1622    {
1623                        yyval.fval = yyvsp[0].fval;
1624                ;}
1625    break;
1626
1627  case 46:
1628#line 294 "ts1.0_grammar.y"
1629    {
1630                        yyval.fval = yyvsp[0].fval;
1631                ;}
1632    break;
1633
1634
1635    }
1636
1637/* Line 999 of yacc.c.  */
1638#line 1610 "_ts1.0_parser.c"
1639
1640  yyvsp -= yylen;
1641  yyssp -= yylen;
1642
1643
1644  YY_STACK_PRINT (yyss, yyssp);
1645
1646  *++yyvsp = yyval;
1647
1648
1649  /* Now `shift' the result of the reduction.  Determine what state
1650     that goes to, based on the state we popped back to and the rule
1651     number reduced by.  */
1652
1653  yyn = yyr1[yyn];
1654
1655  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1656  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1657    yystate = yytable[yystate];
1658  else
1659    yystate = yydefgoto[yyn - YYNTOKENS];
1660
1661  goto yynewstate;
1662
1663
1664/*------------------------------------.
1665| yyerrlab -- here on detecting error |
1666`------------------------------------*/
1667yyerrlab:
1668  /* If not already recovering from an error, report this error.  */
1669  if (!yyerrstatus)
1670    {
1671      ++yynerrs;
1672#if YYERROR_VERBOSE
1673      yyn = yypact[yystate];
1674
1675      if (YYPACT_NINF < yyn && yyn < YYLAST)
1676        {
1677          YYSIZE_T yysize = 0;
1678          int yytype = YYTRANSLATE (yychar);
1679          char *yymsg;
1680          int yyx, yycount;
1681
1682          yycount = 0;
1683          /* Start YYX at -YYN if negative to avoid negative indexes in
1684             YYCHECK.  */
1685          for (yyx = yyn < 0 ? -yyn : 0;
1686               yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1687            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1688              yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1689          yysize += yystrlen ("syntax error, unexpected ") + 1;
1690          yysize += yystrlen (yytname[yytype]);
1691          yymsg = (char *) YYSTACK_ALLOC (yysize);
1692          if (yymsg != 0)
1693            {
1694              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1695              yyp = yystpcpy (yyp, yytname[yytype]);
1696
1697              if (yycount < 5)
1698                {
1699                  yycount = 0;
1700                  for (yyx = yyn < 0 ? -yyn : 0;
1701                       yyx < (int) (sizeof (yytname) / sizeof (char *));
1702                       yyx++)
1703                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1704                      {
1705                        const char *yyq = ! yycount ? ", expecting " : " or ";
1706                        yyp = yystpcpy (yyp, yyq);
1707                        yyp = yystpcpy (yyp, yytname[yyx]);
1708                        yycount++;
1709                      }
1710                }
1711              yyerror (yymsg);
1712              YYSTACK_FREE (yymsg);
1713            }
1714          else
1715            yyerror ("syntax error; also virtual memory exhausted");
1716        }
1717      else
1718#endif /* YYERROR_VERBOSE */
1719        yyerror ("syntax error");
1720    }
1721
1722
1723
1724  if (yyerrstatus == 3)
1725    {
1726      /* If just tried and failed to reuse lookahead token after an
1727         error, discard it.  */
1728
1729      /* Return failure if at end of input.  */
1730      if (yychar == YYEOF)
1731        {
1732          /* Pop the error token.  */
1733          YYPOPSTACK;
1734          /* Pop the rest of the stack.  */
1735          while (yyss < yyssp)
1736            {
1737              YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1738              yydestruct (yystos[*yyssp], yyvsp);
1739              YYPOPSTACK;
1740            }
1741          YYABORT;
1742        }
1743
1744      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1745      yydestruct (yytoken, &yylval);
1746      yychar = YYEMPTY;
1747
1748    }
1749
1750  /* Else will try to reuse lookahead token after shifting the error
1751     token.  */
1752  goto yyerrlab1;
1753
1754
1755/*----------------------------------------------------.
1756| yyerrlab1 -- error raised explicitly by an action.  |
1757`----------------------------------------------------*/
1758yyerrlab1:
1759  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1760
1761  for (;;)
1762    {
1763      yyn = yypact[yystate];
1764      if (yyn != YYPACT_NINF)
1765        {
1766          yyn += YYTERROR;
1767          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1768            {
1769              yyn = yytable[yyn];
1770              if (0 < yyn)
1771                break;
1772            }
1773        }
1774
1775      /* Pop the current state because it cannot handle the error token.  */
1776      if (yyssp == yyss)
1777        YYABORT;
1778
1779      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1780      yydestruct (yystos[yystate], yyvsp);
1781      yyvsp--;
1782      yystate = *--yyssp;
1783
1784      YY_STACK_PRINT (yyss, yyssp);
1785    }
1786
1787  if (yyn == YYFINAL)
1788    YYACCEPT;
1789
1790  YYDPRINTF ((stderr, "Shifting error token, "));
1791
1792  *++yyvsp = yylval;
1793
1794
1795  yystate = yyn;
1796  goto yynewstate;
1797
1798
1799/*-------------------------------------.
1800| yyacceptlab -- YYACCEPT comes here.  |
1801`-------------------------------------*/
1802yyacceptlab:
1803  yyresult = 0;
1804  goto yyreturn;
1805
1806/*-----------------------------------.
1807| yyabortlab -- YYABORT comes here.  |
1808`-----------------------------------*/
1809yyabortlab:
1810  yyresult = 1;
1811  goto yyreturn;
1812
1813#ifndef yyoverflow
1814/*----------------------------------------------.
1815| yyoverflowlab -- parser overflow comes here.  |
1816`----------------------------------------------*/
1817yyoverflowlab:
1818  yyerror ("parser stack overflow");
1819  yyresult = 2;
1820  /* Fall through.  */
1821#endif
1822
1823yyreturn:
1824#ifndef yyoverflow
1825  if (yyss != yyssa)
1826    YYSTACK_FREE (yyss);
1827#endif
1828  return yyresult;
1829}
1830
1831
1832#line 300 "ts1.0_grammar.y"
1833
1834void yyerror(char* s)
1835{
1836     errors.set("unrecognized token");
1837}
1838
Note: See TracBrowser for help on using the repository browser.