2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
29 #ifndef YY_ALWAYS_INTERACTIVE
30 #ifndef YY_NEVER_INTERACTIVE
31 extern int isatty YY_PROTO(( int ));
36 /* Use prototypes in function declarations. */
39 /* The "const" storage-class-modifier is valid. */
42 #else /* ! __cplusplus */
50 #endif /* ! __cplusplus */
69 #define YY_PROTO(proto) proto
71 #define YY_PROTO(proto) ()
74 /* Returned upon end-of-file. */
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
82 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
88 #define BEGIN yy_start = 1 + 2 *
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
94 #define YY_START ((yy_start - 1) / 2)
95 #define YYSTATE YY_START
97 /* Action number for EOF rule of a given start state. */
98 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
100 /* Special action meaning "start processing a new file". */
101 #define YY_NEW_FILE yyrestart( yyin )
103 #define YY_END_OF_BUFFER_CHAR 0
105 /* Size of default input buffer. */
106 #define YY_BUF_SIZE 16384
108 typedef struct yy_buffer_state *YY_BUFFER_STATE;
111 extern FILE *yyin, *yyout;
113 #define EOB_ACT_CONTINUE_SCAN 0
114 #define EOB_ACT_END_OF_FILE 1
115 #define EOB_ACT_LAST_MATCH 2
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:
121 * if ( condition_holds )
124 * do_something_else();
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.
131 /* Return all but the first 'n' matched characters back to the input stream. */
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 */ \
144 #define unput(c) yyunput( c, yytext_ptr )
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).
150 typedef unsigned int yy_size_t;
153 struct yy_buffer_state
157 char *yy_ch_buf; /* input buffer */
158 char *yy_buf_pos; /* current position in input buffer */
160 /* Size of input buffer in bytes, not including room for EOB
163 yy_size_t yy_buf_size;
165 /* Number of characters read into yy_ch_buf, not including EOB
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
174 int yy_is_our_buffer;
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
181 int yy_is_interactive;
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
189 /* Whether to try to fill the input buffer when we reach the
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.
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.
207 #define YY_BUFFER_EOF_PENDING 2
210 static YY_BUFFER_STATE yy_current_buffer = 0;
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
216 #define YY_CURRENT_BUFFER yy_current_buffer
219 /* yy_hold_char holds the character lost when yytext is formed. */
220 static char yy_hold_char;
222 static int yy_n_chars; /* number of characters read into yy_ch_buf */
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 */
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 ...
235 static int yy_did_buffer_switch_on_eof;
237 void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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 ));
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 * ));
255 #define yy_new_buffer yy_create_buffer
257 #define yy_set_interactive(is_interactive) \
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; \
264 #define yy_set_bol(at_bol) \
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; \
271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
273 typedef unsigned char YY_CHAR;
274 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
275 typedef int yy_state_type;
277 #define yytext_ptr yytext
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[] ));
284 /* Done after the current pattern has been matched and before the
285 * corresponding action - sets up yytext.
287 #define YY_DO_BEFORE_ACTION \
288 yytext_ptr = yy_bp; \
289 yyleng = (int) (yy_cp - yy_bp); \
290 yy_hold_char = *yy_cp; \
294 #define YY_NUM_RULES 22
295 #define YY_END_OF_BUFFER 23
296 static yyconst short int yy_accept[125] =
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,
309 0, 0, 0, 20, 0, 0, 0, 0, 0, 0,
310 0, 0, 0, 21, 0, 3, 0, 0, 0, 0,
314 static yyconst int yy_ec[256] =
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,
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,
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,
346 static yyconst int yy_meta[42] =
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,
355 static yyconst short int yy_base[127] =
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,
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
373 static yyconst short int yy_def[127] =
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,
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
391 static yyconst short int yy_nxt[182] =
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,
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,
415 static yyconst short int yy_chk[182] =
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,
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,
439 static yy_state_type yy_last_accepting_state;
440 static char *yy_last_accepting_cpos;
442 /* The intent behind this definition is that it'll catch
443 * any uses of REJECT which flex missed.
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
450 #line 1 "meta_lex_ind.l"
452 /******************************************************************/
453 /* Copyright (C) 2000, HELM Team */
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. */
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. */
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. */
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. */
474 /* For details, see the HELM World-Wide-Web page, */
475 /* http://cs.unibo.it/helm/. */
476 /******************************************************************/
477 /***************************************************************/
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"
489 #include "sthandler_ind.h"
490 /***************************************************************/
491 /* 2. Constants and Variables Definitions */
492 /***************************************************************/
493 #line 49 "meta_lex_ind.l"
497 #define MUTCONSTRUCT 3
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;
518 int inductive_type =0;
522 char *xpointer = "#xpointer(1/";
528 char *filename_prefix;
529 char *file_uri_prefix;
532 /***************************************************************/
533 /* 3. Regular definitions. */
534 /***************************************************************/
535 /***************************************************************/
537 /***************************************************************/
548 <deeptype>"</type>" {
550 if (deeptype == 0) BEGIN(0);
556 #line 557 "lex.yy_ind.c"
558 /* Macros after this point can all be overridden by user definitions in
562 #ifndef YY_SKIP_YYWRAP
564 extern "C" int yywrap YY_PROTO(( void ));
566 extern int yywrap YY_PROTO(( void ));
571 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
575 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
578 #ifdef YY_NEED_STRLEN
579 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
584 static int yyinput YY_PROTO(( void ));
586 static int input YY_PROTO(( void ));
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 ));
597 #ifndef YY_NO_POP_STATE
598 static void yy_pop_state YY_PROTO(( void ));
600 #ifndef YY_NO_TOP_STATE
601 static int yy_top_state YY_PROTO(( void ));
605 #define YY_NO_PUSH_STATE 1
606 #define YY_NO_POP_STATE 1
607 #define YY_NO_TOP_STATE 1
610 #ifdef YY_MALLOC_DECL
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).
625 /* Amount of stuff to slurp up with each read. */
626 #ifndef YY_READ_BUF_SIZE
627 #define YY_READ_BUF_SIZE 8192
630 /* Copy whatever the last rule matched to the standard output. */
633 /* This used to be an fputs(), but since the string might contain NUL's,
634 * we now use fwrite().
636 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
639 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
640 * is returned in "result".
643 #define YY_INPUT(buf,result,max_size) \
644 if ( yy_current_buffer->yy_is_interactive ) \
647 for ( n = 0; n < max_size && \
648 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
651 buf[n++] = (char) c; \
652 if ( c == EOF && ferror( yyin ) ) \
653 YY_FATAL_ERROR( "input in flex scanner failed" ); \
659 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
661 if( errno != EINTR) \
663 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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.
677 #define yyterminate() return YY_NULL
680 /* Number of entries by which start-condition stack grows. */
681 #ifndef YY_START_STACK_INCR
682 #define YY_START_STACK_INCR 25
685 /* Report a fatal error. */
686 #ifndef YY_FATAL_ERROR
687 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
690 /* Default declaration of generated scanner - a define so the user can
691 * easily add parameters.
694 #define YY_DECL int yylex YY_PROTO(( void ))
697 /* Code executed at the beginning of each rule, after yytext and yyleng
700 #ifndef YY_USER_ACTION
701 #define YY_USER_ACTION
704 /* Code executed at the end of each rule. */
706 #define YY_BREAK break;
709 #define YY_RULE_SETUP \
714 register yy_state_type yy_current_state;
715 register char *yy_cp, *yy_bp;
718 #line 121 "meta_lex_ind.l"
721 #line 722 "lex.yy_ind.c"
732 yy_start = 1; /* first start state */
740 if ( ! yy_current_buffer )
742 yy_create_buffer( yyin, YY_BUF_SIZE );
744 yy_load_buffer_state();
747 while ( 1 ) /* loops until end-of-file is reached */
751 /* Support of yytext. */
752 *yy_cp = yy_hold_char;
754 /* yy_bp points to the position in yy_ch_buf of the start of
759 yy_current_state = yy_start;
763 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
764 if ( yy_accept[yy_current_state] )
766 yy_last_accepting_state = yy_current_state;
767 yy_last_accepting_cpos = yy_cp;
769 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
775 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
778 while ( yy_base[yy_current_state] != 140 );
781 yy_act = yy_accept[yy_current_state];
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];
792 do_action: /* This label is used only to access EOF actions. */
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;
806 #line 123 "meta_lex_ind.l"
808 fprintf(stderr,"uno");
810 fprintf(stderr,"due");
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");
836 #line 147 "meta_lex_ind.l"
837 { init_symbol_table();
839 strcpy(inductive_uri,file_uri_prefix);
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);
860 #line 167 "meta_lex_ind.l"
863 #line 167 "meta_lex_ind.l"
865 if ((position == INTYPE) ||
872 #line 175 "meta_lex_ind.l"
875 #line 175 "meta_lex_ind.l"
877 if (position == INHYP)
880 if (no_open_source == 0)
882 first_child = HERE; };
888 #line 185 "meta_lex_ind.l"
893 #line 189 "meta_lex_ind.l"
895 #line 190 "meta_lex_ind.l"
897 #line 191 "meta_lex_ind.l"
899 #line 192 "meta_lex_ind.l"
902 #line 192 "meta_lex_ind.l"
909 #line 196 "meta_lex_ind.l"
917 #line 201 "meta_lex_ind.l"
919 if (position == INTYPE) /* CONST on the spine */
926 #line 207 "meta_lex_ind.l"
928 if (position == INTYPE) /* MUTIND on the spine */
935 #line 213 "meta_lex_ind.l"
937 if (position == INTYPE) /* MUTCONSTRUCT on the spine */
939 where = MUTCONSTRUCT;
944 #line 219 "meta_lex_ind.l"
947 uri=(char *)malloc((sizeof('a')*200));
952 search(uri,first_child,position);
962 #line 234 "meta_lex_ind.l"
964 if ((where == MUTIND) || (where == MUTCONSTRUCT))
965 { strsep(&yytext,&sep);
966 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
969 sprintf(tmp,"%d",tmp_n);
970 strcat(uri,"#xpointer(1/");
976 search(uri,first_child,position);
980 first_child = AFTER;};
985 #line 254 "meta_lex_ind.l"
987 if (where == MUTCONSTRUCT)
988 { strsep(&yytext,&sep);
989 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
994 search(uri,first_child,position);
998 first_child = AFTER;};
1003 #line 270 "meta_lex_ind.l"
1006 #line 1007 "lex.yy_ind.c"
1007 case YY_STATE_EOF(INITIAL):
1010 case YY_END_OF_BUFFER:
1012 /* Amount of text matched not including the EOB char. */
1013 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1015 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1016 *yy_cp = yy_hold_char;
1017 YY_RESTORE_YY_MORE_OFFSET
1019 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
1046 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1048 yy_current_state = yy_get_previous_state();
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).
1059 yy_next_state = yy_try_NUL_trans( yy_current_state );
1061 yy_bp = yytext_ptr + YY_MORE_ADJ;
1063 if ( yy_next_state )
1065 /* Consume the NUL. */
1066 yy_cp = ++yy_c_buf_p;
1067 yy_current_state = yy_next_state;
1074 goto yy_find_action;
1078 else switch ( yy_get_next_buffer() )
1080 case EOB_ACT_END_OF_FILE:
1082 yy_did_buffer_switch_on_eof = 0;
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.
1095 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1097 yy_act = YY_STATE_EOF(YY_START);
1103 if ( ! yy_did_buffer_switch_on_eof )
1109 case EOB_ACT_CONTINUE_SCAN:
1111 yytext_ptr + yy_amount_of_matched_text;
1113 yy_current_state = yy_get_previous_state();
1116 yy_bp = yytext_ptr + YY_MORE_ADJ;
1119 case EOB_ACT_LAST_MATCH:
1121 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1123 yy_current_state = yy_get_previous_state();
1126 yy_bp = yytext_ptr + YY_MORE_ADJ;
1127 goto yy_find_action;
1134 "fatal flex scanner internal error--no action found" );
1135 } /* end of action switch */
1136 } /* end of scanning one token */
1137 } /* end of yylex */
1140 /* yy_get_next_buffer - try to read in a new buffer
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
1148 static int yy_get_next_buffer()
1150 register char *dest = yy_current_buffer->yy_ch_buf;
1151 register char *source = yytext_ptr;
1152 register int number_to_move, i;
1155 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1157 "fatal flex scanner internal error--end of buffer missed" );
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 )
1163 /* We matched a single character, the EOB, so
1164 * treat this as a final EOF.
1166 return EOB_ACT_END_OF_FILE;
1171 /* We matched some text prior to the EOB, first
1174 return EOB_ACT_LAST_MATCH;
1178 /* Try to read more data. */
1180 /* First move last chars to start of buffer. */
1181 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1183 for ( i = 0; i < number_to_move; ++i )
1184 *(dest++) = *(source++);
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,
1190 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1195 yy_current_buffer->yy_buf_size - number_to_move - 1;
1197 while ( num_to_read <= 0 )
1198 { /* Not enough room in the buffer - grow it. */
1199 #ifdef YY_USES_REJECT
1201 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1204 /* just a shorter name for the current buffer */
1205 YY_BUFFER_STATE b = yy_current_buffer;
1207 int yy_c_buf_p_offset =
1208 (int) (yy_c_buf_p - b->yy_ch_buf);
1210 if ( b->yy_is_our_buffer )
1212 int new_size = b->yy_buf_size * 2;
1214 if ( new_size <= 0 )
1215 b->yy_buf_size += b->yy_buf_size / 8;
1217 b->yy_buf_size *= 2;
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 );
1225 /* Can't grow it, we don't own it. */
1228 if ( ! b->yy_ch_buf )
1230 "fatal error - scanner input buffer overflow" );
1232 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1234 num_to_read = yy_current_buffer->yy_buf_size -
1239 if ( num_to_read > YY_READ_BUF_SIZE )
1240 num_to_read = YY_READ_BUF_SIZE;
1242 /* Read in more data. */
1243 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1244 yy_n_chars, num_to_read );
1246 yy_current_buffer->yy_n_chars = yy_n_chars;
1249 if ( yy_n_chars == 0 )
1251 if ( number_to_move == YY_MORE_ADJ )
1253 ret_val = EOB_ACT_END_OF_FILE;
1259 ret_val = EOB_ACT_LAST_MATCH;
1260 yy_current_buffer->yy_buffer_status =
1261 YY_BUFFER_EOF_PENDING;
1266 ret_val = EOB_ACT_CONTINUE_SCAN;
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;
1272 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1278 /* yy_get_previous_state - get the state just before the EOB char was reached */
1280 static yy_state_type yy_get_previous_state()
1282 register yy_state_type yy_current_state;
1283 register char *yy_cp;
1285 yy_current_state = yy_start;
1287 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1289 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1290 if ( yy_accept[yy_current_state] )
1292 yy_last_accepting_state = yy_current_state;
1293 yy_last_accepting_cpos = yy_cp;
1295 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1301 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1304 return yy_current_state;
1308 /* yy_try_NUL_trans - try to make a transition on the NUL character
1311 * next_state = yy_try_NUL_trans( current_state );
1314 #ifdef YY_USE_PROTOS
1315 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1317 static yy_state_type yy_try_NUL_trans( yy_current_state )
1318 yy_state_type yy_current_state;
1321 register int yy_is_jam;
1322 register char *yy_cp = yy_c_buf_p;
1324 register YY_CHAR yy_c = 1;
1325 if ( yy_accept[yy_current_state] )
1327 yy_last_accepting_state = yy_current_state;
1328 yy_last_accepting_cpos = yy_cp;
1330 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1336 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1337 yy_is_jam = (yy_current_state == 124);
1339 return yy_is_jam ? 0 : yy_current_state;
1344 #ifdef YY_USE_PROTOS
1345 static void yyunput( int c, register char *yy_bp )
1347 static void yyunput( c, yy_bp )
1349 register char *yy_bp;
1352 register char *yy_cp = yy_c_buf_p;
1354 /* undo effects of setting up yytext */
1355 *yy_cp = yy_hold_char;
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];
1366 while ( source > yy_current_buffer->yy_ch_buf )
1367 *--dest = *--source;
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;
1374 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1375 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1378 *--yy_cp = (char) c;
1382 yy_hold_char = *yy_cp;
1385 #endif /* ifndef YY_NO_UNPUT */
1389 static int yyinput()
1396 *yy_c_buf_p = yy_hold_char;
1398 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
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.
1404 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1405 /* This was really a NUL. */
1409 { /* need more input */
1410 int offset = yy_c_buf_p - yytext_ptr;
1413 switch ( yy_get_next_buffer() )
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.
1426 /* Reset buffer status. */
1431 case EOB_ACT_END_OF_FILE:
1436 if ( ! yy_did_buffer_switch_on_eof )
1445 case EOB_ACT_CONTINUE_SCAN:
1446 yy_c_buf_p = yytext_ptr + offset;
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;
1461 #ifdef YY_USE_PROTOS
1462 void yyrestart( FILE *input_file )
1464 void yyrestart( input_file )
1468 if ( ! yy_current_buffer )
1469 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1471 yy_init_buffer( yy_current_buffer, input_file );
1472 yy_load_buffer_state();
1476 #ifdef YY_USE_PROTOS
1477 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1479 void yy_switch_to_buffer( new_buffer )
1480 YY_BUFFER_STATE new_buffer;
1483 if ( yy_current_buffer == new_buffer )
1486 if ( yy_current_buffer )
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;
1494 yy_current_buffer = new_buffer;
1495 yy_load_buffer_state();
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.
1502 yy_did_buffer_switch_on_eof = 1;
1506 #ifdef YY_USE_PROTOS
1507 void yy_load_buffer_state( void )
1509 void yy_load_buffer_state()
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;
1519 #ifdef YY_USE_PROTOS
1520 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1522 YY_BUFFER_STATE yy_create_buffer( file, size )
1529 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1531 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1533 b->yy_buf_size = size;
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.
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()" );
1542 b->yy_is_our_buffer = 1;
1544 yy_init_buffer( b, file );
1550 #ifdef YY_USE_PROTOS
1551 void yy_delete_buffer( YY_BUFFER_STATE b )
1553 void yy_delete_buffer( b )
1560 if ( b == yy_current_buffer )
1561 yy_current_buffer = (YY_BUFFER_STATE) 0;
1563 if ( b->yy_is_our_buffer )
1564 yy_flex_free( (void *) b->yy_ch_buf );
1566 yy_flex_free( (void *) b );
1573 #ifndef YY_ALWAYS_INTERACTIVE
1574 #ifndef YY_NEVER_INTERACTIVE
1575 extern int isatty YY_PROTO(( int ));
1580 #ifdef YY_USE_PROTOS
1581 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1583 void yy_init_buffer( b, file )
1590 yy_flush_buffer( b );
1592 b->yy_input_file = file;
1593 b->yy_fill_buffer = 1;
1595 #if YY_ALWAYS_INTERACTIVE
1596 b->yy_is_interactive = 1;
1598 #if YY_NEVER_INTERACTIVE
1599 b->yy_is_interactive = 0;
1601 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1607 #ifdef YY_USE_PROTOS
1608 void yy_flush_buffer( YY_BUFFER_STATE b )
1610 void yy_flush_buffer( b )
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.
1624 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1625 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1627 b->yy_buf_pos = &b->yy_ch_buf[0];
1630 b->yy_buffer_status = YY_BUFFER_NEW;
1632 if ( b == yy_current_buffer )
1633 yy_load_buffer_state();
1637 #ifndef YY_NO_SCAN_BUFFER
1638 #ifdef YY_USE_PROTOS
1639 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1641 YY_BUFFER_STATE yy_scan_buffer( base, size )
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. */
1654 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1656 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
1665 b->yy_fill_buffer = 0;
1666 b->yy_buffer_status = YY_BUFFER_NEW;
1668 yy_switch_to_buffer( b );
1675 #ifndef YY_NO_SCAN_STRING
1676 #ifdef YY_USE_PROTOS
1677 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1679 YY_BUFFER_STATE yy_scan_string( yy_str )
1680 yyconst char *yy_str;
1684 for ( len = 0; yy_str[len]; ++len )
1687 return yy_scan_bytes( yy_str, len );
1692 #ifndef YY_NO_SCAN_BYTES
1693 #ifdef YY_USE_PROTOS
1694 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1696 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1697 yyconst char *bytes;
1706 /* Get memory for full buffer, including space for trailing EOB's. */
1708 buf = (char *) yy_flex_alloc( n );
1710 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1712 for ( i = 0; i < len; ++i )
1715 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1717 b = yy_scan_buffer( buf, n );
1719 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1721 /* It's okay to grow etc. this buffer, and we should throw it
1722 * away when we're done.
1724 b->yy_is_our_buffer = 1;
1731 #ifndef YY_NO_PUSH_STATE
1732 #ifdef YY_USE_PROTOS
1733 static void yy_push_state( int new_state )
1735 static void yy_push_state( new_state )
1739 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1743 yy_start_stack_depth += YY_START_STACK_INCR;
1744 new_size = yy_start_stack_depth * sizeof( int );
1746 if ( ! yy_start_stack )
1747 yy_start_stack = (int *) yy_flex_alloc( new_size );
1750 yy_start_stack = (int *) yy_flex_realloc(
1751 (void *) yy_start_stack, new_size );
1753 if ( ! yy_start_stack )
1755 "out of memory expanding start-condition stack" );
1758 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1765 #ifndef YY_NO_POP_STATE
1766 static void yy_pop_state()
1768 if ( --yy_start_stack_ptr < 0 )
1769 YY_FATAL_ERROR( "start-condition stack underflow" );
1771 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1776 #ifndef YY_NO_TOP_STATE
1777 static int yy_top_state()
1779 return yy_start_stack[yy_start_stack_ptr - 1];
1783 #ifndef YY_EXIT_FAILURE
1784 #define YY_EXIT_FAILURE 2
1787 #ifdef YY_USE_PROTOS
1788 static void yy_fatal_error( yyconst char msg[] )
1790 static void yy_fatal_error( msg )
1794 (void) fprintf( stderr, "%s\n", msg );
1795 exit( YY_EXIT_FAILURE );
1800 /* Redefine yyless() so it works in section 3 code. */
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'; \
1816 /* Internal utility routines. */
1819 #ifdef YY_USE_PROTOS
1820 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1822 static void yy_flex_strncpy( s1, s2, n )
1829 for ( i = 0; i < n; ++i )
1834 #ifdef YY_NEED_STRLEN
1835 #ifdef YY_USE_PROTOS
1836 static int yy_flex_strlen( yyconst char *s )
1838 static int yy_flex_strlen( s )
1843 for ( n = 0; s[n]; ++n )
1851 #ifdef YY_USE_PROTOS
1852 static void *yy_flex_alloc( yy_size_t size )
1854 static void *yy_flex_alloc( size )
1858 return (void *) malloc( size );
1861 #ifdef YY_USE_PROTOS
1862 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1864 static void *yy_flex_realloc( ptr, size )
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.
1876 return (void *) realloc( (char *) ptr, size );
1879 #ifdef YY_USE_PROTOS
1880 static void yy_flex_free( void *ptr )
1882 static void yy_flex_free( ptr )
1896 #line 270 "meta_lex_ind.l"
1899 /***************************************************************/
1900 /* 6. Auxiliary functions. */
1901 /***************************************************************/
1903 main(int argc, char *argv[])
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");
1918 if (!(out = fopen(filename,"w")))
1920 fprintf(stderr, "error in openinf file %s\n", filename);
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=\"http://www.cs.unibo.it/helm/schemas/mattone.rdf#\">\n");
1927 fprintf(out,"\t<h:Object rdf:about=\"");
1928 fprintf(out,"%s",file_uri);
1929 fprintf(out,"\">\n");
1931 fprintf(out,"\t</h:Object>\n");
1932 fprintf(out,"</rdf:RDF>\n");
1937 search(uri,first_child,position)
1942 if (first_child == HERE)
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); */
1951 else found = search_bucket(uri,position);
1952 /* if (found == NOTFOUND)
1953 printf( "pos = %d, uri = %s\n", position, uri); */