]> matita.cs.unibo.it Git - helm.git/blob - helm/metadata/create_V7_mowgli/METADATA/lex.yy_ind.c
Minor bug fixes:
[helm.git] / helm / metadata / create_V7_mowgli / METADATA / lex.yy_ind.c
1 #line 2 "lex.yy_ind.c"
2 /* A lexical scanner generated by flex */
3
4 /* Scanner skeleton version:
5  * $Header$
6  */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11
12 #include <stdio.h>
13 #include <errno.h>
14
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16 #ifdef c_plusplus
17 #ifndef __cplusplus
18 #define __cplusplus
19 #endif
20 #endif
21
22
23 #ifdef __cplusplus
24
25 #include <stdlib.h>
26 #ifndef _WIN32
27 #include <unistd.h>
28 #else
29 #ifndef YY_ALWAYS_INTERACTIVE
30 #ifndef YY_NEVER_INTERACTIVE
31 extern int isatty YY_PROTO(( int ));
32 #endif
33 #endif
34 #endif
35
36 /* Use prototypes in function declarations. */
37 #define YY_USE_PROTOS
38
39 /* The "const" storage-class-modifier is valid. */
40 #define YY_USE_CONST
41
42 #else   /* ! __cplusplus */
43
44 #if __STDC__
45
46 #define YY_USE_PROTOS
47 #define YY_USE_CONST
48
49 #endif  /* __STDC__ */
50 #endif  /* ! __cplusplus */
51
52 #ifdef __TURBOC__
53  #pragma warn -rch
54  #pragma warn -use
55 #include <io.h>
56 #include <stdlib.h>
57 #define YY_USE_CONST
58 #define YY_USE_PROTOS
59 #endif
60
61 #ifdef YY_USE_CONST
62 #define yyconst const
63 #else
64 #define yyconst
65 #endif
66
67
68 #ifdef YY_USE_PROTOS
69 #define YY_PROTO(proto) proto
70 #else
71 #define YY_PROTO(proto) ()
72 #endif
73
74 /* Returned upon end-of-file. */
75 #define YY_NULL 0
76
77 /* Promotes a possibly negative, possibly signed char to an unsigned
78  * integer for use as an array index.  If the signed char is negative,
79  * we want to instead treat it as an 8-bit unsigned char, hence the
80  * double cast.
81  */
82 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83
84 /* Enter a start condition.  This macro really ought to take a parameter,
85  * but we do it the disgusting crufty way forced on us by the ()-less
86  * definition of BEGIN.
87  */
88 #define BEGIN yy_start = 1 + 2 *
89
90 /* Translate the current start state into a value that can be later handed
91  * to BEGIN to return to the state.  The YYSTATE alias is for lex
92  * compatibility.
93  */
94 #define YY_START ((yy_start - 1) / 2)
95 #define YYSTATE YY_START
96
97 /* Action number for EOF rule of a given start state. */
98 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99
100 /* Special action meaning "start processing a new file". */
101 #define YY_NEW_FILE yyrestart( yyin )
102
103 #define YY_END_OF_BUFFER_CHAR 0
104
105 /* Size of default input buffer. */
106 #define YY_BUF_SIZE 16384
107
108 typedef struct yy_buffer_state *YY_BUFFER_STATE;
109
110 extern int yyleng;
111 extern FILE *yyin, *yyout;
112
113 #define EOB_ACT_CONTINUE_SCAN 0
114 #define EOB_ACT_END_OF_FILE 1
115 #define EOB_ACT_LAST_MATCH 2
116
117 /* The funky do-while in the following #define is used to turn the definition
118  * int a single C statement (which needs a semi-colon terminator).  This
119  * avoids problems with code like:
120  *
121  *      if ( condition_holds )
122  *              yyless( 5 );
123  *      else
124  *              do_something_else();
125  *
126  * Prior to using the do-while the compiler would get upset at the
127  * "else" because it interpreted the "if" statement as being all
128  * done when it reached the ';' after the yyless() call.
129  */
130
131 /* Return all but the first 'n' matched characters back to the input stream. */
132
133 #define yyless(n) \
134         do \
135                 { \
136                 /* Undo effects of setting up yytext. */ \
137                 *yy_cp = yy_hold_char; \
138                 YY_RESTORE_YY_MORE_OFFSET \
139                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
140                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
141                 } \
142         while ( 0 )
143
144 #define unput(c) yyunput( c, yytext_ptr )
145
146 /* The following is because we cannot portably get our hands on size_t
147  * (without autoconf's help, which isn't available because we want
148  * flex-generated scanners to compile on their own).
149  */
150 typedef unsigned int yy_size_t;
151
152
153 struct yy_buffer_state
154         {
155         FILE *yy_input_file;
156
157         char *yy_ch_buf;                /* input buffer */
158         char *yy_buf_pos;               /* current position in input buffer */
159
160         /* Size of input buffer in bytes, not including room for EOB
161          * characters.
162          */
163         yy_size_t yy_buf_size;
164
165         /* Number of characters read into yy_ch_buf, not including EOB
166          * characters.
167          */
168         int yy_n_chars;
169
170         /* Whether we "own" the buffer - i.e., we know we created it,
171          * and can realloc() it to grow it, and should free() it to
172          * delete it.
173          */
174         int yy_is_our_buffer;
175
176         /* Whether this is an "interactive" input source; if so, and
177          * if we're using stdio for input, then we want to use getc()
178          * instead of fread(), to make sure we stop fetching input after
179          * each newline.
180          */
181         int yy_is_interactive;
182
183         /* Whether we're considered to be at the beginning of a line.
184          * If so, '^' rules will be active on the next match, otherwise
185          * not.
186          */
187         int yy_at_bol;
188
189         /* Whether to try to fill the input buffer when we reach the
190          * end of it.
191          */
192         int yy_fill_buffer;
193
194         int yy_buffer_status;
195 #define YY_BUFFER_NEW 0
196 #define YY_BUFFER_NORMAL 1
197         /* When an EOF's been seen but there's still some text to process
198          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
199          * shouldn't try reading from the input source any more.  We might
200          * still have a bunch of tokens to match, though, because of
201          * possible backing-up.
202          *
203          * When we actually see the EOF, we change the status to "new"
204          * (via yyrestart()), so that the user can continue scanning by
205          * just pointing yyin at a new input file.
206          */
207 #define YY_BUFFER_EOF_PENDING 2
208         };
209
210 static YY_BUFFER_STATE yy_current_buffer = 0;
211
212 /* We provide macros for accessing buffer states in case in the
213  * future we want to put the buffer states in a more general
214  * "scanner state".
215  */
216 #define YY_CURRENT_BUFFER yy_current_buffer
217
218
219 /* yy_hold_char holds the character lost when yytext is formed. */
220 static char yy_hold_char;
221
222 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
223
224
225 int yyleng;
226
227 /* Points to current character in buffer. */
228 static char *yy_c_buf_p = (char *) 0;
229 static int yy_init = 1;         /* whether we need to initialize */
230 static int yy_start = 0;        /* start state number */
231
232 /* Flag which is used to allow yywrap()'s to do buffer switches
233  * instead of setting up a fresh yyin.  A bit of a hack ...
234  */
235 static int yy_did_buffer_switch_on_eof;
236
237 void yyrestart YY_PROTO(( FILE *input_file ));
238
239 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
240 void yy_load_buffer_state YY_PROTO(( void ));
241 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
242 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
244 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
245 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
246
247 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
248 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
249 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
250
251 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
252 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
253 static void yy_flex_free YY_PROTO(( void * ));
254
255 #define yy_new_buffer yy_create_buffer
256
257 #define yy_set_interactive(is_interactive) \
258         { \
259         if ( ! yy_current_buffer ) \
260                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
261         yy_current_buffer->yy_is_interactive = is_interactive; \
262         }
263
264 #define yy_set_bol(at_bol) \
265         { \
266         if ( ! yy_current_buffer ) \
267                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
268         yy_current_buffer->yy_at_bol = at_bol; \
269         }
270
271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
272
273 typedef unsigned char YY_CHAR;
274 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
275 typedef int yy_state_type;
276 extern char *yytext;
277 #define yytext_ptr yytext
278
279 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
280 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
281 static int yy_get_next_buffer YY_PROTO(( void ));
282 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
283
284 /* Done after the current pattern has been matched and before the
285  * corresponding action - sets up yytext.
286  */
287 #define YY_DO_BEFORE_ACTION \
288         yytext_ptr = yy_bp; \
289         yyleng = (int) (yy_cp - yy_bp); \
290         yy_hold_char = *yy_cp; \
291         *yy_cp = '\0'; \
292         yy_c_buf_p = yy_cp;
293
294 #define YY_NUM_RULES 23
295 #define YY_END_OF_BUFFER 24
296 static yyconst short int yy_accept[138] =
297     {   0,
298         0,    0,   24,    9,    9,    9,    9,    0,    0,    0,
299         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
300         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
301         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
302         0,   12,    0,    0,    0,   14,    0,   16,    0,    6,
303         0,    0,    0,    0,    0,    0,    8,    0,    0,    0,
304         0,    0,    0,    0,    0,    5,    0,    0,    0,    0,
305         0,    0,   13,   17,    0,    0,    0,    0,    0,    0,
306         0,    0,    0,   20,    0,    0,    7,    0,    0,   10,
307         0,    0,   18,    0,    0,    0,    0,    2,    0,    0,
308
309        11,    0,    0,    0,    0,    0,    0,    0,    0,    0,
310         0,   21,    0,    0,    0,    0,    0,    0,    0,    0,
311         0,    0,    0,   22,    0,    3,    0,    0,    0,    0,
312         0,   19,    0,    4,    1,   15,    0
313     } ;
314
315 static yyconst int yy_ec[256] =
316     {   0,
317         1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
318         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
319         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
320         1,    3,    1,    4,    1,    1,    1,    1,    1,    1,
321         1,    1,    1,    1,    1,    1,    5,    6,    6,    6,
322         6,    6,    6,    6,    6,    6,    6,    1,    1,    7,
323         8,    9,    1,    1,   10,   11,   12,   13,   14,   15,
324         1,    1,   16,    1,    1,   17,   18,   19,   20,    1,
325         1,   21,   22,   23,   24,   25,    1,   26,    1,    1,
326         1,    1,    1,    1,    1,    1,   27,    1,   28,   29,
327
328        30,   31,    1,    1,   32,    1,    1,   33,    1,   34,
329        35,   36,    1,   37,   38,   39,   40,   41,    1,    1,
330        42,    1,    1,    1,    1,    1,    1,    1,    1,    1,
331         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
332         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
333         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
334         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
335         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
336         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
337         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
338
339         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
340         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
341         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
342         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
343         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
344         1,    1,    1,    1,    1
345     } ;
346
347 static yyconst int yy_meta[43] =
348     {   0,
349         1,    1,    1,    2,    1,    1,    1,    1,    1,    1,
350         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
351         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
352         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
353         1,    1
354     } ;
355
356 static yyconst short int yy_base[141] =
357     {   0,
358         0,    1,  151,  152,   37,  115,  112,    0,    1,  132,
359       113,  136,  121,  130,  123,  132,  111,    1,  108,  104,
360       101,  107,    0,  102,  109,  105,  115,  109,  114,  109,
361       108,    0,   93,   85,  118,   91,   92,    2,  107,  100,
362        83,  152,   80,  108,    2,  152,   95,  152,   84,  152,
363        82,   79,  110,   75,   73,   78,  152,   84,   86,   69,
364        79,   93,    0,   86,    0,  152,   66,   73,    0,   63,
365        59,   91,  152,  152,   62,   59,   87,   74,   76,   81,
366         2,   54,   84,    0,   54,   81,  152,   49,   56,  152,
367        73,   64,  152,   58,   47,   79,   42,  152,   53,   39,
368
369       152,   56,   45,   69,   70,   47,   35,   43,   51,   31,
370        66,   63,   26,   29,   40,   37,   30,   51,   21,   14,
371         8,   36,   39,   40,    8,  152,    8,   16,   34,   28,
372         2,  152,    0,  152,  152,    0,  152,   66,    5,    0
373     } ;
374
375 static yyconst short int yy_def[141] =
376     {   0,
377       138,  138,  137,  137,  137,  137,  137,  137,  137,  137,
378       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
379       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
380       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
381       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
382       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
383       137,  137,  137,  137,  137,  137,  137,  137,  139,  137,
384       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
385       137,  137,  137,  139,  137,  137,  137,  137,  137,  137,
386       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
387
388       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
389       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
390       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
391       137,  137,  140,  137,  137,  140,    0,  137,  137,  137
392     } ;
393
394 static yyconst short int yy_nxt[195] =
395     {   0,
396       136,   81,   81,   81,   81,   84,    5,    5,  137,   78,
397       137,   20,   33,   63,   39,  137,  137,   64,   40,   79,
398        23,  137,  137,   34,  137,  137,   21,   49,   22,   56,
399        50,  135,   57,    6,    6,   24,  134,  133,  132,    7,
400         7,    8,   94,  131,  130,  124,  129,  128,    9,  127,
401       126,   10,   11,   12,   13,  125,  124,   14,   15,  123,
402       122,   16,  121,  120,  119,   17,    4,    4,  112,  118,
403       117,  116,  115,  114,  113,  112,  111,  110,  109,  108,
404       107,  106,  105,  104,  103,  102,  101,  100,   99,   98,
405        97,   96,   95,   93,   92,   91,   90,   89,   88,   87,
406
407        86,   85,   83,   82,   80,   77,   76,   75,   74,   73,
408        72,   71,   70,   69,   68,   67,   66,   65,   62,   61,
409        60,   59,   58,   55,   54,   53,   52,   51,   48,   47,
410        46,   45,   44,   43,   42,   41,   38,   37,   36,   35,
411        32,   31,   30,   29,   28,   27,   26,   25,   19,   18,
412       137,    3,  137,  137,  137,  137,  137,  137,  137,  137,
413       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
414       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
415       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
416       137,  137,  137,  137
417
418     } ;
419
420 static yyconst short int yy_chk[195] =
421     {   0,
422       140,   65,   65,   81,   81,  139,    1,    2,    0,   63,
423         0,    8,   18,   45,   23,    0,    0,   45,   23,   63,
424         9,    0,    0,   18,    0,    0,    8,   32,    8,   38,
425        32,  131,   38,    1,    2,    9,  130,  129,  128,    1,
426         2,    5,   81,  127,  125,  124,  123,  122,    5,  121,
427       120,    5,    5,    5,    5,  119,  118,    5,    5,  117,
428       116,    5,  115,  114,  113,    5,  138,  138,  112,  111,
429       110,  109,  108,  107,  106,  105,  104,  103,  102,  100,
430        99,   97,   96,   95,   94,   92,   91,   89,   88,   86,
431        85,   83,   82,   80,   79,   78,   77,   76,   75,   72,
432
433        71,   70,   68,   67,   64,   62,   61,   60,   59,   58,
434        56,   55,   54,   53,   52,   51,   49,   47,   44,   43,
435        41,   40,   39,   37,   36,   35,   34,   33,   31,   30,
436        29,   28,   27,   26,   25,   24,   22,   21,   20,   19,
437        17,   16,   15,   14,   13,   12,   11,   10,    7,    6,
438         3,  137,  137,  137,  137,  137,  137,  137,  137,  137,
439       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
440       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
441       137,  137,  137,  137,  137,  137,  137,  137,  137,  137,
442       137,  137,  137,  137
443
444     } ;
445
446 static yy_state_type yy_last_accepting_state;
447 static char *yy_last_accepting_cpos;
448
449 /* The intent behind this definition is that it'll catch
450  * any uses of REJECT which flex missed.
451  */
452 #define REJECT reject_used_but_not_detected
453 #define yymore() yymore_used_but_not_detected
454 #define YY_MORE_ADJ 0
455 #define YY_RESTORE_YY_MORE_OFFSET
456 char *yytext;
457 #line 1 "meta_lex_ind.l"
458 #define INITIAL 0
459 /******************************************************************/
460 /*  Copyright (C) 2000, HELM Team                                 */ 
461 /*                                                                */
462 /* This file is part of HELM, an Hypertextual, Electronic         */
463 /* Library of Mathematics, developed at the Computer Science      */
464 /* Department, University of Bologna, Italy.                      */
465 /*                                                                */
466 /* HELM is free software; you can redistribute it and/or          */
467 /* modify it under the terms of the GNU General Public License    */
468 /* as published by the Free Software Foundation; either version   */
469 /* 2 of the License, or (at your option) any later version.       */
470 /*                                                                */
471 /* HELM is distributed in the hope that it will be useful,        */
472 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
473 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the   */
474 /* GNU General Public License for more details.                   */
475 /*                                                                */
476 /* You should have received a copy of the GNU General Public      */
477 /* License along with HELM; if not, write to the Free Software    */
478 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston,         */
479 /* MA  02111-1307, USA.                                           */
480 /*                                                                */
481 /* For details, see the HELM World-Wide-Web page,                 */
482 /* http://cs.unibo.it/helm/.                                      */
483 /******************************************************************/
484 /***************************************************************/
485 /*                         META_LEXAN                           */
486 /*                 Automatic Metadata Extractor                */
487 /*           First draft 11/12/2001, by Andrea Asperti         */
488 /*      more bugs added by domenico lordi on mon 12/17/2001    */
489 /***************************************************************/
490 /***************************************************************/
491 /* 1. Inclusion of header files.                                */
492 /***************************************************************/
493 #line 39 "meta_lex_ind.l"
494 #include                <string.h>
495 #include                <stdlib.h>
496 #include                <sys/stat.h>
497 #include                "sthandler_ind.h"
498 /***************************************************************/
499 /* 2. Constants and Variables Definitions                      */
500 /***************************************************************/
501 #line 50 "meta_lex_ind.l"
502 #define                 NOWHERE   0
503 #define                 CONST     1
504 #define                 MUTIND    2
505 #define                 MUTCONSTRUCT  3
506 #define                 SORT      4
507
508 #define                 INBODY    0
509 #define                 MAINHYP   1
510 #define                 INHYP     2
511 #define                 INCONCL   3
512 #define                 MAINCONCL 4
513 #define                 INTYPE    5
514 #define                 NOTFOUND  6
515
516 #define                 HERE      0     
517 #define                 AFTER     1
518
519
520 int                     where = NOWHERE;
521 int                     found = NOTFOUND;
522 int                     position = INBODY;
523 int                     first_child = HERE;
524 int                     skip = 0;     // boolean to skip the insertion of a URI
525 int                     no_open_source =0;
526 int                     spine_depth = 0;
527 int                     depth = 0;
528 int                     tmp_n;
529 int                     inductive_type = 0;
530 int                     constructor = 0;
531 int                     deep_type = 0;
532 char                    sep = '"';
533 char                    *xpointer = "#xpointer(1/";
534 char                    *uri;
535 char                    *tmp;
536 char                    *filename;
537 char                    *file_uri; 
538 char                    *inductive_uri;
539 char                    *filename_prefix;
540 char                    *file_uri_prefix;
541 /***************************************************************/
542 /* 3. Regular definitions.                                      */
543 /***************************************************************/
544 /***************************************************************/
545 /* 4. Rules.                                                    */
546 /***************************************************************/
547 #line 548 "lex.yy_ind.c"
548
549 /* Macros after this point can all be overridden by user definitions in
550  * section 1.
551  */
552
553 #ifndef YY_SKIP_YYWRAP
554 #ifdef __cplusplus
555 extern "C" int yywrap YY_PROTO(( void ));
556 #else
557 extern int yywrap YY_PROTO(( void ));
558 #endif
559 #endif
560
561 #ifndef YY_NO_UNPUT
562 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
563 #endif
564
565 #ifndef yytext_ptr
566 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
567 #endif
568
569 #ifdef YY_NEED_STRLEN
570 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
571 #endif
572
573 #ifndef YY_NO_INPUT
574 #ifdef __cplusplus
575 static int yyinput YY_PROTO(( void ));
576 #else
577 static int input YY_PROTO(( void ));
578 #endif
579 #endif
580
581 #if YY_STACK_USED
582 static int yy_start_stack_ptr = 0;
583 static int yy_start_stack_depth = 0;
584 static int *yy_start_stack = 0;
585 #ifndef YY_NO_PUSH_STATE
586 static void yy_push_state YY_PROTO(( int new_state ));
587 #endif
588 #ifndef YY_NO_POP_STATE
589 static void yy_pop_state YY_PROTO(( void ));
590 #endif
591 #ifndef YY_NO_TOP_STATE
592 static int yy_top_state YY_PROTO(( void ));
593 #endif
594
595 #else
596 #define YY_NO_PUSH_STATE 1
597 #define YY_NO_POP_STATE 1
598 #define YY_NO_TOP_STATE 1
599 #endif
600
601 #ifdef YY_MALLOC_DECL
602 YY_MALLOC_DECL
603 #else
604 #if __STDC__
605 #ifndef __cplusplus
606 #include <stdlib.h>
607 #endif
608 #else
609 /* Just try to get by without declaring the routines.  This will fail
610  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
611  * or sizeof(void*) != sizeof(int).
612  */
613 #endif
614 #endif
615
616 /* Amount of stuff to slurp up with each read. */
617 #ifndef YY_READ_BUF_SIZE
618 #define YY_READ_BUF_SIZE 8192
619 #endif
620
621 /* Copy whatever the last rule matched to the standard output. */
622
623 #ifndef ECHO
624 /* This used to be an fputs(), but since the string might contain NUL's,
625  * we now use fwrite().
626  */
627 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
628 #endif
629
630 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
631  * is returned in "result".
632  */
633 #ifndef YY_INPUT
634 #define YY_INPUT(buf,result,max_size) \
635         if ( yy_current_buffer->yy_is_interactive ) \
636                 { \
637                 int c = '*', n; \
638                 for ( n = 0; n < max_size && \
639                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
640                         buf[n] = (char) c; \
641                 if ( c == '\n' ) \
642                         buf[n++] = (char) c; \
643                 if ( c == EOF && ferror( yyin ) ) \
644                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
645                 result = n; \
646                 } \
647         else \
648                 { \
649                 errno=0; \
650                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
651                         { \
652                         if( errno != EINTR) \
653                                 { \
654                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
655                                 break; \
656                                 } \
657                         errno=0; \
658                         clearerr(yyin); \
659                         } \
660                 }
661 #endif
662
663 /* No semi-colon after return; correct usage is to write "yyterminate();" -
664  * we don't want an extra ';' after the "return" because that will cause
665  * some compilers to complain about unreachable statements.
666  */
667 #ifndef yyterminate
668 #define yyterminate() return YY_NULL
669 #endif
670
671 /* Number of entries by which start-condition stack grows. */
672 #ifndef YY_START_STACK_INCR
673 #define YY_START_STACK_INCR 25
674 #endif
675
676 /* Report a fatal error. */
677 #ifndef YY_FATAL_ERROR
678 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
679 #endif
680
681 /* Default declaration of generated scanner - a define so the user can
682  * easily add parameters.
683  */
684 #ifndef YY_DECL
685 #define YY_DECL int yylex YY_PROTO(( void ))
686 #endif
687
688 /* Code executed at the beginning of each rule, after yytext and yyleng
689  * have been set up.
690  */
691 #ifndef YY_USER_ACTION
692 #define YY_USER_ACTION
693 #endif
694
695 /* Code executed at the end of each rule. */
696 #ifndef YY_BREAK
697 #define YY_BREAK break;
698 #endif
699
700 #define YY_RULE_SETUP \
701         YY_USER_ACTION
702
703 YY_DECL
704         {
705         register yy_state_type yy_current_state;
706         register char *yy_cp, *yy_bp;
707         register int yy_act;
708
709 #line 104 "meta_lex_ind.l"
710
711
712 #line 713 "lex.yy_ind.c"
713
714         if ( yy_init )
715                 {
716                 yy_init = 0;
717
718 #ifdef YY_USER_INIT
719                 YY_USER_INIT;
720 #endif
721
722                 if ( ! yy_start )
723                         yy_start = 1;   /* first start state */
724
725                 if ( ! yyin )
726                         yyin = stdin;
727
728                 if ( ! yyout )
729                         yyout = stdout;
730
731                 if ( ! yy_current_buffer )
732                         yy_current_buffer =
733                                 yy_create_buffer( yyin, YY_BUF_SIZE );
734
735                 yy_load_buffer_state();
736                 }
737
738         while ( 1 )             /* loops until end-of-file is reached */
739                 {
740                 yy_cp = yy_c_buf_p;
741
742                 /* Support of yytext. */
743                 *yy_cp = yy_hold_char;
744
745                 /* yy_bp points to the position in yy_ch_buf of the start of
746                  * the current run.
747                  */
748                 yy_bp = yy_cp;
749
750                 yy_current_state = yy_start;
751 yy_match:
752                 do
753                         {
754                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
755                         if ( yy_accept[yy_current_state] )
756                                 {
757                                 yy_last_accepting_state = yy_current_state;
758                                 yy_last_accepting_cpos = yy_cp;
759                                 }
760                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
761                                 {
762                                 yy_current_state = (int) yy_def[yy_current_state];
763                                 if ( yy_current_state >= 138 )
764                                         yy_c = yy_meta[(unsigned int) yy_c];
765                                 }
766                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
767                         ++yy_cp;
768                         }
769                 while ( yy_base[yy_current_state] != 152 );
770
771 yy_find_action:
772                 yy_act = yy_accept[yy_current_state];
773                 if ( yy_act == 0 )
774                         { /* have to back up */
775                         yy_cp = yy_last_accepting_cpos;
776                         yy_current_state = yy_last_accepting_state;
777                         yy_act = yy_accept[yy_current_state];
778                         }
779
780                 YY_DO_BEFORE_ACTION;
781
782
783 do_action:      /* This label is used only to access EOF actions. */
784
785
786                 switch ( yy_act )
787         { /* beginning of action switch */
788                         case 0: /* must back up */
789                         /* undo the effects of YY_DO_BEFORE_ACTION */
790                         *yy_cp = yy_hold_char;
791                         yy_cp = yy_last_accepting_cpos;
792                         yy_current_state = yy_last_accepting_state;
793                         goto yy_find_action;
794
795 case 1:
796 YY_RULE_SETUP
797 #line 106 "meta_lex_ind.l"
798
799                      /* fprintf(stderr,"uno"); */
800                      init_symbol_table();
801                      no_open_source = 0;
802                      depth = 0;
803                      spine_depth = 0;
804                      /* fprintf(stderr,"due"); */
805                      inductive_type++;
806                      constructor=0;
807                      position = INTYPE;
808                      first_child = HERE;
809                    }
810         YY_BREAK
811 case 2:
812 YY_RULE_SETUP
813 #line 119 "meta_lex_ind.l"
814 { tmp = (char *)malloc(sizeof('a')*128);
815                      strcpy(filename,filename_prefix);
816                      /* fprintf(stderr,"tre"); */
817                      strcpy(file_uri,file_uri_prefix);
818                      sprintf(tmp,",%d.xml", inductive_type);
819                      /* fprintf(stderr,"quattro"); */
820                      strcat(filename,tmp);
821                      sprintf(tmp,"#xpointer(1/%d)", inductive_type);
822                      strcat(file_uri,tmp);
823                      /* fprintf(stderr,"cinque"); */
824                      free(tmp);
825                      print_file();
826                    }
827         YY_BREAK
828 case 3:
829 YY_RULE_SETUP
830 #line 133 "meta_lex_ind.l"
831 { init_symbol_table();
832                      no_open_source = 0;
833                      depth = 0;
834                      spine_depth = 0;
835                      constructor++;
836                      strcpy(inductive_uri,file_uri_prefix);
837                      position = INTYPE;
838                      first_child = HERE;
839                    }
840         YY_BREAK
841 case 4:
842 YY_RULE_SETUP
843 #line 143 "meta_lex_ind.l"
844 { tmp = (char *)malloc(sizeof('a')*128);
845                      strcpy(filename,filename_prefix);
846                      strcpy(file_uri,file_uri_prefix);
847                      strcpy(inductive_uri,file_uri_prefix);
848                      sprintf(tmp,",%d,%d.xml", inductive_type,constructor);
849                      strcat(filename,tmp);
850                      sprintf(tmp,"#xpointer(1/%d/%d)",inductive_type,constructor);
851                      strcat(file_uri,tmp);
852                      free(tmp);
853                      print_file();
854                    }
855         YY_BREAK
856 case 5:
857 #line 156 "meta_lex_ind.l"
858 case 6:
859 YY_RULE_SETUP
860 #line 156 "meta_lex_ind.l"
861 {
862                     if (position == INTYPE)
863                        position = MAINHYP;
864                     else if (position == MAINHYP)
865                         { position = INHYP;
866                           no_open_source++;};
867                    }
868         YY_BREAK
869 case 7:
870 #line 165 "meta_lex_ind.l"
871 case 8:
872 YY_RULE_SETUP
873 #line 165 "meta_lex_ind.l"
874 {
875                     if (position == INHYP)
876                      {
877                       no_open_source--;
878                       if (no_open_source == 0) 
879                         {
880                          position = MAINHYP;
881                          depth++;
882                          first_child = HERE;
883                         }
884                      }
885                     else if (position == MAINHYP)
886                       {
887                        position = INTYPE;
888                        spine_depth++;
889                        depth = 0;
890                       }
891                     first_child = HERE;
892                    }
893         YY_BREAK
894 case 9:
895 YY_RULE_SETUP
896 #line 186 "meta_lex_ind.l"
897 {
898                    }
899         YY_BREAK
900 case 10:
901 #line 190 "meta_lex_ind.l"
902 case 11:
903 #line 191 "meta_lex_ind.l"
904 case 12:
905 #line 192 "meta_lex_ind.l"
906 case 13:
907 YY_RULE_SETUP
908 #line 192 "meta_lex_ind.l"
909
910                           first_child = AFTER;
911                    }
912         YY_BREAK
913 case 14:
914 YY_RULE_SETUP
915 #line 196 "meta_lex_ind.l"
916 {
917                     if (((position == INTYPE) | (position == MAINHYP)) &&
918                        (first_child == HERE))
919                      {
920                        if (position == INTYPE) /* REL on the spine */
921                          {
922                            position = INCONCL;
923                            search("Rel",first_child,position,spine_depth);
924                          }
925                        else search("Rel",first_child,position,depth);
926                        first_child = AFTER;
927                      }
928                    }
929         YY_BREAK
930 case 15:
931 YY_RULE_SETUP
932 #line 210 "meta_lex_ind.l"
933 {         
934                     if ((position == INTYPE) | (position == MAINHYP))
935                      {
936                        tmp=(char *)malloc((sizeof('a')*200)); 
937                        strcpy(tmp,yytext);
938                        strsep(&tmp,&sep); 
939                        if (position == INTYPE) /* SORT on the spine */
940                          { 
941                            position = INCONCL;
942                            search(tmp,first_child,position,spine_depth);
943                          }
944                        else search(tmp,first_child,position,depth);
945                        first_child = AFTER;
946                      }
947                    }
948         YY_BREAK
949 case 16:
950 YY_RULE_SETUP
951 #line 226 "meta_lex_ind.l"
952 {
953                      skip = 1;
954                      first_child = AFTER;
955                    }
956         YY_BREAK
957 case 17:
958 YY_RULE_SETUP
959 #line 231 "meta_lex_ind.l"
960
961                      if (position == INTYPE) /* CONST on the spine */
962                         position = INCONCL;
963                      where = CONST;
964                    }
965         YY_BREAK
966 case 18:
967 YY_RULE_SETUP
968 #line 237 "meta_lex_ind.l"
969
970                      if (position == INTYPE) /* MUTIND on the spine */
971                         position = INCONCL;
972                      where = MUTIND;
973                    }
974         YY_BREAK
975 case 19:
976 YY_RULE_SETUP
977 #line 243 "meta_lex_ind.l"
978
979                      if (position == INTYPE) /* MUTCONSTRUCT on the spine */
980                         position = INCONCL;
981                      where = MUTCONSTRUCT;
982                    }
983         YY_BREAK
984 case 20:
985 YY_RULE_SETUP
986 #line 249 "meta_lex_ind.l"
987 {     
988                          if (!skip) {
989                             uri=(char *)malloc((sizeof('a')*200)); 
990                             strcpy(uri,yytext);
991                             strsep(&uri,&sep);
992                             if (where == CONST)
993                               {
994                                 if (position == INCONCL)
995                                   search(uri,first_child,position,spine_depth);
996                                 else search(uri,first_child,position,depth);
997                                 where = NOWHERE;
998                                 first_child = AFTER;
999                                 free(uri); 
1000                               };
1001                          } else skip = 0;
1002                    } 
1003         YY_BREAK
1004 case 21:
1005 YY_RULE_SETUP
1006 #line 266 "meta_lex_ind.l"
1007 {
1008                          if ((where == MUTIND) || (where == MUTCONSTRUCT))
1009                           { strsep(&yytext,&sep);
1010                             tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1011                             strcpy(tmp,yytext);
1012                             tmp_n = atoi(tmp)+1;
1013                             sprintf(tmp,"%d",tmp_n);
1014                             strcat(uri,"#xpointer(1/"); 
1015                             strcat(uri,tmp); 
1016                           };
1017                          if (where == MUTIND) 
1018                              { 
1019                                strcat(uri,")");
1020                                if (position == INCONCL)
1021                                   search(uri,first_child,position,spine_depth);
1022                                else search(uri,first_child,position,depth);
1023                                free(uri);
1024                                free(tmp);
1025                                where = NOWHERE; 
1026                                first_child = AFTER;};
1027                    } 
1028         YY_BREAK
1029 case 22:
1030 YY_RULE_SETUP
1031 #line 288 "meta_lex_ind.l"
1032 {
1033                          if (where == MUTCONSTRUCT)
1034                           { strsep(&yytext,&sep);
1035                             tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1036                             strcpy(tmp,yytext);
1037                             strcat(uri,"/");
1038                             strcat(uri,tmp);
1039                             strcat(uri,")");
1040                             if (position == INCONCL)
1041                               search(uri,first_child,position,spine_depth);
1042                             else search(uri,first_child,position,depth);
1043                             free(uri);
1044                             free(tmp);
1045                             where = NOWHERE; 
1046                             first_child = AFTER;};
1047                    } 
1048         YY_BREAK
1049 case 23:
1050 YY_RULE_SETUP
1051 #line 307 "meta_lex_ind.l"
1052 ECHO;
1053         YY_BREAK
1054 #line 1055 "lex.yy_ind.c"
1055 case YY_STATE_EOF(INITIAL):
1056         yyterminate();
1057
1058         case YY_END_OF_BUFFER:
1059                 {
1060                 /* Amount of text matched not including the EOB char. */
1061                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1062
1063                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1064                 *yy_cp = yy_hold_char;
1065                 YY_RESTORE_YY_MORE_OFFSET
1066
1067                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1068                         {
1069                         /* We're scanning a new file or input source.  It's
1070                          * possible that this happened because the user
1071                          * just pointed yyin at a new source and called
1072                          * yylex().  If so, then we have to assure
1073                          * consistency between yy_current_buffer and our
1074                          * globals.  Here is the right place to do so, because
1075                          * this is the first action (other than possibly a
1076                          * back-up) that will match for the new input source.
1077                          */
1078                         yy_n_chars = yy_current_buffer->yy_n_chars;
1079                         yy_current_buffer->yy_input_file = yyin;
1080                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1081                         }
1082
1083                 /* Note that here we test for yy_c_buf_p "<=" to the position
1084                  * of the first EOB in the buffer, since yy_c_buf_p will
1085                  * already have been incremented past the NUL character
1086                  * (since all states make transitions on EOB to the
1087                  * end-of-buffer state).  Contrast this with the test
1088                  * in input().
1089                  */
1090                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1091                         { /* This was really a NUL. */
1092                         yy_state_type yy_next_state;
1093
1094                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1095
1096                         yy_current_state = yy_get_previous_state();
1097
1098                         /* Okay, we're now positioned to make the NUL
1099                          * transition.  We couldn't have
1100                          * yy_get_previous_state() go ahead and do it
1101                          * for us because it doesn't know how to deal
1102                          * with the possibility of jamming (and we don't
1103                          * want to build jamming into it because then it
1104                          * will run more slowly).
1105                          */
1106
1107                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1108
1109                         yy_bp = yytext_ptr + YY_MORE_ADJ;
1110
1111                         if ( yy_next_state )
1112                                 {
1113                                 /* Consume the NUL. */
1114                                 yy_cp = ++yy_c_buf_p;
1115                                 yy_current_state = yy_next_state;
1116                                 goto yy_match;
1117                                 }
1118
1119                         else
1120                                 {
1121                                 yy_cp = yy_c_buf_p;
1122                                 goto yy_find_action;
1123                                 }
1124                         }
1125
1126                 else switch ( yy_get_next_buffer() )
1127                         {
1128                         case EOB_ACT_END_OF_FILE:
1129                                 {
1130                                 yy_did_buffer_switch_on_eof = 0;
1131
1132                                 if ( yywrap() )
1133                                         {
1134                                         /* Note: because we've taken care in
1135                                          * yy_get_next_buffer() to have set up
1136                                          * yytext, we can now set up
1137                                          * yy_c_buf_p so that if some total
1138                                          * hoser (like flex itself) wants to
1139                                          * call the scanner after we return the
1140                                          * YY_NULL, it'll still work - another
1141                                          * YY_NULL will get returned.
1142                                          */
1143                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1144
1145                                         yy_act = YY_STATE_EOF(YY_START);
1146                                         goto do_action;
1147                                         }
1148
1149                                 else
1150                                         {
1151                                         if ( ! yy_did_buffer_switch_on_eof )
1152                                                 YY_NEW_FILE;
1153                                         }
1154                                 break;
1155                                 }
1156
1157                         case EOB_ACT_CONTINUE_SCAN:
1158                                 yy_c_buf_p =
1159                                         yytext_ptr + yy_amount_of_matched_text;
1160
1161                                 yy_current_state = yy_get_previous_state();
1162
1163                                 yy_cp = yy_c_buf_p;
1164                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1165                                 goto yy_match;
1166
1167                         case EOB_ACT_LAST_MATCH:
1168                                 yy_c_buf_p =
1169                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1170
1171                                 yy_current_state = yy_get_previous_state();
1172
1173                                 yy_cp = yy_c_buf_p;
1174                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1175                                 goto yy_find_action;
1176                         }
1177                 break;
1178                 }
1179
1180         default:
1181                 YY_FATAL_ERROR(
1182                         "fatal flex scanner internal error--no action found" );
1183         } /* end of action switch */
1184                 } /* end of scanning one token */
1185         } /* end of yylex */
1186
1187
1188 /* yy_get_next_buffer - try to read in a new buffer
1189  *
1190  * Returns a code representing an action:
1191  *      EOB_ACT_LAST_MATCH -
1192  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1193  *      EOB_ACT_END_OF_FILE - end of file
1194  */
1195
1196 static int yy_get_next_buffer()
1197         {
1198         register char *dest = yy_current_buffer->yy_ch_buf;
1199         register char *source = yytext_ptr;
1200         register int number_to_move, i;
1201         int ret_val;
1202
1203         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1204                 YY_FATAL_ERROR(
1205                 "fatal flex scanner internal error--end of buffer missed" );
1206
1207         if ( yy_current_buffer->yy_fill_buffer == 0 )
1208                 { /* Don't try to fill the buffer, so this is an EOF. */
1209                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1210                         {
1211                         /* We matched a single character, the EOB, so
1212                          * treat this as a final EOF.
1213                          */
1214                         return EOB_ACT_END_OF_FILE;
1215                         }
1216
1217                 else
1218                         {
1219                         /* We matched some text prior to the EOB, first
1220                          * process it.
1221                          */
1222                         return EOB_ACT_LAST_MATCH;
1223                         }
1224                 }
1225
1226         /* Try to read more data. */
1227
1228         /* First move last chars to start of buffer. */
1229         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1230
1231         for ( i = 0; i < number_to_move; ++i )
1232                 *(dest++) = *(source++);
1233
1234         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1235                 /* don't do the read, it's not guaranteed to return an EOF,
1236                  * just force an EOF
1237                  */
1238                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1239
1240         else
1241                 {
1242                 int num_to_read =
1243                         yy_current_buffer->yy_buf_size - number_to_move - 1;
1244
1245                 while ( num_to_read <= 0 )
1246                         { /* Not enough room in the buffer - grow it. */
1247 #ifdef YY_USES_REJECT
1248                         YY_FATAL_ERROR(
1249 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1250 #else
1251
1252                         /* just a shorter name for the current buffer */
1253                         YY_BUFFER_STATE b = yy_current_buffer;
1254
1255                         int yy_c_buf_p_offset =
1256                                 (int) (yy_c_buf_p - b->yy_ch_buf);
1257
1258                         if ( b->yy_is_our_buffer )
1259                                 {
1260                                 int new_size = b->yy_buf_size * 2;
1261
1262                                 if ( new_size <= 0 )
1263                                         b->yy_buf_size += b->yy_buf_size / 8;
1264                                 else
1265                                         b->yy_buf_size *= 2;
1266
1267                                 b->yy_ch_buf = (char *)
1268                                         /* Include room in for 2 EOB chars. */
1269                                         yy_flex_realloc( (void *) b->yy_ch_buf,
1270                                                          b->yy_buf_size + 2 );
1271                                 }
1272                         else
1273                                 /* Can't grow it, we don't own it. */
1274                                 b->yy_ch_buf = 0;
1275
1276                         if ( ! b->yy_ch_buf )
1277                                 YY_FATAL_ERROR(
1278                                 "fatal error - scanner input buffer overflow" );
1279
1280                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1281
1282                         num_to_read = yy_current_buffer->yy_buf_size -
1283                                                 number_to_move - 1;
1284 #endif
1285                         }
1286
1287                 if ( num_to_read > YY_READ_BUF_SIZE )
1288                         num_to_read = YY_READ_BUF_SIZE;
1289
1290                 /* Read in more data. */
1291                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1292                         yy_n_chars, num_to_read );
1293
1294                 yy_current_buffer->yy_n_chars = yy_n_chars;
1295                 }
1296
1297         if ( yy_n_chars == 0 )
1298                 {
1299                 if ( number_to_move == YY_MORE_ADJ )
1300                         {
1301                         ret_val = EOB_ACT_END_OF_FILE;
1302                         yyrestart( yyin );
1303                         }
1304
1305                 else
1306                         {
1307                         ret_val = EOB_ACT_LAST_MATCH;
1308                         yy_current_buffer->yy_buffer_status =
1309                                 YY_BUFFER_EOF_PENDING;
1310                         }
1311                 }
1312
1313         else
1314                 ret_val = EOB_ACT_CONTINUE_SCAN;
1315
1316         yy_n_chars += number_to_move;
1317         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1318         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1319
1320         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1321
1322         return ret_val;
1323         }
1324
1325
1326 /* yy_get_previous_state - get the state just before the EOB char was reached */
1327
1328 static yy_state_type yy_get_previous_state()
1329         {
1330         register yy_state_type yy_current_state;
1331         register char *yy_cp;
1332
1333         yy_current_state = yy_start;
1334
1335         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1336                 {
1337                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1338                 if ( yy_accept[yy_current_state] )
1339                         {
1340                         yy_last_accepting_state = yy_current_state;
1341                         yy_last_accepting_cpos = yy_cp;
1342                         }
1343                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1344                         {
1345                         yy_current_state = (int) yy_def[yy_current_state];
1346                         if ( yy_current_state >= 138 )
1347                                 yy_c = yy_meta[(unsigned int) yy_c];
1348                         }
1349                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1350                 }
1351
1352         return yy_current_state;
1353         }
1354
1355
1356 /* yy_try_NUL_trans - try to make a transition on the NUL character
1357  *
1358  * synopsis
1359  *      next_state = yy_try_NUL_trans( current_state );
1360  */
1361
1362 #ifdef YY_USE_PROTOS
1363 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1364 #else
1365 static yy_state_type yy_try_NUL_trans( yy_current_state )
1366 yy_state_type yy_current_state;
1367 #endif
1368         {
1369         register int yy_is_jam;
1370         register char *yy_cp = yy_c_buf_p;
1371
1372         register YY_CHAR yy_c = 1;
1373         if ( yy_accept[yy_current_state] )
1374                 {
1375                 yy_last_accepting_state = yy_current_state;
1376                 yy_last_accepting_cpos = yy_cp;
1377                 }
1378         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1379                 {
1380                 yy_current_state = (int) yy_def[yy_current_state];
1381                 if ( yy_current_state >= 138 )
1382                         yy_c = yy_meta[(unsigned int) yy_c];
1383                 }
1384         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1385         yy_is_jam = (yy_current_state == 137);
1386
1387         return yy_is_jam ? 0 : yy_current_state;
1388         }
1389
1390
1391 #ifndef YY_NO_UNPUT
1392 #ifdef YY_USE_PROTOS
1393 static void yyunput( int c, register char *yy_bp )
1394 #else
1395 static void yyunput( c, yy_bp )
1396 int c;
1397 register char *yy_bp;
1398 #endif
1399         {
1400         register char *yy_cp = yy_c_buf_p;
1401
1402         /* undo effects of setting up yytext */
1403         *yy_cp = yy_hold_char;
1404
1405         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1406                 { /* need to shift things up to make room */
1407                 /* +2 for EOB chars. */
1408                 register int number_to_move = yy_n_chars + 2;
1409                 register char *dest = &yy_current_buffer->yy_ch_buf[
1410                                         yy_current_buffer->yy_buf_size + 2];
1411                 register char *source =
1412                                 &yy_current_buffer->yy_ch_buf[number_to_move];
1413
1414                 while ( source > yy_current_buffer->yy_ch_buf )
1415                         *--dest = *--source;
1416
1417                 yy_cp += (int) (dest - source);
1418                 yy_bp += (int) (dest - source);
1419                 yy_current_buffer->yy_n_chars =
1420                         yy_n_chars = yy_current_buffer->yy_buf_size;
1421
1422                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1423                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1424                 }
1425
1426         *--yy_cp = (char) c;
1427
1428
1429         yytext_ptr = yy_bp;
1430         yy_hold_char = *yy_cp;
1431         yy_c_buf_p = yy_cp;
1432         }
1433 #endif  /* ifndef YY_NO_UNPUT */
1434
1435
1436 #ifdef __cplusplus
1437 static int yyinput()
1438 #else
1439 static int input()
1440 #endif
1441         {
1442         int c;
1443
1444         *yy_c_buf_p = yy_hold_char;
1445
1446         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1447                 {
1448                 /* yy_c_buf_p now points to the character we want to return.
1449                  * If this occurs *before* the EOB characters, then it's a
1450                  * valid NUL; if not, then we've hit the end of the buffer.
1451                  */
1452                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1453                         /* This was really a NUL. */
1454                         *yy_c_buf_p = '\0';
1455
1456                 else
1457                         { /* need more input */
1458                         int offset = yy_c_buf_p - yytext_ptr;
1459                         ++yy_c_buf_p;
1460
1461                         switch ( yy_get_next_buffer() )
1462                                 {
1463                                 case EOB_ACT_LAST_MATCH:
1464                                         /* This happens because yy_g_n_b()
1465                                          * sees that we've accumulated a
1466                                          * token and flags that we need to
1467                                          * try matching the token before
1468                                          * proceeding.  But for input(),
1469                                          * there's no matching to consider.
1470                                          * So convert the EOB_ACT_LAST_MATCH
1471                                          * to EOB_ACT_END_OF_FILE.
1472                                          */
1473
1474                                         /* Reset buffer status. */
1475                                         yyrestart( yyin );
1476
1477                                         /* fall through */
1478
1479                                 case EOB_ACT_END_OF_FILE:
1480                                         {
1481                                         if ( yywrap() )
1482                                                 return EOF;
1483
1484                                         if ( ! yy_did_buffer_switch_on_eof )
1485                                                 YY_NEW_FILE;
1486 #ifdef __cplusplus
1487                                         return yyinput();
1488 #else
1489                                         return input();
1490 #endif
1491                                         }
1492
1493                                 case EOB_ACT_CONTINUE_SCAN:
1494                                         yy_c_buf_p = yytext_ptr + offset;
1495                                         break;
1496                                 }
1497                         }
1498                 }
1499
1500         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
1501         *yy_c_buf_p = '\0';     /* preserve yytext */
1502         yy_hold_char = *++yy_c_buf_p;
1503
1504
1505         return c;
1506         }
1507
1508
1509 #ifdef YY_USE_PROTOS
1510 void yyrestart( FILE *input_file )
1511 #else
1512 void yyrestart( input_file )
1513 FILE *input_file;
1514 #endif
1515         {
1516         if ( ! yy_current_buffer )
1517                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1518
1519         yy_init_buffer( yy_current_buffer, input_file );
1520         yy_load_buffer_state();
1521         }
1522
1523
1524 #ifdef YY_USE_PROTOS
1525 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1526 #else
1527 void yy_switch_to_buffer( new_buffer )
1528 YY_BUFFER_STATE new_buffer;
1529 #endif
1530         {
1531         if ( yy_current_buffer == new_buffer )
1532                 return;
1533
1534         if ( yy_current_buffer )
1535                 {
1536                 /* Flush out information for old buffer. */
1537                 *yy_c_buf_p = yy_hold_char;
1538                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1539                 yy_current_buffer->yy_n_chars = yy_n_chars;
1540                 }
1541
1542         yy_current_buffer = new_buffer;
1543         yy_load_buffer_state();
1544
1545         /* We don't actually know whether we did this switch during
1546          * EOF (yywrap()) processing, but the only time this flag
1547          * is looked at is after yywrap() is called, so it's safe
1548          * to go ahead and always set it.
1549          */
1550         yy_did_buffer_switch_on_eof = 1;
1551         }
1552
1553
1554 #ifdef YY_USE_PROTOS
1555 void yy_load_buffer_state( void )
1556 #else
1557 void yy_load_buffer_state()
1558 #endif
1559         {
1560         yy_n_chars = yy_current_buffer->yy_n_chars;
1561         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1562         yyin = yy_current_buffer->yy_input_file;
1563         yy_hold_char = *yy_c_buf_p;
1564         }
1565
1566
1567 #ifdef YY_USE_PROTOS
1568 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1569 #else
1570 YY_BUFFER_STATE yy_create_buffer( file, size )
1571 FILE *file;
1572 int size;
1573 #endif
1574         {
1575         YY_BUFFER_STATE b;
1576
1577         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1578         if ( ! b )
1579                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1580
1581         b->yy_buf_size = size;
1582
1583         /* yy_ch_buf has to be 2 characters longer than the size given because
1584          * we need to put in 2 end-of-buffer characters.
1585          */
1586         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1587         if ( ! b->yy_ch_buf )
1588                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1589
1590         b->yy_is_our_buffer = 1;
1591
1592         yy_init_buffer( b, file );
1593
1594         return b;
1595         }
1596
1597
1598 #ifdef YY_USE_PROTOS
1599 void yy_delete_buffer( YY_BUFFER_STATE b )
1600 #else
1601 void yy_delete_buffer( b )
1602 YY_BUFFER_STATE b;
1603 #endif
1604         {
1605         if ( ! b )
1606                 return;
1607
1608         if ( b == yy_current_buffer )
1609                 yy_current_buffer = (YY_BUFFER_STATE) 0;
1610
1611         if ( b->yy_is_our_buffer )
1612                 yy_flex_free( (void *) b->yy_ch_buf );
1613
1614         yy_flex_free( (void *) b );
1615         }
1616
1617
1618 #ifndef _WIN32
1619 #include <unistd.h>
1620 #else
1621 #ifndef YY_ALWAYS_INTERACTIVE
1622 #ifndef YY_NEVER_INTERACTIVE
1623 extern int isatty YY_PROTO(( int ));
1624 #endif
1625 #endif
1626 #endif
1627
1628 #ifdef YY_USE_PROTOS
1629 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1630 #else
1631 void yy_init_buffer( b, file )
1632 YY_BUFFER_STATE b;
1633 FILE *file;
1634 #endif
1635
1636
1637         {
1638         yy_flush_buffer( b );
1639
1640         b->yy_input_file = file;
1641         b->yy_fill_buffer = 1;
1642
1643 #if YY_ALWAYS_INTERACTIVE
1644         b->yy_is_interactive = 1;
1645 #else
1646 #if YY_NEVER_INTERACTIVE
1647         b->yy_is_interactive = 0;
1648 #else
1649         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1650 #endif
1651 #endif
1652         }
1653
1654
1655 #ifdef YY_USE_PROTOS
1656 void yy_flush_buffer( YY_BUFFER_STATE b )
1657 #else
1658 void yy_flush_buffer( b )
1659 YY_BUFFER_STATE b;
1660 #endif
1661
1662         {
1663         if ( ! b )
1664                 return;
1665
1666         b->yy_n_chars = 0;
1667
1668         /* We always need two end-of-buffer characters.  The first causes
1669          * a transition to the end-of-buffer state.  The second causes
1670          * a jam in that state.
1671          */
1672         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1673         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1674
1675         b->yy_buf_pos = &b->yy_ch_buf[0];
1676
1677         b->yy_at_bol = 1;
1678         b->yy_buffer_status = YY_BUFFER_NEW;
1679
1680         if ( b == yy_current_buffer )
1681                 yy_load_buffer_state();
1682         }
1683
1684
1685 #ifndef YY_NO_SCAN_BUFFER
1686 #ifdef YY_USE_PROTOS
1687 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1688 #else
1689 YY_BUFFER_STATE yy_scan_buffer( base, size )
1690 char *base;
1691 yy_size_t size;
1692 #endif
1693         {
1694         YY_BUFFER_STATE b;
1695
1696         if ( size < 2 ||
1697              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1698              base[size-1] != YY_END_OF_BUFFER_CHAR )
1699                 /* They forgot to leave room for the EOB's. */
1700                 return 0;
1701
1702         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1703         if ( ! b )
1704                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1705
1706         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1707         b->yy_buf_pos = b->yy_ch_buf = base;
1708         b->yy_is_our_buffer = 0;
1709         b->yy_input_file = 0;
1710         b->yy_n_chars = b->yy_buf_size;
1711         b->yy_is_interactive = 0;
1712         b->yy_at_bol = 1;
1713         b->yy_fill_buffer = 0;
1714         b->yy_buffer_status = YY_BUFFER_NEW;
1715
1716         yy_switch_to_buffer( b );
1717
1718         return b;
1719         }
1720 #endif
1721
1722
1723 #ifndef YY_NO_SCAN_STRING
1724 #ifdef YY_USE_PROTOS
1725 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1726 #else
1727 YY_BUFFER_STATE yy_scan_string( yy_str )
1728 yyconst char *yy_str;
1729 #endif
1730         {
1731         int len;
1732         for ( len = 0; yy_str[len]; ++len )
1733                 ;
1734
1735         return yy_scan_bytes( yy_str, len );
1736         }
1737 #endif
1738
1739
1740 #ifndef YY_NO_SCAN_BYTES
1741 #ifdef YY_USE_PROTOS
1742 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1743 #else
1744 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1745 yyconst char *bytes;
1746 int len;
1747 #endif
1748         {
1749         YY_BUFFER_STATE b;
1750         char *buf;
1751         yy_size_t n;
1752         int i;
1753
1754         /* Get memory for full buffer, including space for trailing EOB's. */
1755         n = len + 2;
1756         buf = (char *) yy_flex_alloc( n );
1757         if ( ! buf )
1758                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1759
1760         for ( i = 0; i < len; ++i )
1761                 buf[i] = bytes[i];
1762
1763         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1764
1765         b = yy_scan_buffer( buf, n );
1766         if ( ! b )
1767                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1768
1769         /* It's okay to grow etc. this buffer, and we should throw it
1770          * away when we're done.
1771          */
1772         b->yy_is_our_buffer = 1;
1773
1774         return b;
1775         }
1776 #endif
1777
1778
1779 #ifndef YY_NO_PUSH_STATE
1780 #ifdef YY_USE_PROTOS
1781 static void yy_push_state( int new_state )
1782 #else
1783 static void yy_push_state( new_state )
1784 int new_state;
1785 #endif
1786         {
1787         if ( yy_start_stack_ptr >= yy_start_stack_depth )
1788                 {
1789                 yy_size_t new_size;
1790
1791                 yy_start_stack_depth += YY_START_STACK_INCR;
1792                 new_size = yy_start_stack_depth * sizeof( int );
1793
1794                 if ( ! yy_start_stack )
1795                         yy_start_stack = (int *) yy_flex_alloc( new_size );
1796
1797                 else
1798                         yy_start_stack = (int *) yy_flex_realloc(
1799                                         (void *) yy_start_stack, new_size );
1800
1801                 if ( ! yy_start_stack )
1802                         YY_FATAL_ERROR(
1803                         "out of memory expanding start-condition stack" );
1804                 }
1805
1806         yy_start_stack[yy_start_stack_ptr++] = YY_START;
1807
1808         BEGIN(new_state);
1809         }
1810 #endif
1811
1812
1813 #ifndef YY_NO_POP_STATE
1814 static void yy_pop_state()
1815         {
1816         if ( --yy_start_stack_ptr < 0 )
1817                 YY_FATAL_ERROR( "start-condition stack underflow" );
1818
1819         BEGIN(yy_start_stack[yy_start_stack_ptr]);
1820         }
1821 #endif
1822
1823
1824 #ifndef YY_NO_TOP_STATE
1825 static int yy_top_state()
1826         {
1827         return yy_start_stack[yy_start_stack_ptr - 1];
1828         }
1829 #endif
1830
1831 #ifndef YY_EXIT_FAILURE
1832 #define YY_EXIT_FAILURE 2
1833 #endif
1834
1835 #ifdef YY_USE_PROTOS
1836 static void yy_fatal_error( yyconst char msg[] )
1837 #else
1838 static void yy_fatal_error( msg )
1839 char msg[];
1840 #endif
1841         {
1842         (void) fprintf( stderr, "%s\n", msg );
1843         exit( YY_EXIT_FAILURE );
1844         }
1845
1846
1847
1848 /* Redefine yyless() so it works in section 3 code. */
1849
1850 #undef yyless
1851 #define yyless(n) \
1852         do \
1853                 { \
1854                 /* Undo effects of setting up yytext. */ \
1855                 yytext[yyleng] = yy_hold_char; \
1856                 yy_c_buf_p = yytext + n; \
1857                 yy_hold_char = *yy_c_buf_p; \
1858                 *yy_c_buf_p = '\0'; \
1859                 yyleng = n; \
1860                 } \
1861         while ( 0 )
1862
1863
1864 /* Internal utility routines. */
1865
1866 #ifndef yytext_ptr
1867 #ifdef YY_USE_PROTOS
1868 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1869 #else
1870 static void yy_flex_strncpy( s1, s2, n )
1871 char *s1;
1872 yyconst char *s2;
1873 int n;
1874 #endif
1875         {
1876         register int i;
1877         for ( i = 0; i < n; ++i )
1878                 s1[i] = s2[i];
1879         }
1880 #endif
1881
1882 #ifdef YY_NEED_STRLEN
1883 #ifdef YY_USE_PROTOS
1884 static int yy_flex_strlen( yyconst char *s )
1885 #else
1886 static int yy_flex_strlen( s )
1887 yyconst char *s;
1888 #endif
1889         {
1890         register int n;
1891         for ( n = 0; s[n]; ++n )
1892                 ;
1893
1894         return n;
1895         }
1896 #endif
1897
1898
1899 #ifdef YY_USE_PROTOS
1900 static void *yy_flex_alloc( yy_size_t size )
1901 #else
1902 static void *yy_flex_alloc( size )
1903 yy_size_t size;
1904 #endif
1905         {
1906         return (void *) malloc( size );
1907         }
1908
1909 #ifdef YY_USE_PROTOS
1910 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1911 #else
1912 static void *yy_flex_realloc( ptr, size )
1913 void *ptr;
1914 yy_size_t size;
1915 #endif
1916         {
1917         /* The cast to (char *) in the following accommodates both
1918          * implementations that use char* generic pointers, and those
1919          * that use void* generic pointers.  It works with the latter
1920          * because both ANSI C and C++ allow castless assignment from
1921          * any pointer type to void*, and deal with argument conversions
1922          * as though doing an assignment.
1923          */
1924         return (void *) realloc( (char *) ptr, size );
1925         }
1926
1927 #ifdef YY_USE_PROTOS
1928 static void yy_flex_free( void *ptr )
1929 #else
1930 static void yy_flex_free( ptr )
1931 void *ptr;
1932 #endif
1933         {
1934         free( ptr );
1935         }
1936
1937 #if YY_MAIN
1938 int main()
1939         {
1940         yylex();
1941         return 0;
1942         }
1943 #endif
1944 #line 307 "meta_lex_ind.l"
1945
1946
1947  /***************************************************************/
1948  /* 6. Auxiliary functions.                                     */
1949  /***************************************************************/
1950
1951 main(int argc, char *argv[])
1952 {
1953                    filename = malloc((sizeof('a')*2000));
1954                    file_uri = malloc((sizeof('a')*2000));
1955                    inductive_uri = malloc((sizeof('a')*2000));
1956                    filename_prefix=argv[1];
1957                    file_uri_prefix=argv[2];
1958                    /* fprintf(stderr,"qua"); */
1959                    yyin = fopen("tmp/inductive_type.xml", "r");
1960                    yylex();
1961 }
1962
1963 print_file()
1964 {                  
1965                    FILE *out, *outrel, *outsort;
1966
1967                    if (!(out = fopen(filename,"w"))) 
1968                      {
1969                       fprintf(stderr, "error in openinf file %s\n", filename);
1970                       exit(-1);
1971                      } 
1972                    if (!(outrel = fopen("forward_rel.xml","a"))) 
1973                      {
1974                       fprintf(stderr, "error in opening file forward_rel.xml\n");
1975                       exit(-1);
1976                      }
1977                    if (!(outsort = fopen("forward_sort.xml","a"))) 
1978                      {
1979                       fprintf(stderr, "error in opening file forward_sort.xml\n");
1980                       exit(-1);
1981                      }
1982                  
1983                    // We process the type
1984
1985                    fprintf(out,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
1986 fprintf(out,"<!DOCTYPE rdf:RDF [
1987         <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
1988         <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
1989         <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
1990
1991    ]>\n");
1992                    fprintf(out,"<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"&rdfns;\" xmlns:h=\"&hns;\" xmlns:hth=\"&hthns;\">\n");
1993                    fprintf(out,"\t<h:Object rdf:about=\"");
1994                    fprintf(out,"%s",file_uri);
1995                    fprintf(out,"\">\n");
1996                    print_all(file_uri,out,outrel,outsort);
1997                    fprintf(out,"\t</h:Object>\n");
1998                    fprintf(out,"</rdf:RDF>\n");
1999                    fclose(out);
2000                    fclose(outrel);
2001                    fclose(outsort);
2002 }
2003
2004 search(uri,first_child,position,depth)
2005 char               *uri;
2006 int                first_child;
2007 int                position; 
2008 {                  
2009                    if (position == MAINHYP)
2010                       { 
2011                        if (first_child == HERE) 
2012                            found = search_bucket(uri,MAINHYP,depth);
2013                        else 
2014                            found = search_bucket(uri,INHYP,0);
2015                       }
2016                    else if (position == INCONCL)
2017                       { 
2018                        if (first_child == HERE) 
2019                            found = search_bucket(uri,MAINCONCL,depth);
2020                        else
2021                            found = search_bucket(uri,INCONCL,0);
2022                       }
2023                         
2024                    else 
2025                       found = search_bucket(uri,position,depth);
2026                    /* if (found == NOTFOUND)
2027                          printf( "pos = %d, uri = %s\n", position, uri); */
2028 }
2029
2030
2031 int yywrap() {
2032                return 1;
2033              }
2034
2035
2036
2037