Fixes for OpenBSD
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / schema / sheet.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 // $TOG: sheet.C /main/4 1997/12/23 11:20:35 bill $
24 #ifndef lint
25 static const char schemasccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
26 #endif
27 #define  schemaBYACC 1
28
29 #include <stdio.h>
30 #include <ctype.h>
31 #include "utility/funcs.h"
32 #include "schema/store_desc.h"
33 #include "schema/index_desc.h"
34 #include "schema/inv_desc.h"
35 #include "schema/agent_desc.h"
36 #include "schema/container_desc.h"
37
38 extern desc* desc_ptr;
39 extern desc* last_desc_ptr;
40
41 #define CAST_TO_STORED_OBJECT(x) ((stored_object_desc*)x)
42 #define CAST_TO_PAGE_STORE(x)   ((page_store_desc*)x)
43
44 #define CAST_TO_INDEX(x)        ((index_desc*)x)
45 #define CAST_TO_MPHF_INDEX(x)   ((index_desc*)x)
46 #define CAST_TO_SMPHF_INDEX(x)  ((smphf_index_desc*)x)
47
48 #define CAST_TO_INV(x)          ((inv_desc*)x)
49
50 #define CAST_TO_MPHF(x)         ((mphf_desc*)x)
51 #define CAST_TO_SMPHF(x)        ((smphf_desc*)x)
52 #define CAST_TO_BTREE(x)        ((btree_desc*)x)
53
54 #define CAST_TO_CONTAINER(x)    ((container_desc*)x)
55
56 #undef  alloca
57 #define alloca(x)       (malloc(x))
58
59 extern void  schemaerror(char*);
60 extern int  schemalex();
61
62 #undef  schemawrap
63
64 typedef union
65 {
66  char   *string;
67  int    integer;
68  desc*  trans;
69  page_store_desc*  ps_trans;
70 }  schemaSTYPE;
71 #define TOKEN 257
72 #define CONTAINER 258
73 #define SET 259
74 #define LIST 260
75 #define INDEX_NAME 261
76 #define INV 262
77 #define COMPRESS 263
78 #define INV_NAME 264
79 #define AGENT_NAME 265
80 #define STORE_NAME 266
81 #define POSITION 267
82 #define INDEX 268
83 #define MPHF_INDEX 269
84 #define SMPHF_INDEX 270
85 #define BTREE_INDEX 271
86 #define INDEX_AGENT 272
87 #define MPHF 273
88 #define SMPHF 274
89 #define BTREE 275
90 #define HUFFMAN 276
91 #define DICT 277
92 #define EQUAL 278
93 #define NUMBER 279
94 #define STORE 280
95 #define PAGE_STORE 281
96 #define NM 282
97 #define V_OID 283
98 #define MODE 284
99 #define PAGE_SZ 285
100 #define CACHED_PAGES 286
101 #undef  BYTE_ORDER
102 #define BYTE_ORDER 287
103 #define SEPARATOR 288
104 #define  schemaERRCODE 256
105 short  schemalhs[] = {                                        -1,
106     0,    1,    1,    2,    2,    2,    2,    2,    2,    3,
107     4,    6,    7,    5,    8,   15,   16,   16,   16,   17,
108    18,   18,   19,   19,   19,   20,   20,    9,    9,   10,
109    10,   12,   12,   13,   13,   11,   11,   14,   14,   21,
110    21,   21,   21,   25,   25,   26,   26,   22,   22,   27,
111    27,   27,   23,   23,   24,   24,
112 };
113 short  schemalen[] = {                                         2,
114     1,    2,    1,    2,    2,    2,    2,    2,    2,    3,
115     3,    3,    3,    3,    3,    1,    1,    1,    1,    1,
116     1,    1,    1,    1,    1,    1,    1,    3,    1,    3,
117     1,    3,    1,    3,    1,    3,    1,    3,    1,    1,
118     3,    3,    3,    1,    3,    3,    3,    3,    1,    3,
119     3,    1,    3,    1,    3,    1,
120 };
121 short  schemadefred[] = {                                      0,
122     0,    0,    0,    0,    0,    0,    0,    1,    0,   26,
123    27,    9,    0,   20,    6,    0,   21,   22,    7,    0,
124    17,   18,   19,    5,    0,   23,   25,   24,    8,    0,
125    16,    4,    0,    2,    0,    0,    0,    0,    0,    0,
126     0,    0,    0,    0,   15,   56,    0,   54,   12,    0,
127    13,    0,    0,    0,    0,   11,    0,   52,   49,   14,
128     0,    0,    0,    0,    0,   10,    0,   40,   44,    0,
129     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
130     0,    0,    0,    0,    0,    0,   55,   53,   46,   47,
131    38,   32,   34,   50,   51,   48,   30,   36,   45,   43,
132    41,   42,   28,
133 };
134 short  schemadgoto[] = {                                       7,
135     8,    9,   32,   24,   29,   15,   19,   12,   66,   56,
136    60,   49,   51,   45,   33,   25,   16,   20,   30,   13,
137    67,   57,   46,   47,   68,   48,   59,
138 };
139 short  schemasindex[] = {                                   -250,
140  -206, -260, -221, -219, -254, -272,    0,    0, -250,    0,
141     0,    0, -277,    0,    0, -243,    0,    0,    0, -231,
142     0,    0,    0,    0, -230,    0,    0,    0,    0, -229,
143     0,    0, -228,    0, -251, -249, -249, -241, -249, -247,
144  -217, -216, -215, -214,    0,    0, -223,    0,    0, -222,
145     0, -220, -211, -209, -208,    0, -213,    0,    0,    0,
146  -212, -207, -205, -204, -201,    0, -210,    0,    0, -185,
147  -178, -177, -176, -251, -249, -249, -175, -174, -232, -241,
148  -249, -173, -194, -193, -170, -247,    0,    0,    0,    0,
149     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
150     0,    0,    0,
151 };
152 short  schemarindex[] = {                                      0,
153     0,    0,    0,    0,    0,    0,    0,    0,   28,    0,
154     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
155     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
156     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
157     0,    0,    0,    0,    0,    0,    1,    0,    0,    3,
158     0,   14,    0,    0,    0,    0,   16,    0,    0,    0,
159    27,    0,    0,    0,    0,    0,   29,    0,    0,    0,
160     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
161     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
162     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
163     0,    0,    0,
164 };
165 short  schemagindex[] = {                                      0,
166    79,    0,    0,    0,    0,    0,    0,    0,    4,    9,
167    10,   17,   18,   19,    0,    0,    0,    0,    0,    0,
168     0,    0,  -32,    0,    0,  -40,    0,
169 };
170 #define  schemaTABLESIZE 309
171 short  schematable[] = {                                      69,
172    39,   14,   33,   50,   52,   58,   61,    1,   31,   41,
173    35,    2,    3,   35,   42,   31,   42,    4,   26,   27,
174    28,    5,   53,   54,   42,   55,   37,    3,   29,    6,
175    43,   44,   43,   44,   43,   44,   62,   63,   64,   65,
176    43,   44,   50,   52,   36,   69,   96,   58,   61,   21,
177    22,   23,   10,   11,   17,   18,   37,   38,   39,   40,
178    70,   71,   72,   73,   74,   75,   77,   76,   78,   79,
179    82,   87,   83,   84,   80,   81,   85,   86,   88,   89,
180    90,   94,   95,   99,  100,  101,  102,   34,   97,  103,
181    98,   92,   91,   93,    0,    0,    0,    0,    0,    0,
182     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
183     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
184     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
185     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
186     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
187     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
188     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
189     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
190     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
191     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
192     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
193     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
194     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
195     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
196     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
197     0,    0,    0,    0,    0,    0,    0,    0,   39,    0,
198    33,    0,   39,   39,   33,   33,    0,    0,   39,    0,
199    33,   35,   39,   31,   33,   35,   35,   31,   31,    0,
200    39,   35,   33,   31,   37,   35,   29,   31,   37,   37,
201    29,   29,    0,   35,   37,   31,   29,    0,   37,    0,
202    29,    0,    0,    0,    0,    0,   37,    0,   29,
203 };
204 short  schemacheck[] = {                                      40,
205     0,  262,    0,   36,   37,   38,   39,  258,  281,  261,
206   288,  262,  263,    0,  266,    0,  266,  268,  273,  274,
207   275,  272,  264,  265,  266,  267,    0,    0,    0,  280,
208   282,  283,  282,  283,  282,  283,  284,  285,  286,  287,
209   282,  283,   75,   76,  288,   86,  279,   80,   81,  269,
210   270,  271,  259,  260,  276,  277,  288,  288,  288,  288,
211   278,  278,  278,  278,  288,  288,  278,  288,  278,  278,
212   278,  257,  278,  278,  288,  288,  278,  288,  257,  257,
213   257,  257,  257,  257,  279,  279,  257,    9,   80,   86,
214    81,   75,   74,   76,   -1,   -1,   -1,   -1,   -1,   -1,
215    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
216    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
217    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
218    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
219    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
220    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
221    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
222    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
223    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
224    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
225    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
226    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
227    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
228    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
229    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
230    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,   -1,
231   258,   -1,  262,  263,  262,  263,   -1,   -1,  268,   -1,
232   268,  258,  272,  258,  272,  262,  263,  262,  263,   -1,
233   280,  268,  280,  268,  258,  272,  258,  272,  262,  263,
234   262,  263,   -1,  280,  268,  280,  268,   -1,  272,   -1,
235   272,   -1,   -1,   -1,   -1,   -1,  280,   -1,  280,
236 };
237 #define  schemaFINAL 7
238 #ifndef  schemaDEBUG
239 #define  schemaDEBUG 0
240 #endif
241 #define  schemaMAXTOKEN 288
242 #if  schemaDEBUG
243 char * schemaname[] = {
244 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
245 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
246 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
247 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
248 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
249 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
250 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TOKEN","CONTAINER","SET","LIST",
251 "INDEX_NAME","INV","COMPRESS","INV_NAME","AGENT_NAME","STORE_NAME","POSITION",
252 "INDEX","MPHF_INDEX","SMPHF_INDEX","BTREE_INDEX","INDEX_AGENT","MPHF","SMPHF",
253 "BTREE","HUFFMAN","DICT","EQUAL","NUMBER","STORE","PAGE_STORE","NM","V_OID",
254 "MODE","PAGE_SZ","CACHED_PAGES","BYTE_ORDER","SEPARATOR",
255 };
256 char * schemarule[] = {
257 "$accept : Sheet",
258 "Sheet : DescriptionList",
259 "DescriptionList : Description DescriptionList",
260 "DescriptionList : Description",
261 "Description : STORE Store_description",
262 "Description : INDEX Index_description",
263 "Description : INV Inv_description",
264 "Description : COMPRESS Compress_description",
265 "Description : INDEX_AGENT Index_Agent_description",
266 "Description : CONTAINER Container_description",
267 "Store_description : Page_Store_Head SEPARATOR Page_store_descriptions",
268 "Index_description : Index_Head SEPARATOR MPHF_index_descriptions",
269 "Inv_description : Inv_Head SEPARATOR Inv_descriptions",
270 "Compress_description : Compress_Head SEPARATOR Compress_descriptions",
271 "Index_Agent_description : Index_Agent_Head SEPARATOR Hash_descriptions",
272 "Container_description : Container_Head SEPARATOR Container_descriptions",
273 "Page_Store_Head : PAGE_STORE",
274 "Index_Head : MPHF_INDEX",
275 "Index_Head : SMPHF_INDEX",
276 "Index_Head : BTREE_INDEX",
277 "Inv_Head : INV",
278 "Compress_Head : HUFFMAN",
279 "Compress_Head : DICT",
280 "Index_Agent_Head : MPHF",
281 "Index_Agent_Head : BTREE",
282 "Index_Agent_Head : SMPHF",
283 "Container_Head : SET",
284 "Container_Head : LIST",
285 "Page_store_descriptions : Page_Store_Term SEPARATOR Page_store_descriptions",
286 "Page_store_descriptions : Page_Store_Term",
287 "MPHF_index_descriptions : MPHF_Index_Term SEPARATOR MPHF_index_descriptions",
288 "MPHF_index_descriptions : MPHF_Index_Term",
289 "Inv_descriptions : Stored_Object_Term SEPARATOR Inv_descriptions",
290 "Inv_descriptions : Stored_Object_Term",
291 "Compress_descriptions : Stored_Object_Term SEPARATOR Compress_descriptions",
292 "Compress_descriptions : Stored_Object_Term",
293 "Hash_descriptions : Stored_Object_Term SEPARATOR Hash_descriptions",
294 "Hash_descriptions : Stored_Object_Term",
295 "Container_descriptions : Container_Term SEPARATOR Container_descriptions",
296 "Container_descriptions : Container_Term",
297 "Page_Store_Term : Store_Term",
298 "Page_Store_Term : CACHED_PAGES EQUAL NUMBER",
299 "Page_Store_Term : BYTE_ORDER EQUAL TOKEN",
300 "Page_Store_Term : PAGE_SZ EQUAL NUMBER",
301 "Store_Term : Term",
302 "Store_Term : MODE EQUAL TOKEN",
303 "Term : NM EQUAL TOKEN",
304 "Term : V_OID EQUAL TOKEN",
305 "MPHF_Index_Term : POSITION EQUAL NUMBER",
306 "MPHF_Index_Term : Index_Term",
307 "Index_Term : INV_NAME EQUAL TOKEN",
308 "Index_Term : AGENT_NAME EQUAL TOKEN",
309 "Index_Term : Stored_Object_Term",
310 "Stored_Object_Term : STORE_NAME EQUAL TOKEN",
311 "Stored_Object_Term : Term",
312 "Container_Term : INDEX_NAME EQUAL TOKEN",
313 "Container_Term : Stored_Object_Term",
314 };
315 #endif
316 #define  schemaclearin ( schemachar=(-1))
317 #define  schemaerrok ( schemaerrflag=0)
318 #ifdef  schemaSTACKSIZE
319 #ifndef  schemaMAXDEPTH
320 #define  schemaMAXDEPTH  schemaSTACKSIZE
321 #endif
322 #else
323 #ifdef  schemaMAXDEPTH
324 #define  schemaSTACKSIZE  schemaMAXDEPTH
325 #else
326 #define  schemaSTACKSIZE 500
327 #define  schemaMAXDEPTH 500
328 #endif
329 #endif
330 int  schemadebug;
331 int  schemanerrs;
332 int  schemaerrflag;
333 int  schemachar;
334 short * schemassp;
335  schemaSTYPE * schemavsp;
336  schemaSTYPE  schemaval;
337  schemaSTYPE  schemalval;
338 short  schemass[ schemaSTACKSIZE];
339  schemaSTYPE  schemavs[ schemaSTACKSIZE];
340 #define  schemastacksize  schemaSTACKSIZE
341 #define  schemaABORT goto  schemaabort
342 #define  schemaACCEPT goto  schemaaccept
343 #define  schemaERROR goto  schemaerrlab
344 #if  schemaDEBUG
345 #ifndef __cplusplus
346 extern char *getenv(const char *);
347 #endif
348 #endif
349 int
350  schemaparse()
351 {
352     register int  schemam,  scheman,  schemastate;
353 #if  schemaDEBUG
354     register char * schemas;
355
356     if ( schemas = getenv(" schemaDEBUG"))
357     {
358          scheman = * schemas;
359         if ( scheman >= '0' &&  scheman <= '9')
360              schemadebug =  scheman - '0';
361     }
362 #endif
363
364      schemanerrs = 0;
365      schemaerrflag = 0;
366      schemachar = (-1);
367
368      schemassp =  schemass;
369      schemavsp =  schemavs;
370     * schemassp =  schemastate = 0;
371
372  schemaloop:
373     if ( (scheman =  schemadefred[ schemastate])) goto  schemareduce;
374     if ( schemachar < 0)
375     {
376         if (( schemachar =  schemalex()) < 0)  schemachar = 0;
377 #if  schemaDEBUG
378         if ( schemadebug)
379         {
380              schemas = 0;
381             if ( schemachar <=  schemaMAXTOKEN)  schemas =  schemaname[ schemachar];
382             if (! schemas)  schemas = "illegal-symbol";
383             printf(" schemadebug: state %d, reading %d (%s)\n",  schemastate,
384                      schemachar,  schemas);
385         }
386 #endif
387     }
388     if (( scheman =  schemasindex[ schemastate]) && ( scheman +=  schemachar) >= 0 &&
389              scheman <=  schemaTABLESIZE &&  schemacheck[ scheman] ==  schemachar)
390     {
391 #if  schemaDEBUG
392         if ( schemadebug)
393             printf(" schemadebug: state %d, shifting to state %d\n",
394                      schemastate,  schematable[ scheman]);
395 #endif
396         if ( schemassp >=  schemass +  schemastacksize - 1)
397         {
398             goto  schemaoverflow;
399         }
400         *++ schemassp =  schemastate =  schematable[ scheman];
401         *++ schemavsp =  schemalval;
402          schemachar = (-1);
403         if ( schemaerrflag > 0)  -- schemaerrflag;
404         goto  schemaloop;
405     }
406     if (( scheman =  schemarindex[ schemastate]) && ( scheman +=  schemachar) >= 0 &&
407              scheman <=  schemaTABLESIZE &&  schemacheck[ scheman] ==  schemachar)
408     {
409          scheman =  schematable[ scheman];
410         goto  schemareduce;
411     }
412     if ( schemaerrflag) goto  schemainrecovery;
413 #if 0                           /* remove if needed */
414 #ifdef lint
415     goto  schemanewerror;
416 #endif
417  schemanewerror:
418 #endif
419      schemaerror((char*)"syntax error");
420 #if 0                           /* remove if needed */
421 #ifdef lint
422     goto  schemaerrlab;
423 #endif
424  schemaerrlab:
425 #endif
426     ++ schemanerrs;
427  schemainrecovery:
428     if ( schemaerrflag < 3)
429     {
430          schemaerrflag = 3;
431         for (;;)
432         {
433             if (( scheman =  schemasindex[* schemassp]) && ( scheman +=  schemaERRCODE) >= 0 &&
434                      scheman <=  schemaTABLESIZE &&  schemacheck[ scheman] ==  schemaERRCODE)
435             {
436 #if  schemaDEBUG
437                 if ( schemadebug)
438                     printf(" schemadebug: state %d, error recovery shifting\
439  to state %d\n", * schemassp,  schematable[ scheman]);
440 #endif
441                 if ( schemassp >=  schemass +  schemastacksize - 1)
442                 {
443                     goto  schemaoverflow;
444                 }
445                 *++ schemassp =  schemastate =  schematable[ scheman];
446                 *++ schemavsp =  schemalval;
447                 goto  schemaloop;
448             }
449             else
450             {
451 #if  schemaDEBUG
452                 if ( schemadebug)
453                     printf(" schemadebug: error recovery discarding state %d\n",
454                             * schemassp);
455 #endif
456                 if ( schemassp <=  schemass) goto  schemaabort;
457                 -- schemassp;
458                 -- schemavsp;
459             }
460         }
461     }
462     else
463     {
464         if ( schemachar == 0) goto  schemaabort;
465 #if  schemaDEBUG
466         if ( schemadebug)
467         {
468              schemas = 0;
469             if ( schemachar <=  schemaMAXTOKEN)  schemas =  schemaname[ schemachar];
470             if (! schemas)  schemas = "illegal-symbol";
471             printf(" schemadebug: state %d, error recovery discards token %d (%s)\n",
472                      schemastate,  schemachar,  schemas);
473         }
474 #endif
475          schemachar = (-1);
476         goto  schemaloop;
477     }
478  schemareduce:
479 #if  schemaDEBUG
480     if ( schemadebug)
481         printf(" schemadebug: state %d, reducing by rule %d (%s)\n",
482                  schemastate,  scheman,  schemarule[ scheman]);
483 #endif
484      schemam =  schemalen[ scheman];
485      schemaval =  schemavsp[1- schemam];
486     switch ( scheman)
487     {
488 case 1:
489 {
490            /*$1 -> asciiOutList(cerr);*/
491            desc_ptr =  schemavsp[0].trans;
492         }
493 break;
494 case 2:
495 {
496             schemavsp[-1].trans -> set_next_desc( schemavsp[0].trans);
497             schemaval.trans =  schemavsp[-1].trans;
498         }
499 break;
500 case 3:
501 {
502             schemavsp[0].trans -> set_next_desc(0);
503            last_desc_ptr =  schemavsp[0].trans;
504             schemaval.trans =  schemavsp[0].trans;
505         }
506 break;
507 case 4:
508 {
509             schemaval.trans =  schemavsp[0].trans;
510         }
511 break;
512 case 5:
513 {
514             schemaval.trans =  schemavsp[0].trans;
515         }
516 break;
517 case 6:
518 {
519             schemaval.trans =  schemavsp[0].trans;
520         }
521 break;
522 case 7:
523 {
524             schemaval.trans =  schemavsp[0].trans;
525         }
526 break;
527 case 8:
528 {
529             schemaval.trans =  schemavsp[0].trans;
530         }
531 break;
532 case 9:
533 {
534             schemaval.trans =  schemavsp[0].trans;
535         }
536 break;
537 case 10:
538 {
539             schemaval.trans = desc_ptr;
540         }
541 break;
542 case 11:
543 {
544             schemaval.trans = desc_ptr;
545         }
546 break;
547 case 12:
548 {
549             schemaval.trans = desc_ptr;
550         }
551 break;
552 case 13:
553 {
554             schemaval.trans = desc_ptr;
555         }
556 break;
557 case 14:
558 {
559             schemaval.trans = desc_ptr;
560         }
561 break;
562 case 15:
563 {
564             schemaval.trans = desc_ptr;
565         }
566 break;
567 case 16:
568 {
569            desc_ptr = new page_store_desc;
570         }
571 break;
572 case 17:
573 {
574            desc_ptr= new mphf_index_desc;
575         }
576 break;
577 case 18:
578 {
579            desc_ptr= new smphf_index_desc;
580         }
581 break;
582 case 19:
583 {
584            desc_ptr= new btree_index_desc;
585         }
586 break;
587 case 20:
588 {
589            desc_ptr= new inv_desc;
590         }
591 break;
592 case 21:
593 {
594            desc_ptr= new huffman_desc;
595         }
596 break;
597 case 22:
598 {
599            desc_ptr= new dict_desc;
600         }
601 break;
602 case 23:
603 {
604            desc_ptr= new mphf_desc;
605         }
606 break;
607 case 24:
608 {
609            desc_ptr= new btree_desc;
610         }
611 break;
612 case 25:
613 {
614            desc_ptr= new smphf_desc;
615         }
616 break;
617 case 26:
618 {
619            desc_ptr= new set_desc;
620         }
621 break;
622 case 27:
623 {
624            desc_ptr= new list_desc;
625         }
626 break;
627 case 28:
628 {
629         }
630 break;
631 case 29:
632 {
633         }
634 break;
635 case 30:
636 {
637         }
638 break;
639 case 31:
640 {
641         }
642 break;
643 case 32:
644 {
645         }
646 break;
647 case 33:
648 {
649         }
650 break;
651 case 34:
652 {
653         }
654 break;
655 case 35:
656 {
657         }
658 break;
659 case 36:
660 {
661         }
662 break;
663 case 37:
664 {
665         }
666 break;
667 case 38:
668 {
669         }
670 break;
671 case 39:
672 {
673         }
674 break;
675 case 40:
676 {
677         }
678 break;
679 case 41:
680 {
681            CAST_TO_PAGE_STORE(desc_ptr) -> set_cached_pages( schemavsp[0].integer);
682         }
683 break;
684 case 42:
685 {
686            CAST_TO_PAGE_STORE(desc_ptr) -> set_order( schemavsp[0].string);
687         }
688 break;
689 case 43:
690 {
691            CAST_TO_PAGE_STORE(desc_ptr) -> set_page_sz( schemavsp[0].integer);
692         }
693 break;
694 case 44:
695 {
696         }
697 break;
698 case 45:
699 {
700            CAST_TO_PAGE_STORE(desc_ptr) -> set_mode( schemavsp[0].string);
701         }
702 break;
703 case 46:
704 {
705            desc_ptr -> set_nm( schemavsp[0].string);
706         }
707 break;
708 case 47:
709 {
710            desc_ptr -> set_oid( schemavsp[0].string);
711         }
712 break;
713 case 48:
714 {
715            CAST_TO_MPHF_INDEX(desc_ptr) -> set_position( schemavsp[0].integer);
716         }
717 break;
718 case 49:
719 {
720         }
721 break;
722 case 50:
723 {
724            CAST_TO_INDEX(desc_ptr) -> set_inv_nm( schemavsp[0].string);
725         }
726 break;
727 case 51:
728 {
729            CAST_TO_INDEX(desc_ptr) -> set_agent_nm( schemavsp[0].string);
730         }
731 break;
732 case 52:
733 {
734         }
735 break;
736 case 53:
737 {
738            CAST_TO_STORED_OBJECT(desc_ptr) -> set_store_nm( schemavsp[0].string);
739         }
740 break;
741 case 54:
742 {
743         }
744 break;
745 case 55:
746 {
747            CAST_TO_CONTAINER(desc_ptr) -> set_index_nm( schemavsp[0].string);
748         }
749 break;
750 case 56:
751 {
752         }
753 break;
754     }
755      schemassp -=  schemam;
756      schemastate = * schemassp;
757      schemavsp -=  schemam;
758      schemam =  schemalhs[ scheman];
759     if ( schemastate == 0 &&  schemam == 0)
760     {
761 #if  schemaDEBUG
762         if ( schemadebug)
763             printf(" schemadebug: after reduction, shifting from state 0 to\
764  state %d\n",  schemaFINAL);
765 #endif
766          schemastate =  schemaFINAL;
767         *++ schemassp =  schemaFINAL;
768         *++ schemavsp =  schemaval;
769         if ( schemachar < 0)
770         {
771             if (( schemachar =  schemalex()) < 0)  schemachar = 0;
772 #if  schemaDEBUG
773             if ( schemadebug)
774             {
775                  schemas = 0;
776                 if ( schemachar <=  schemaMAXTOKEN)  schemas =  schemaname[ schemachar];
777                 if (! schemas)  schemas = "illegal-symbol";
778                 printf(" schemadebug: state %d, reading %d (%s)\n",
779                          schemaFINAL,  schemachar,  schemas);
780             }
781 #endif
782         }
783         if ( schemachar == 0) goto  schemaaccept;
784         goto  schemaloop;
785     }
786     if (( scheman =  schemagindex[ schemam]) && ( scheman +=  schemastate) >= 0 &&
787              scheman <=  schemaTABLESIZE &&  schemacheck[ scheman] ==  schemastate)
788          schemastate =  schematable[ scheman];
789     else
790          schemastate =  schemadgoto[ schemam];
791 #if  schemaDEBUG
792     if ( schemadebug)
793         printf(" schemadebug: after reduction, shifting from state %d \
794 to state %d\n", * schemassp,  schemastate);
795 #endif
796     if ( schemassp >=  schemass +  schemastacksize - 1)
797     {
798         goto  schemaoverflow;
799     }
800     *++ schemassp =  schemastate;
801     *++ schemavsp =  schemaval;
802     goto  schemaloop;
803  schemaoverflow:
804      schemaerror((char*)"yacc stack overflow");
805  schemaabort:
806     return (1);
807  schemaaccept:
808     return (0);
809 }