]> matita.cs.unibo.it Git - helm.git/blob - helm/metadata/create_V7_mowgli/METADATA/lex.yy_ind.c
*.rdf ==> *.xml
[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                        (first_child == HERE))
936                      {
937                        tmp=(char *)malloc((sizeof('a')*200)); 
938                        strcpy(tmp,yytext);
939                        strsep(&tmp,&sep); 
940                        if (position == INTYPE) /* SORT on the spine */
941                          { 
942                            position = INCONCL;
943                            search(tmp,first_child,position,spine_depth);
944                          }
945                        else search(tmp,first_child,position,depth);
946                        first_child = AFTER;
947                      }
948                    }
949         YY_BREAK
950 case 16:
951 YY_RULE_SETUP
952 #line 227 "meta_lex_ind.l"
953 {
954                      skip = 1;
955                      first_child = AFTER;
956                    }
957         YY_BREAK
958 case 17:
959 YY_RULE_SETUP
960 #line 232 "meta_lex_ind.l"
961
962                      if (position == INTYPE) /* CONST on the spine */
963                         position = INCONCL;
964                      where = CONST;
965                    }
966         YY_BREAK
967 case 18:
968 YY_RULE_SETUP
969 #line 238 "meta_lex_ind.l"
970
971                      if (position == INTYPE) /* MUTIND on the spine */
972                         position = INCONCL;
973                      where = MUTIND;
974                    }
975         YY_BREAK
976 case 19:
977 YY_RULE_SETUP
978 #line 244 "meta_lex_ind.l"
979
980                      if (position == INTYPE) /* MUTCONSTRUCT on the spine */
981                         position = INCONCL;
982                      where = MUTCONSTRUCT;
983                    }
984         YY_BREAK
985 case 20:
986 YY_RULE_SETUP
987 #line 250 "meta_lex_ind.l"
988 {     
989                          if (!skip) {
990                             uri=(char *)malloc((sizeof('a')*200)); 
991                             strcpy(uri,yytext);
992                             strsep(&uri,&sep);
993                             if (where == CONST)
994                               {
995                                 if (position == INCONCL)
996                                   search(uri,first_child,position,spine_depth);
997                                 else search(uri,first_child,position,depth);
998                                 where = NOWHERE;
999                                 first_child = AFTER;
1000                                 free(uri); 
1001                               };
1002                          } else skip = 0;
1003                    } 
1004         YY_BREAK
1005 case 21:
1006 YY_RULE_SETUP
1007 #line 267 "meta_lex_ind.l"
1008 {
1009                          if ((where == MUTIND) || (where == MUTCONSTRUCT))
1010                           { strsep(&yytext,&sep);
1011                             tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1012                             strcpy(tmp,yytext);
1013                             tmp_n = atoi(tmp)+1;
1014                             sprintf(tmp,"%d",tmp_n);
1015                             strcat(uri,"#xpointer(1/"); 
1016                             strcat(uri,tmp); 
1017                           };
1018                          if (where == MUTIND) 
1019                              { 
1020                                strcat(uri,")");
1021                                if (position == INCONCL)
1022                                   search(uri,first_child,position,spine_depth);
1023                                else search(uri,first_child,position,depth);
1024                                free(uri);
1025                                free(tmp);
1026                                where = NOWHERE; 
1027                                first_child = AFTER;};
1028                    } 
1029         YY_BREAK
1030 case 22:
1031 YY_RULE_SETUP
1032 #line 289 "meta_lex_ind.l"
1033 {
1034                          if (where == MUTCONSTRUCT)
1035                           { strsep(&yytext,&sep);
1036                             tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1037                             strcpy(tmp,yytext);
1038                             strcat(uri,"/");
1039                             strcat(uri,tmp);
1040                             strcat(uri,")");
1041                             if (position == INCONCL)
1042                               search(uri,first_child,position,spine_depth);
1043                             else search(uri,first_child,position,depth);
1044                             free(uri);
1045                             free(tmp);
1046                             where = NOWHERE; 
1047                             first_child = AFTER;};
1048                    } 
1049         YY_BREAK
1050 case 23:
1051 YY_RULE_SETUP
1052 #line 308 "meta_lex_ind.l"
1053 ECHO;
1054         YY_BREAK
1055 #line 1056 "lex.yy_ind.c"
1056 case YY_STATE_EOF(INITIAL):
1057         yyterminate();
1058
1059         case YY_END_OF_BUFFER:
1060                 {
1061                 /* Amount of text matched not including the EOB char. */
1062                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1063
1064                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1065                 *yy_cp = yy_hold_char;
1066                 YY_RESTORE_YY_MORE_OFFSET
1067
1068                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1069                         {
1070                         /* We're scanning a new file or input source.  It's
1071                          * possible that this happened because the user
1072                          * just pointed yyin at a new source and called
1073                          * yylex().  If so, then we have to assure
1074                          * consistency between yy_current_buffer and our
1075                          * globals.  Here is the right place to do so, because
1076                          * this is the first action (other than possibly a
1077                          * back-up) that will match for the new input source.
1078                          */
1079                         yy_n_chars = yy_current_buffer->yy_n_chars;
1080                         yy_current_buffer->yy_input_file = yyin;
1081                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1082                         }
1083
1084                 /* Note that here we test for yy_c_buf_p "<=" to the position
1085                  * of the first EOB in the buffer, since yy_c_buf_p will
1086                  * already have been incremented past the NUL character
1087                  * (since all states make transitions on EOB to the
1088                  * end-of-buffer state).  Contrast this with the test
1089                  * in input().
1090                  */
1091                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1092                         { /* This was really a NUL. */
1093                         yy_state_type yy_next_state;
1094
1095                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1096
1097                         yy_current_state = yy_get_previous_state();
1098
1099                         /* Okay, we're now positioned to make the NUL
1100                          * transition.  We couldn't have
1101                          * yy_get_previous_state() go ahead and do it
1102                          * for us because it doesn't know how to deal
1103                          * with the possibility of jamming (and we don't
1104                          * want to build jamming into it because then it
1105                          * will run more slowly).
1106                          */
1107
1108                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1109
1110                         yy_bp = yytext_ptr + YY_MORE_ADJ;
1111
1112                         if ( yy_next_state )
1113                                 {
1114                                 /* Consume the NUL. */
1115                                 yy_cp = ++yy_c_buf_p;
1116                                 yy_current_state = yy_next_state;
1117                                 goto yy_match;
1118                                 }
1119
1120                         else
1121                                 {
1122                                 yy_cp = yy_c_buf_p;
1123                                 goto yy_find_action;
1124                                 }
1125                         }
1126
1127                 else switch ( yy_get_next_buffer() )
1128                         {
1129                         case EOB_ACT_END_OF_FILE:
1130                                 {
1131                                 yy_did_buffer_switch_on_eof = 0;
1132
1133                                 if ( yywrap() )
1134                                         {
1135                                         /* Note: because we've taken care in
1136                                          * yy_get_next_buffer() to have set up
1137                                          * yytext, we can now set up
1138                                          * yy_c_buf_p so that if some total
1139                                          * hoser (like flex itself) wants to
1140                                          * call the scanner after we return the
1141                                          * YY_NULL, it'll still work - another
1142                                          * YY_NULL will get returned.
1143                                          */
1144                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1145
1146                                         yy_act = YY_STATE_EOF(YY_START);
1147                                         goto do_action;
1148                                         }
1149
1150                                 else
1151                                         {
1152                                         if ( ! yy_did_buffer_switch_on_eof )
1153                                                 YY_NEW_FILE;
1154                                         }
1155                                 break;
1156                                 }
1157
1158                         case EOB_ACT_CONTINUE_SCAN:
1159                                 yy_c_buf_p =
1160                                         yytext_ptr + yy_amount_of_matched_text;
1161
1162                                 yy_current_state = yy_get_previous_state();
1163
1164                                 yy_cp = yy_c_buf_p;
1165                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1166                                 goto yy_match;
1167
1168                         case EOB_ACT_LAST_MATCH:
1169                                 yy_c_buf_p =
1170                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1171
1172                                 yy_current_state = yy_get_previous_state();
1173
1174                                 yy_cp = yy_c_buf_p;
1175                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1176                                 goto yy_find_action;
1177                         }
1178                 break;
1179                 }
1180
1181         default:
1182                 YY_FATAL_ERROR(
1183                         "fatal flex scanner internal error--no action found" );
1184         } /* end of action switch */
1185                 } /* end of scanning one token */
1186         } /* end of yylex */
1187
1188
1189 /* yy_get_next_buffer - try to read in a new buffer
1190  *
1191  * Returns a code representing an action:
1192  *      EOB_ACT_LAST_MATCH -
1193  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1194  *      EOB_ACT_END_OF_FILE - end of file
1195  */
1196
1197 static int yy_get_next_buffer()
1198         {
1199         register char *dest = yy_current_buffer->yy_ch_buf;
1200         register char *source = yytext_ptr;
1201         register int number_to_move, i;
1202         int ret_val;
1203
1204         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1205                 YY_FATAL_ERROR(
1206                 "fatal flex scanner internal error--end of buffer missed" );
1207
1208         if ( yy_current_buffer->yy_fill_buffer == 0 )
1209                 { /* Don't try to fill the buffer, so this is an EOF. */
1210                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1211                         {
1212                         /* We matched a single character, the EOB, so
1213                          * treat this as a final EOF.
1214                          */
1215                         return EOB_ACT_END_OF_FILE;
1216                         }
1217
1218                 else
1219                         {
1220                         /* We matched some text prior to the EOB, first
1221                          * process it.
1222                          */
1223                         return EOB_ACT_LAST_MATCH;
1224                         }
1225                 }
1226
1227         /* Try to read more data. */
1228
1229         /* First move last chars to start of buffer. */
1230         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1231
1232         for ( i = 0; i < number_to_move; ++i )
1233                 *(dest++) = *(source++);
1234
1235         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1236                 /* don't do the read, it's not guaranteed to return an EOF,
1237                  * just force an EOF
1238                  */
1239                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1240
1241         else
1242                 {
1243                 int num_to_read =
1244                         yy_current_buffer->yy_buf_size - number_to_move - 1;
1245
1246                 while ( num_to_read <= 0 )
1247                         { /* Not enough room in the buffer - grow it. */
1248 #ifdef YY_USES_REJECT
1249                         YY_FATAL_ERROR(
1250 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1251 #else
1252
1253                         /* just a shorter name for the current buffer */
1254                         YY_BUFFER_STATE b = yy_current_buffer;
1255
1256                         int yy_c_buf_p_offset =
1257                                 (int) (yy_c_buf_p - b->yy_ch_buf);
1258
1259                         if ( b->yy_is_our_buffer )
1260                                 {
1261                                 int new_size = b->yy_buf_size * 2;
1262
1263                                 if ( new_size <= 0 )
1264                                         b->yy_buf_size += b->yy_buf_size / 8;
1265                                 else
1266                                         b->yy_buf_size *= 2;
1267
1268                                 b->yy_ch_buf = (char *)
1269                                         /* Include room in for 2 EOB chars. */
1270                                         yy_flex_realloc( (void *) b->yy_ch_buf,
1271                                                          b->yy_buf_size + 2 );
1272                                 }
1273                         else
1274                                 /* Can't grow it, we don't own it. */
1275                                 b->yy_ch_buf = 0;
1276
1277                         if ( ! b->yy_ch_buf )
1278                                 YY_FATAL_ERROR(
1279                                 "fatal error - scanner input buffer overflow" );
1280
1281                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1282
1283                         num_to_read = yy_current_buffer->yy_buf_size -
1284                                                 number_to_move - 1;
1285 #endif
1286                         }
1287
1288                 if ( num_to_read > YY_READ_BUF_SIZE )
1289                         num_to_read = YY_READ_BUF_SIZE;
1290
1291                 /* Read in more data. */
1292                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1293                         yy_n_chars, num_to_read );
1294
1295                 yy_current_buffer->yy_n_chars = yy_n_chars;
1296                 }
1297
1298         if ( yy_n_chars == 0 )
1299                 {
1300                 if ( number_to_move == YY_MORE_ADJ )
1301                         {
1302                         ret_val = EOB_ACT_END_OF_FILE;
1303                         yyrestart( yyin );
1304                         }
1305
1306                 else
1307                         {
1308                         ret_val = EOB_ACT_LAST_MATCH;
1309                         yy_current_buffer->yy_buffer_status =
1310                                 YY_BUFFER_EOF_PENDING;
1311                         }
1312                 }
1313
1314         else
1315                 ret_val = EOB_ACT_CONTINUE_SCAN;
1316
1317         yy_n_chars += number_to_move;
1318         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1319         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1320
1321         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1322
1323         return ret_val;
1324         }
1325
1326
1327 /* yy_get_previous_state - get the state just before the EOB char was reached */
1328
1329 static yy_state_type yy_get_previous_state()
1330         {
1331         register yy_state_type yy_current_state;
1332         register char *yy_cp;
1333
1334         yy_current_state = yy_start;
1335
1336         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1337                 {
1338                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1339                 if ( yy_accept[yy_current_state] )
1340                         {
1341                         yy_last_accepting_state = yy_current_state;
1342                         yy_last_accepting_cpos = yy_cp;
1343                         }
1344                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1345                         {
1346                         yy_current_state = (int) yy_def[yy_current_state];
1347                         if ( yy_current_state >= 138 )
1348                                 yy_c = yy_meta[(unsigned int) yy_c];
1349                         }
1350                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1351                 }
1352
1353         return yy_current_state;
1354         }
1355
1356
1357 /* yy_try_NUL_trans - try to make a transition on the NUL character
1358  *
1359  * synopsis
1360  *      next_state = yy_try_NUL_trans( current_state );
1361  */
1362
1363 #ifdef YY_USE_PROTOS
1364 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1365 #else
1366 static yy_state_type yy_try_NUL_trans( yy_current_state )
1367 yy_state_type yy_current_state;
1368 #endif
1369         {
1370         register int yy_is_jam;
1371         register char *yy_cp = yy_c_buf_p;
1372
1373         register YY_CHAR yy_c = 1;
1374         if ( yy_accept[yy_current_state] )
1375                 {
1376                 yy_last_accepting_state = yy_current_state;
1377                 yy_last_accepting_cpos = yy_cp;
1378                 }
1379         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1380                 {
1381                 yy_current_state = (int) yy_def[yy_current_state];
1382                 if ( yy_current_state >= 138 )
1383                         yy_c = yy_meta[(unsigned int) yy_c];
1384                 }
1385         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1386         yy_is_jam = (yy_current_state == 137);
1387
1388         return yy_is_jam ? 0 : yy_current_state;
1389         }
1390
1391
1392 #ifndef YY_NO_UNPUT
1393 #ifdef YY_USE_PROTOS
1394 static void yyunput( int c, register char *yy_bp )
1395 #else
1396 static void yyunput( c, yy_bp )
1397 int c;
1398 register char *yy_bp;
1399 #endif
1400         {
1401         register char *yy_cp = yy_c_buf_p;
1402
1403         /* undo effects of setting up yytext */
1404         *yy_cp = yy_hold_char;
1405
1406         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1407                 { /* need to shift things up to make room */
1408                 /* +2 for EOB chars. */
1409                 register int number_to_move = yy_n_chars + 2;
1410                 register char *dest = &yy_current_buffer->yy_ch_buf[
1411                                         yy_current_buffer->yy_buf_size + 2];
1412                 register char *source =
1413                                 &yy_current_buffer->yy_ch_buf[number_to_move];
1414
1415                 while ( source > yy_current_buffer->yy_ch_buf )
1416                         *--dest = *--source;
1417
1418                 yy_cp += (int) (dest - source);
1419                 yy_bp += (int) (dest - source);
1420                 yy_current_buffer->yy_n_chars =
1421                         yy_n_chars = yy_current_buffer->yy_buf_size;
1422
1423                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1424                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1425                 }
1426
1427         *--yy_cp = (char) c;
1428
1429
1430         yytext_ptr = yy_bp;
1431         yy_hold_char = *yy_cp;
1432         yy_c_buf_p = yy_cp;
1433         }
1434 #endif  /* ifndef YY_NO_UNPUT */
1435
1436
1437 #ifdef __cplusplus
1438 static int yyinput()
1439 #else
1440 static int input()
1441 #endif
1442         {
1443         int c;
1444
1445         *yy_c_buf_p = yy_hold_char;
1446
1447         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1448                 {
1449                 /* yy_c_buf_p now points to the character we want to return.
1450                  * If this occurs *before* the EOB characters, then it's a
1451                  * valid NUL; if not, then we've hit the end of the buffer.
1452                  */
1453                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1454                         /* This was really a NUL. */
1455                         *yy_c_buf_p = '\0';
1456
1457                 else
1458                         { /* need more input */
1459                         int offset = yy_c_buf_p - yytext_ptr;
1460                         ++yy_c_buf_p;
1461
1462                         switch ( yy_get_next_buffer() )
1463                                 {
1464                                 case EOB_ACT_LAST_MATCH:
1465                                         /* This happens because yy_g_n_b()
1466                                          * sees that we've accumulated a
1467                                          * token and flags that we need to
1468                                          * try matching the token before
1469                                          * proceeding.  But for input(),
1470                                          * there's no matching to consider.
1471                                          * So convert the EOB_ACT_LAST_MATCH
1472                                          * to EOB_ACT_END_OF_FILE.
1473                                          */
1474
1475                                         /* Reset buffer status. */
1476                                         yyrestart( yyin );
1477
1478                                         /* fall through */
1479
1480                                 case EOB_ACT_END_OF_FILE:
1481                                         {
1482                                         if ( yywrap() )
1483                                                 return EOF;
1484
1485                                         if ( ! yy_did_buffer_switch_on_eof )
1486                                                 YY_NEW_FILE;
1487 #ifdef __cplusplus
1488                                         return yyinput();
1489 #else
1490                                         return input();
1491 #endif
1492                                         }
1493
1494                                 case EOB_ACT_CONTINUE_SCAN:
1495                                         yy_c_buf_p = yytext_ptr + offset;
1496                                         break;
1497                                 }
1498                         }
1499                 }
1500
1501         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
1502         *yy_c_buf_p = '\0';     /* preserve yytext */
1503         yy_hold_char = *++yy_c_buf_p;
1504
1505
1506         return c;
1507         }
1508
1509
1510 #ifdef YY_USE_PROTOS
1511 void yyrestart( FILE *input_file )
1512 #else
1513 void yyrestart( input_file )
1514 FILE *input_file;
1515 #endif
1516         {
1517         if ( ! yy_current_buffer )
1518                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1519
1520         yy_init_buffer( yy_current_buffer, input_file );
1521         yy_load_buffer_state();
1522         }
1523
1524
1525 #ifdef YY_USE_PROTOS
1526 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1527 #else
1528 void yy_switch_to_buffer( new_buffer )
1529 YY_BUFFER_STATE new_buffer;
1530 #endif
1531         {
1532         if ( yy_current_buffer == new_buffer )
1533                 return;
1534
1535         if ( yy_current_buffer )
1536                 {
1537                 /* Flush out information for old buffer. */
1538                 *yy_c_buf_p = yy_hold_char;
1539                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1540                 yy_current_buffer->yy_n_chars = yy_n_chars;
1541                 }
1542
1543         yy_current_buffer = new_buffer;
1544         yy_load_buffer_state();
1545
1546         /* We don't actually know whether we did this switch during
1547          * EOF (yywrap()) processing, but the only time this flag
1548          * is looked at is after yywrap() is called, so it's safe
1549          * to go ahead and always set it.
1550          */
1551         yy_did_buffer_switch_on_eof = 1;
1552         }
1553
1554
1555 #ifdef YY_USE_PROTOS
1556 void yy_load_buffer_state( void )
1557 #else
1558 void yy_load_buffer_state()
1559 #endif
1560         {
1561         yy_n_chars = yy_current_buffer->yy_n_chars;
1562         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1563         yyin = yy_current_buffer->yy_input_file;
1564         yy_hold_char = *yy_c_buf_p;
1565         }
1566
1567
1568 #ifdef YY_USE_PROTOS
1569 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1570 #else
1571 YY_BUFFER_STATE yy_create_buffer( file, size )
1572 FILE *file;
1573 int size;
1574 #endif
1575         {
1576         YY_BUFFER_STATE b;
1577
1578         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1579         if ( ! b )
1580                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1581
1582         b->yy_buf_size = size;
1583
1584         /* yy_ch_buf has to be 2 characters longer than the size given because
1585          * we need to put in 2 end-of-buffer characters.
1586          */
1587         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1588         if ( ! b->yy_ch_buf )
1589                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1590
1591         b->yy_is_our_buffer = 1;
1592
1593         yy_init_buffer( b, file );
1594
1595         return b;
1596         }
1597
1598
1599 #ifdef YY_USE_PROTOS
1600 void yy_delete_buffer( YY_BUFFER_STATE b )
1601 #else
1602 void yy_delete_buffer( b )
1603 YY_BUFFER_STATE b;
1604 #endif
1605         {
1606         if ( ! b )
1607                 return;
1608
1609         if ( b == yy_current_buffer )
1610                 yy_current_buffer = (YY_BUFFER_STATE) 0;
1611
1612         if ( b->yy_is_our_buffer )
1613                 yy_flex_free( (void *) b->yy_ch_buf );
1614
1615         yy_flex_free( (void *) b );
1616         }
1617
1618
1619 #ifndef _WIN32
1620 #include <unistd.h>
1621 #else
1622 #ifndef YY_ALWAYS_INTERACTIVE
1623 #ifndef YY_NEVER_INTERACTIVE
1624 extern int isatty YY_PROTO(( int ));
1625 #endif
1626 #endif
1627 #endif
1628
1629 #ifdef YY_USE_PROTOS
1630 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1631 #else
1632 void yy_init_buffer( b, file )
1633 YY_BUFFER_STATE b;
1634 FILE *file;
1635 #endif
1636
1637
1638         {
1639         yy_flush_buffer( b );
1640
1641         b->yy_input_file = file;
1642         b->yy_fill_buffer = 1;
1643
1644 #if YY_ALWAYS_INTERACTIVE
1645         b->yy_is_interactive = 1;
1646 #else
1647 #if YY_NEVER_INTERACTIVE
1648         b->yy_is_interactive = 0;
1649 #else
1650         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1651 #endif
1652 #endif
1653         }
1654
1655
1656 #ifdef YY_USE_PROTOS
1657 void yy_flush_buffer( YY_BUFFER_STATE b )
1658 #else
1659 void yy_flush_buffer( b )
1660 YY_BUFFER_STATE b;
1661 #endif
1662
1663         {
1664         if ( ! b )
1665                 return;
1666
1667         b->yy_n_chars = 0;
1668
1669         /* We always need two end-of-buffer characters.  The first causes
1670          * a transition to the end-of-buffer state.  The second causes
1671          * a jam in that state.
1672          */
1673         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1674         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1675
1676         b->yy_buf_pos = &b->yy_ch_buf[0];
1677
1678         b->yy_at_bol = 1;
1679         b->yy_buffer_status = YY_BUFFER_NEW;
1680
1681         if ( b == yy_current_buffer )
1682                 yy_load_buffer_state();
1683         }
1684
1685
1686 #ifndef YY_NO_SCAN_BUFFER
1687 #ifdef YY_USE_PROTOS
1688 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1689 #else
1690 YY_BUFFER_STATE yy_scan_buffer( base, size )
1691 char *base;
1692 yy_size_t size;
1693 #endif
1694         {
1695         YY_BUFFER_STATE b;
1696
1697         if ( size < 2 ||
1698              base[size-2] != YY_END_OF_BUFFER_CHAR ||
1699              base[size-1] != YY_END_OF_BUFFER_CHAR )
1700                 /* They forgot to leave room for the EOB's. */
1701                 return 0;
1702
1703         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1704         if ( ! b )
1705                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1706
1707         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1708         b->yy_buf_pos = b->yy_ch_buf = base;
1709         b->yy_is_our_buffer = 0;
1710         b->yy_input_file = 0;
1711         b->yy_n_chars = b->yy_buf_size;
1712         b->yy_is_interactive = 0;
1713         b->yy_at_bol = 1;
1714         b->yy_fill_buffer = 0;
1715         b->yy_buffer_status = YY_BUFFER_NEW;
1716
1717         yy_switch_to_buffer( b );
1718
1719         return b;
1720         }
1721 #endif
1722
1723
1724 #ifndef YY_NO_SCAN_STRING
1725 #ifdef YY_USE_PROTOS
1726 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1727 #else
1728 YY_BUFFER_STATE yy_scan_string( yy_str )
1729 yyconst char *yy_str;
1730 #endif
1731         {
1732         int len;
1733         for ( len = 0; yy_str[len]; ++len )
1734                 ;
1735
1736         return yy_scan_bytes( yy_str, len );
1737         }
1738 #endif
1739
1740
1741 #ifndef YY_NO_SCAN_BYTES
1742 #ifdef YY_USE_PROTOS
1743 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1744 #else
1745 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1746 yyconst char *bytes;
1747 int len;
1748 #endif
1749         {
1750         YY_BUFFER_STATE b;
1751         char *buf;
1752         yy_size_t n;
1753         int i;
1754
1755         /* Get memory for full buffer, including space for trailing EOB's. */
1756         n = len + 2;
1757         buf = (char *) yy_flex_alloc( n );
1758         if ( ! buf )
1759                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1760
1761         for ( i = 0; i < len; ++i )
1762                 buf[i] = bytes[i];
1763
1764         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1765
1766         b = yy_scan_buffer( buf, n );
1767         if ( ! b )
1768                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1769
1770         /* It's okay to grow etc. this buffer, and we should throw it
1771          * away when we're done.
1772          */
1773         b->yy_is_our_buffer = 1;
1774
1775         return b;
1776         }
1777 #endif
1778
1779
1780 #ifndef YY_NO_PUSH_STATE
1781 #ifdef YY_USE_PROTOS
1782 static void yy_push_state( int new_state )
1783 #else
1784 static void yy_push_state( new_state )
1785 int new_state;
1786 #endif
1787         {
1788         if ( yy_start_stack_ptr >= yy_start_stack_depth )
1789                 {
1790                 yy_size_t new_size;
1791
1792                 yy_start_stack_depth += YY_START_STACK_INCR;
1793                 new_size = yy_start_stack_depth * sizeof( int );
1794
1795                 if ( ! yy_start_stack )
1796                         yy_start_stack = (int *) yy_flex_alloc( new_size );
1797
1798                 else
1799                         yy_start_stack = (int *) yy_flex_realloc(
1800                                         (void *) yy_start_stack, new_size );
1801
1802                 if ( ! yy_start_stack )
1803                         YY_FATAL_ERROR(
1804                         "out of memory expanding start-condition stack" );
1805                 }
1806
1807         yy_start_stack[yy_start_stack_ptr++] = YY_START;
1808
1809         BEGIN(new_state);
1810         }
1811 #endif
1812
1813
1814 #ifndef YY_NO_POP_STATE
1815 static void yy_pop_state()
1816         {
1817         if ( --yy_start_stack_ptr < 0 )
1818                 YY_FATAL_ERROR( "start-condition stack underflow" );
1819
1820         BEGIN(yy_start_stack[yy_start_stack_ptr]);
1821         }
1822 #endif
1823
1824
1825 #ifndef YY_NO_TOP_STATE
1826 static int yy_top_state()
1827         {
1828         return yy_start_stack[yy_start_stack_ptr - 1];
1829         }
1830 #endif
1831
1832 #ifndef YY_EXIT_FAILURE
1833 #define YY_EXIT_FAILURE 2
1834 #endif
1835
1836 #ifdef YY_USE_PROTOS
1837 static void yy_fatal_error( yyconst char msg[] )
1838 #else
1839 static void yy_fatal_error( msg )
1840 char msg[];
1841 #endif
1842         {
1843         (void) fprintf( stderr, "%s\n", msg );
1844         exit( YY_EXIT_FAILURE );
1845         }
1846
1847
1848
1849 /* Redefine yyless() so it works in section 3 code. */
1850
1851 #undef yyless
1852 #define yyless(n) \
1853         do \
1854                 { \
1855                 /* Undo effects of setting up yytext. */ \
1856                 yytext[yyleng] = yy_hold_char; \
1857                 yy_c_buf_p = yytext + n; \
1858                 yy_hold_char = *yy_c_buf_p; \
1859                 *yy_c_buf_p = '\0'; \
1860                 yyleng = n; \
1861                 } \
1862         while ( 0 )
1863
1864
1865 /* Internal utility routines. */
1866
1867 #ifndef yytext_ptr
1868 #ifdef YY_USE_PROTOS
1869 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1870 #else
1871 static void yy_flex_strncpy( s1, s2, n )
1872 char *s1;
1873 yyconst char *s2;
1874 int n;
1875 #endif
1876         {
1877         register int i;
1878         for ( i = 0; i < n; ++i )
1879                 s1[i] = s2[i];
1880         }
1881 #endif
1882
1883 #ifdef YY_NEED_STRLEN
1884 #ifdef YY_USE_PROTOS
1885 static int yy_flex_strlen( yyconst char *s )
1886 #else
1887 static int yy_flex_strlen( s )
1888 yyconst char *s;
1889 #endif
1890         {
1891         register int n;
1892         for ( n = 0; s[n]; ++n )
1893                 ;
1894
1895         return n;
1896         }
1897 #endif
1898
1899
1900 #ifdef YY_USE_PROTOS
1901 static void *yy_flex_alloc( yy_size_t size )
1902 #else
1903 static void *yy_flex_alloc( size )
1904 yy_size_t size;
1905 #endif
1906         {
1907         return (void *) malloc( size );
1908         }
1909
1910 #ifdef YY_USE_PROTOS
1911 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1912 #else
1913 static void *yy_flex_realloc( ptr, size )
1914 void *ptr;
1915 yy_size_t size;
1916 #endif
1917         {
1918         /* The cast to (char *) in the following accommodates both
1919          * implementations that use char* generic pointers, and those
1920          * that use void* generic pointers.  It works with the latter
1921          * because both ANSI C and C++ allow castless assignment from
1922          * any pointer type to void*, and deal with argument conversions
1923          * as though doing an assignment.
1924          */
1925         return (void *) realloc( (char *) ptr, size );
1926         }
1927
1928 #ifdef YY_USE_PROTOS
1929 static void yy_flex_free( void *ptr )
1930 #else
1931 static void yy_flex_free( ptr )
1932 void *ptr;
1933 #endif
1934         {
1935         free( ptr );
1936         }
1937
1938 #if YY_MAIN
1939 int main()
1940         {
1941         yylex();
1942         return 0;
1943         }
1944 #endif
1945 #line 308 "meta_lex_ind.l"
1946
1947
1948  /***************************************************************/
1949  /* 6. Auxiliary functions.                                     */
1950  /***************************************************************/
1951
1952 main(int argc, char *argv[])
1953 {
1954                    filename = malloc((sizeof('a')*2000));
1955                    file_uri = malloc((sizeof('a')*2000));
1956                    inductive_uri = malloc((sizeof('a')*2000));
1957                    filename_prefix=argv[1];
1958                    file_uri_prefix=argv[2];
1959                    /* fprintf(stderr,"qua"); */
1960                    yyin = fopen("tmp/inductive_type.xml", "r");
1961                    yylex();
1962 }
1963
1964 print_file()
1965 {                  
1966                    FILE *out, *outrel, *outsort;
1967
1968                    if (!(out = fopen(filename,"w"))) 
1969                      {
1970                       fprintf(stderr, "error in openinf file %s\n", filename);
1971                       exit(-1);
1972                      } 
1973                    if (!(outrel = fopen("forward_rel.xml","a"))) 
1974                      {
1975                       fprintf(stderr, "error in openinf file forward_rel.xml\n");
1976                       exit(-1);
1977                      }
1978                    if (!(outsort = fopen("forward_sort.xml","a"))) 
1979                      {
1980                       fprintf(stderr, "error in openinf file forward_rel.xml\n");
1981                       exit(-1);
1982                      }
1983                  
1984                    // We process the type
1985
1986                    fprintf(out,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
1987 fprintf(out,"<!DOCTYPE rdf:RDF [
1988         <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
1989         <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
1990         <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
1991
1992    ]>\n");
1993                    fprintf(out,"<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"&rdfns;\" xmlns:h=\"&hns;\" xmlns:hth=\"&hthns;\">\n");
1994                    fprintf(out,"\t<h:Object rdf:about=\"");
1995                    fprintf(out,"%s",file_uri);
1996                    fprintf(out,"\">\n");
1997                    print_all(file_uri,out,outrel,outsort);
1998                    fprintf(out,"\t</h:Object>\n");
1999                    fprintf(out,"</rdf:RDF>\n");
2000                    fclose(out);
2001                    fclose(outrel);
2002                    fclose(outsort);
2003 }
2004
2005 search(uri,first_child,position,depth)
2006 char               *uri;
2007 int                first_child;
2008 int                position; 
2009 {                  
2010                    if (position == MAINHYP)
2011                       { 
2012                        if (first_child == HERE) 
2013                            found = search_bucket(uri,MAINHYP,depth);
2014                        else 
2015                            found = search_bucket(uri,INHYP,0);
2016                       }
2017                    else if (position == INCONCL)
2018                       { 
2019                        if (first_child == HERE) 
2020                            found = search_bucket(uri,MAINCONCL,depth);
2021                        else
2022                            found = search_bucket(uri,INCONCL,0);
2023                       }
2024                         
2025                    else 
2026                       found = search_bucket(uri,position,depth);
2027                    /* if (found == NOTFOUND)
2028                          printf( "pos = %d, uri = %s\n", position, uri); */
2029 }
2030
2031
2032 int yywrap() {
2033                return 1;
2034              }
2035
2036
2037
2038