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