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