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 23
295 #define YY_END_OF_BUFFER 24
296 static yyconst short int yy_accept[138] =
298 0, 0, 24, 9, 9, 9, 9, 0, 0, 0,
299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
302 0, 12, 0, 0, 0, 14, 0, 16, 0, 6,
303 0, 0, 0, 0, 0, 0, 8, 0, 0, 0,
304 0, 0, 0, 0, 0, 5, 0, 0, 0, 0,
305 0, 0, 13, 17, 0, 0, 0, 0, 0, 0,
306 0, 0, 0, 20, 0, 0, 7, 0, 0, 10,
307 0, 0, 18, 0, 0, 0, 0, 2, 0, 0,
309 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
310 0, 21, 0, 0, 0, 0, 0, 0, 0, 0,
311 0, 0, 0, 22, 0, 3, 0, 0, 0, 0,
312 0, 19, 0, 4, 1, 15, 0
315 static yyconst int yy_ec[256] =
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320 1, 3, 1, 4, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 5, 6, 6, 6,
322 6, 6, 6, 6, 6, 6, 6, 1, 1, 7,
323 8, 9, 1, 1, 10, 11, 12, 13, 14, 15,
324 1, 1, 16, 1, 1, 17, 18, 19, 20, 1,
325 1, 21, 22, 23, 24, 25, 1, 26, 1, 1,
326 1, 1, 1, 1, 1, 1, 27, 1, 28, 29,
328 30, 31, 1, 1, 32, 1, 1, 33, 1, 34,
329 35, 36, 1, 37, 38, 39, 40, 41, 1, 1,
330 42, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 static yyconst int yy_meta[43] =
349 1, 1, 1, 2, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 static yyconst short int yy_base[141] =
358 0, 1, 151, 152, 37, 115, 112, 0, 1, 132,
359 113, 136, 121, 130, 123, 132, 111, 1, 108, 104,
360 101, 107, 0, 102, 109, 105, 115, 109, 114, 109,
361 108, 0, 93, 85, 118, 91, 92, 2, 107, 100,
362 83, 152, 80, 108, 2, 152, 95, 152, 84, 152,
363 82, 79, 110, 75, 73, 78, 152, 84, 86, 69,
364 79, 93, 0, 86, 0, 152, 66, 73, 0, 63,
365 59, 91, 152, 152, 62, 59, 87, 74, 76, 81,
366 2, 54, 84, 0, 54, 81, 152, 49, 56, 152,
367 73, 64, 152, 58, 47, 79, 42, 152, 53, 39,
369 152, 56, 45, 69, 70, 47, 35, 43, 51, 31,
370 66, 63, 26, 29, 40, 37, 30, 51, 21, 14,
371 8, 36, 39, 40, 8, 152, 8, 16, 34, 28,
372 2, 152, 0, 152, 152, 0, 152, 66, 5, 0
375 static yyconst short int yy_def[141] =
377 138, 138, 137, 137, 137, 137, 137, 137, 137, 137,
378 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
379 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
380 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
381 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
382 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
383 137, 137, 137, 137, 137, 137, 137, 137, 139, 137,
384 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
385 137, 137, 137, 139, 137, 137, 137, 137, 137, 137,
386 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
388 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
389 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
390 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
391 137, 137, 140, 137, 137, 140, 0, 137, 137, 137
394 static yyconst short int yy_nxt[195] =
396 136, 81, 81, 81, 81, 84, 5, 5, 137, 78,
397 137, 20, 33, 63, 39, 137, 137, 64, 40, 79,
398 23, 137, 137, 34, 137, 137, 21, 49, 22, 56,
399 50, 135, 57, 6, 6, 24, 134, 133, 132, 7,
400 7, 8, 94, 131, 130, 124, 129, 128, 9, 127,
401 126, 10, 11, 12, 13, 125, 124, 14, 15, 123,
402 122, 16, 121, 120, 119, 17, 4, 4, 112, 118,
403 117, 116, 115, 114, 113, 112, 111, 110, 109, 108,
404 107, 106, 105, 104, 103, 102, 101, 100, 99, 98,
405 97, 96, 95, 93, 92, 91, 90, 89, 88, 87,
407 86, 85, 83, 82, 80, 77, 76, 75, 74, 73,
408 72, 71, 70, 69, 68, 67, 66, 65, 62, 61,
409 60, 59, 58, 55, 54, 53, 52, 51, 48, 47,
410 46, 45, 44, 43, 42, 41, 38, 37, 36, 35,
411 32, 31, 30, 29, 28, 27, 26, 25, 19, 18,
412 137, 3, 137, 137, 137, 137, 137, 137, 137, 137,
413 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
414 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
415 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
420 static yyconst short int yy_chk[195] =
422 140, 65, 65, 81, 81, 139, 1, 2, 0, 63,
423 0, 8, 18, 45, 23, 0, 0, 45, 23, 63,
424 9, 0, 0, 18, 0, 0, 8, 32, 8, 38,
425 32, 131, 38, 1, 2, 9, 130, 129, 128, 1,
426 2, 5, 81, 127, 125, 124, 123, 122, 5, 121,
427 120, 5, 5, 5, 5, 119, 118, 5, 5, 117,
428 116, 5, 115, 114, 113, 5, 138, 138, 112, 111,
429 110, 109, 108, 107, 106, 105, 104, 103, 102, 100,
430 99, 97, 96, 95, 94, 92, 91, 89, 88, 86,
431 85, 83, 82, 80, 79, 78, 77, 76, 75, 72,
433 71, 70, 68, 67, 64, 62, 61, 60, 59, 58,
434 56, 55, 54, 53, 52, 51, 49, 47, 44, 43,
435 41, 40, 39, 37, 36, 35, 34, 33, 31, 30,
436 29, 28, 27, 26, 25, 24, 22, 21, 20, 19,
437 17, 16, 15, 14, 13, 12, 11, 10, 7, 6,
438 3, 137, 137, 137, 137, 137, 137, 137, 137, 137,
439 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
440 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
441 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
446 static yy_state_type yy_last_accepting_state;
447 static char *yy_last_accepting_cpos;
449 /* The intent behind this definition is that it'll catch
450 * any uses of REJECT which flex missed.
452 #define REJECT reject_used_but_not_detected
453 #define yymore() yymore_used_but_not_detected
454 #define YY_MORE_ADJ 0
455 #define YY_RESTORE_YY_MORE_OFFSET
457 #line 1 "meta_lex_ind.l"
459 /******************************************************************/
460 /* Copyright (C) 2000, HELM Team */
462 /* This file is part of HELM, an Hypertextual, Electronic */
463 /* Library of Mathematics, developed at the Computer Science */
464 /* Department, University of Bologna, Italy. */
466 /* HELM is free software; you can redistribute it and/or */
467 /* modify it under the terms of the GNU General Public License */
468 /* as published by the Free Software Foundation; either version */
469 /* 2 of the License, or (at your option) any later version. */
471 /* HELM is distributed in the hope that it will be useful, */
472 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
473 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
474 /* GNU General Public License for more details. */
476 /* You should have received a copy of the GNU General Public */
477 /* License along with HELM; if not, write to the Free Software */
478 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, */
479 /* MA 02111-1307, USA. */
481 /* For details, see the HELM World-Wide-Web page, */
482 /* http://cs.unibo.it/helm/. */
483 /******************************************************************/
484 /***************************************************************/
486 /* Automatic Metadata Extractor */
487 /* First draft 11/12/2001, by Andrea Asperti */
488 /* more bugs added by domenico lordi on mon 12/17/2001 */
489 /***************************************************************/
490 /***************************************************************/
491 /* 1. Inclusion of header files. */
492 /***************************************************************/
493 #line 39 "meta_lex_ind.l"
496 #include <sys/stat.h>
497 #include "sthandler_ind.h"
498 /***************************************************************/
499 /* 2. Constants and Variables Definitions */
500 /***************************************************************/
501 #line 50 "meta_lex_ind.l"
505 #define MUTCONSTRUCT 3
521 int found = NOTFOUND;
522 int position = INBODY;
523 int first_child = HERE;
524 int skip = 0; // boolean to skip the insertion of a URI
525 int no_open_source =0;
529 int inductive_type = 0;
533 char *xpointer = "#xpointer(1/";
539 char *filename_prefix;
540 char *file_uri_prefix;
541 /***************************************************************/
542 /* 3. Regular definitions. */
543 /***************************************************************/
544 /***************************************************************/
546 /***************************************************************/
547 #line 548 "lex.yy_ind.c"
549 /* Macros after this point can all be overridden by user definitions in
553 #ifndef YY_SKIP_YYWRAP
555 extern "C" int yywrap YY_PROTO(( void ));
557 extern int yywrap YY_PROTO(( void ));
562 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
566 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
569 #ifdef YY_NEED_STRLEN
570 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
575 static int yyinput YY_PROTO(( void ));
577 static int input YY_PROTO(( void ));
582 static int yy_start_stack_ptr = 0;
583 static int yy_start_stack_depth = 0;
584 static int *yy_start_stack = 0;
585 #ifndef YY_NO_PUSH_STATE
586 static void yy_push_state YY_PROTO(( int new_state ));
588 #ifndef YY_NO_POP_STATE
589 static void yy_pop_state YY_PROTO(( void ));
591 #ifndef YY_NO_TOP_STATE
592 static int yy_top_state YY_PROTO(( void ));
596 #define YY_NO_PUSH_STATE 1
597 #define YY_NO_POP_STATE 1
598 #define YY_NO_TOP_STATE 1
601 #ifdef YY_MALLOC_DECL
609 /* Just try to get by without declaring the routines. This will fail
610 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
611 * or sizeof(void*) != sizeof(int).
616 /* Amount of stuff to slurp up with each read. */
617 #ifndef YY_READ_BUF_SIZE
618 #define YY_READ_BUF_SIZE 8192
621 /* Copy whatever the last rule matched to the standard output. */
624 /* This used to be an fputs(), but since the string might contain NUL's,
625 * we now use fwrite().
627 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
630 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
631 * is returned in "result".
634 #define YY_INPUT(buf,result,max_size) \
635 if ( yy_current_buffer->yy_is_interactive ) \
638 for ( n = 0; n < max_size && \
639 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
642 buf[n++] = (char) c; \
643 if ( c == EOF && ferror( yyin ) ) \
644 YY_FATAL_ERROR( "input in flex scanner failed" ); \
650 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
652 if( errno != EINTR) \
654 YY_FATAL_ERROR( "input in flex scanner failed" ); \
663 /* No semi-colon after return; correct usage is to write "yyterminate();" -
664 * we don't want an extra ';' after the "return" because that will cause
665 * some compilers to complain about unreachable statements.
668 #define yyterminate() return YY_NULL
671 /* Number of entries by which start-condition stack grows. */
672 #ifndef YY_START_STACK_INCR
673 #define YY_START_STACK_INCR 25
676 /* Report a fatal error. */
677 #ifndef YY_FATAL_ERROR
678 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
681 /* Default declaration of generated scanner - a define so the user can
682 * easily add parameters.
685 #define YY_DECL int yylex YY_PROTO(( void ))
688 /* Code executed at the beginning of each rule, after yytext and yyleng
691 #ifndef YY_USER_ACTION
692 #define YY_USER_ACTION
695 /* Code executed at the end of each rule. */
697 #define YY_BREAK break;
700 #define YY_RULE_SETUP \
705 register yy_state_type yy_current_state;
706 register char *yy_cp, *yy_bp;
709 #line 104 "meta_lex_ind.l"
712 #line 713 "lex.yy_ind.c"
723 yy_start = 1; /* first start state */
731 if ( ! yy_current_buffer )
733 yy_create_buffer( yyin, YY_BUF_SIZE );
735 yy_load_buffer_state();
738 while ( 1 ) /* loops until end-of-file is reached */
742 /* Support of yytext. */
743 *yy_cp = yy_hold_char;
745 /* yy_bp points to the position in yy_ch_buf of the start of
750 yy_current_state = yy_start;
754 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
755 if ( yy_accept[yy_current_state] )
757 yy_last_accepting_state = yy_current_state;
758 yy_last_accepting_cpos = yy_cp;
760 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
762 yy_current_state = (int) yy_def[yy_current_state];
763 if ( yy_current_state >= 138 )
764 yy_c = yy_meta[(unsigned int) yy_c];
766 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
769 while ( yy_base[yy_current_state] != 152 );
772 yy_act = yy_accept[yy_current_state];
774 { /* have to back up */
775 yy_cp = yy_last_accepting_cpos;
776 yy_current_state = yy_last_accepting_state;
777 yy_act = yy_accept[yy_current_state];
783 do_action: /* This label is used only to access EOF actions. */
787 { /* beginning of action switch */
788 case 0: /* must back up */
789 /* undo the effects of YY_DO_BEFORE_ACTION */
790 *yy_cp = yy_hold_char;
791 yy_cp = yy_last_accepting_cpos;
792 yy_current_state = yy_last_accepting_state;
797 #line 106 "meta_lex_ind.l"
799 /* fprintf(stderr,"uno"); */
804 /* fprintf(stderr,"due"); */
813 #line 119 "meta_lex_ind.l"
814 { tmp = (char *)malloc(sizeof('a')*128);
815 strcpy(filename,filename_prefix);
816 /* fprintf(stderr,"tre"); */
817 strcpy(file_uri,file_uri_prefix);
818 sprintf(tmp,",%d.xml", inductive_type);
819 /* fprintf(stderr,"quattro"); */
820 strcat(filename,tmp);
821 sprintf(tmp,"#xpointer(1/%d)", inductive_type);
822 strcat(file_uri,tmp);
823 /* fprintf(stderr,"cinque"); */
830 #line 133 "meta_lex_ind.l"
831 { init_symbol_table();
836 strcpy(inductive_uri,file_uri_prefix);
843 #line 143 "meta_lex_ind.l"
844 { tmp = (char *)malloc(sizeof('a')*128);
845 strcpy(filename,filename_prefix);
846 strcpy(file_uri,file_uri_prefix);
847 strcpy(inductive_uri,file_uri_prefix);
848 sprintf(tmp,",%d,%d.xml", inductive_type,constructor);
849 strcat(filename,tmp);
850 sprintf(tmp,"#xpointer(1/%d/%d)",inductive_type,constructor);
851 strcat(file_uri,tmp);
857 #line 156 "meta_lex_ind.l"
860 #line 156 "meta_lex_ind.l"
862 if (position == INTYPE)
864 else if (position == MAINHYP)
870 #line 165 "meta_lex_ind.l"
873 #line 165 "meta_lex_ind.l"
875 if (position == INHYP)
878 if (no_open_source == 0)
885 else if (position == MAINHYP)
896 #line 186 "meta_lex_ind.l"
901 #line 190 "meta_lex_ind.l"
903 #line 191 "meta_lex_ind.l"
905 #line 192 "meta_lex_ind.l"
908 #line 192 "meta_lex_ind.l"
915 #line 196 "meta_lex_ind.l"
917 if (((position == INTYPE) | (position == MAINHYP)) &&
918 (first_child == HERE))
920 if (position == INTYPE) /* REL on the spine */
923 search("Rel",first_child,position,spine_depth);
925 else search("Rel",first_child,position,depth);
932 #line 210 "meta_lex_ind.l"
934 if ((position == INTYPE) | (position == MAINHYP))
936 tmp=(char *)malloc((sizeof('a')*200));
939 if (position == INTYPE) /* SORT on the spine */
942 search(tmp,first_child,position,spine_depth);
944 else search(tmp,first_child,position,depth);
951 #line 226 "meta_lex_ind.l"
959 #line 231 "meta_lex_ind.l"
961 if (position == INTYPE) /* CONST on the spine */
968 #line 237 "meta_lex_ind.l"
970 if (position == INTYPE) /* MUTIND on the spine */
977 #line 243 "meta_lex_ind.l"
979 if (position == INTYPE) /* MUTCONSTRUCT on the spine */
981 where = MUTCONSTRUCT;
986 #line 249 "meta_lex_ind.l"
989 uri=(char *)malloc((sizeof('a')*200));
994 if (position == INCONCL)
995 search(uri,first_child,position,spine_depth);
996 else search(uri,first_child,position,depth);
1006 #line 266 "meta_lex_ind.l"
1008 if ((where == MUTIND) || (where == MUTCONSTRUCT))
1009 { strsep(&yytext,&sep);
1010 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1012 tmp_n = atoi(tmp)+1;
1013 sprintf(tmp,"%d",tmp_n);
1014 strcat(uri,"#xpointer(1/");
1017 if (where == MUTIND)
1020 if (position == INCONCL)
1021 search(uri,first_child,position,spine_depth);
1022 else search(uri,first_child,position,depth);
1026 first_child = AFTER;};
1031 #line 288 "meta_lex_ind.l"
1033 if (where == MUTCONSTRUCT)
1034 { strsep(&yytext,&sep);
1035 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1040 if (position == INCONCL)
1041 search(uri,first_child,position,spine_depth);
1042 else search(uri,first_child,position,depth);
1046 first_child = AFTER;};
1051 #line 307 "meta_lex_ind.l"
1054 #line 1055 "lex.yy_ind.c"
1055 case YY_STATE_EOF(INITIAL):
1058 case YY_END_OF_BUFFER:
1060 /* Amount of text matched not including the EOB char. */
1061 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1063 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1064 *yy_cp = yy_hold_char;
1065 YY_RESTORE_YY_MORE_OFFSET
1067 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1069 /* We're scanning a new file or input source. It's
1070 * possible that this happened because the user
1071 * just pointed yyin at a new source and called
1072 * yylex(). If so, then we have to assure
1073 * consistency between yy_current_buffer and our
1074 * globals. Here is the right place to do so, because
1075 * this is the first action (other than possibly a
1076 * back-up) that will match for the new input source.
1078 yy_n_chars = yy_current_buffer->yy_n_chars;
1079 yy_current_buffer->yy_input_file = yyin;
1080 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1083 /* Note that here we test for yy_c_buf_p "<=" to the position
1084 * of the first EOB in the buffer, since yy_c_buf_p will
1085 * already have been incremented past the NUL character
1086 * (since all states make transitions on EOB to the
1087 * end-of-buffer state). Contrast this with the test
1090 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1091 { /* This was really a NUL. */
1092 yy_state_type yy_next_state;
1094 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1096 yy_current_state = yy_get_previous_state();
1098 /* Okay, we're now positioned to make the NUL
1099 * transition. We couldn't have
1100 * yy_get_previous_state() go ahead and do it
1101 * for us because it doesn't know how to deal
1102 * with the possibility of jamming (and we don't
1103 * want to build jamming into it because then it
1104 * will run more slowly).
1107 yy_next_state = yy_try_NUL_trans( yy_current_state );
1109 yy_bp = yytext_ptr + YY_MORE_ADJ;
1111 if ( yy_next_state )
1113 /* Consume the NUL. */
1114 yy_cp = ++yy_c_buf_p;
1115 yy_current_state = yy_next_state;
1122 goto yy_find_action;
1126 else switch ( yy_get_next_buffer() )
1128 case EOB_ACT_END_OF_FILE:
1130 yy_did_buffer_switch_on_eof = 0;
1134 /* Note: because we've taken care in
1135 * yy_get_next_buffer() to have set up
1136 * yytext, we can now set up
1137 * yy_c_buf_p so that if some total
1138 * hoser (like flex itself) wants to
1139 * call the scanner after we return the
1140 * YY_NULL, it'll still work - another
1141 * YY_NULL will get returned.
1143 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1145 yy_act = YY_STATE_EOF(YY_START);
1151 if ( ! yy_did_buffer_switch_on_eof )
1157 case EOB_ACT_CONTINUE_SCAN:
1159 yytext_ptr + yy_amount_of_matched_text;
1161 yy_current_state = yy_get_previous_state();
1164 yy_bp = yytext_ptr + YY_MORE_ADJ;
1167 case EOB_ACT_LAST_MATCH:
1169 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1171 yy_current_state = yy_get_previous_state();
1174 yy_bp = yytext_ptr + YY_MORE_ADJ;
1175 goto yy_find_action;
1182 "fatal flex scanner internal error--no action found" );
1183 } /* end of action switch */
1184 } /* end of scanning one token */
1185 } /* end of yylex */
1188 /* yy_get_next_buffer - try to read in a new buffer
1190 * Returns a code representing an action:
1191 * EOB_ACT_LAST_MATCH -
1192 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1193 * EOB_ACT_END_OF_FILE - end of file
1196 static int yy_get_next_buffer()
1198 register char *dest = yy_current_buffer->yy_ch_buf;
1199 register char *source = yytext_ptr;
1200 register int number_to_move, i;
1203 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1205 "fatal flex scanner internal error--end of buffer missed" );
1207 if ( yy_current_buffer->yy_fill_buffer == 0 )
1208 { /* Don't try to fill the buffer, so this is an EOF. */
1209 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1211 /* We matched a single character, the EOB, so
1212 * treat this as a final EOF.
1214 return EOB_ACT_END_OF_FILE;
1219 /* We matched some text prior to the EOB, first
1222 return EOB_ACT_LAST_MATCH;
1226 /* Try to read more data. */
1228 /* First move last chars to start of buffer. */
1229 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1231 for ( i = 0; i < number_to_move; ++i )
1232 *(dest++) = *(source++);
1234 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1235 /* don't do the read, it's not guaranteed to return an EOF,
1238 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1243 yy_current_buffer->yy_buf_size - number_to_move - 1;
1245 while ( num_to_read <= 0 )
1246 { /* Not enough room in the buffer - grow it. */
1247 #ifdef YY_USES_REJECT
1249 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1252 /* just a shorter name for the current buffer */
1253 YY_BUFFER_STATE b = yy_current_buffer;
1255 int yy_c_buf_p_offset =
1256 (int) (yy_c_buf_p - b->yy_ch_buf);
1258 if ( b->yy_is_our_buffer )
1260 int new_size = b->yy_buf_size * 2;
1262 if ( new_size <= 0 )
1263 b->yy_buf_size += b->yy_buf_size / 8;
1265 b->yy_buf_size *= 2;
1267 b->yy_ch_buf = (char *)
1268 /* Include room in for 2 EOB chars. */
1269 yy_flex_realloc( (void *) b->yy_ch_buf,
1270 b->yy_buf_size + 2 );
1273 /* Can't grow it, we don't own it. */
1276 if ( ! b->yy_ch_buf )
1278 "fatal error - scanner input buffer overflow" );
1280 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1282 num_to_read = yy_current_buffer->yy_buf_size -
1287 if ( num_to_read > YY_READ_BUF_SIZE )
1288 num_to_read = YY_READ_BUF_SIZE;
1290 /* Read in more data. */
1291 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1292 yy_n_chars, num_to_read );
1294 yy_current_buffer->yy_n_chars = yy_n_chars;
1297 if ( yy_n_chars == 0 )
1299 if ( number_to_move == YY_MORE_ADJ )
1301 ret_val = EOB_ACT_END_OF_FILE;
1307 ret_val = EOB_ACT_LAST_MATCH;
1308 yy_current_buffer->yy_buffer_status =
1309 YY_BUFFER_EOF_PENDING;
1314 ret_val = EOB_ACT_CONTINUE_SCAN;
1316 yy_n_chars += number_to_move;
1317 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1318 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1320 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1326 /* yy_get_previous_state - get the state just before the EOB char was reached */
1328 static yy_state_type yy_get_previous_state()
1330 register yy_state_type yy_current_state;
1331 register char *yy_cp;
1333 yy_current_state = yy_start;
1335 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1337 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1338 if ( yy_accept[yy_current_state] )
1340 yy_last_accepting_state = yy_current_state;
1341 yy_last_accepting_cpos = yy_cp;
1343 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1345 yy_current_state = (int) yy_def[yy_current_state];
1346 if ( yy_current_state >= 138 )
1347 yy_c = yy_meta[(unsigned int) yy_c];
1349 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1352 return yy_current_state;
1356 /* yy_try_NUL_trans - try to make a transition on the NUL character
1359 * next_state = yy_try_NUL_trans( current_state );
1362 #ifdef YY_USE_PROTOS
1363 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1365 static yy_state_type yy_try_NUL_trans( yy_current_state )
1366 yy_state_type yy_current_state;
1369 register int yy_is_jam;
1370 register char *yy_cp = yy_c_buf_p;
1372 register YY_CHAR yy_c = 1;
1373 if ( yy_accept[yy_current_state] )
1375 yy_last_accepting_state = yy_current_state;
1376 yy_last_accepting_cpos = yy_cp;
1378 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1380 yy_current_state = (int) yy_def[yy_current_state];
1381 if ( yy_current_state >= 138 )
1382 yy_c = yy_meta[(unsigned int) yy_c];
1384 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1385 yy_is_jam = (yy_current_state == 137);
1387 return yy_is_jam ? 0 : yy_current_state;
1392 #ifdef YY_USE_PROTOS
1393 static void yyunput( int c, register char *yy_bp )
1395 static void yyunput( c, yy_bp )
1397 register char *yy_bp;
1400 register char *yy_cp = yy_c_buf_p;
1402 /* undo effects of setting up yytext */
1403 *yy_cp = yy_hold_char;
1405 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1406 { /* need to shift things up to make room */
1407 /* +2 for EOB chars. */
1408 register int number_to_move = yy_n_chars + 2;
1409 register char *dest = &yy_current_buffer->yy_ch_buf[
1410 yy_current_buffer->yy_buf_size + 2];
1411 register char *source =
1412 &yy_current_buffer->yy_ch_buf[number_to_move];
1414 while ( source > yy_current_buffer->yy_ch_buf )
1415 *--dest = *--source;
1417 yy_cp += (int) (dest - source);
1418 yy_bp += (int) (dest - source);
1419 yy_current_buffer->yy_n_chars =
1420 yy_n_chars = yy_current_buffer->yy_buf_size;
1422 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1423 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1426 *--yy_cp = (char) c;
1430 yy_hold_char = *yy_cp;
1433 #endif /* ifndef YY_NO_UNPUT */
1437 static int yyinput()
1444 *yy_c_buf_p = yy_hold_char;
1446 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1448 /* yy_c_buf_p now points to the character we want to return.
1449 * If this occurs *before* the EOB characters, then it's a
1450 * valid NUL; if not, then we've hit the end of the buffer.
1452 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1453 /* This was really a NUL. */
1457 { /* need more input */
1458 int offset = yy_c_buf_p - yytext_ptr;
1461 switch ( yy_get_next_buffer() )
1463 case EOB_ACT_LAST_MATCH:
1464 /* This happens because yy_g_n_b()
1465 * sees that we've accumulated a
1466 * token and flags that we need to
1467 * try matching the token before
1468 * proceeding. But for input(),
1469 * there's no matching to consider.
1470 * So convert the EOB_ACT_LAST_MATCH
1471 * to EOB_ACT_END_OF_FILE.
1474 /* Reset buffer status. */
1479 case EOB_ACT_END_OF_FILE:
1484 if ( ! yy_did_buffer_switch_on_eof )
1493 case EOB_ACT_CONTINUE_SCAN:
1494 yy_c_buf_p = yytext_ptr + offset;
1500 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1501 *yy_c_buf_p = '\0'; /* preserve yytext */
1502 yy_hold_char = *++yy_c_buf_p;
1509 #ifdef YY_USE_PROTOS
1510 void yyrestart( FILE *input_file )
1512 void yyrestart( input_file )
1516 if ( ! yy_current_buffer )
1517 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1519 yy_init_buffer( yy_current_buffer, input_file );
1520 yy_load_buffer_state();
1524 #ifdef YY_USE_PROTOS
1525 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1527 void yy_switch_to_buffer( new_buffer )
1528 YY_BUFFER_STATE new_buffer;
1531 if ( yy_current_buffer == new_buffer )
1534 if ( yy_current_buffer )
1536 /* Flush out information for old buffer. */
1537 *yy_c_buf_p = yy_hold_char;
1538 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1539 yy_current_buffer->yy_n_chars = yy_n_chars;
1542 yy_current_buffer = new_buffer;
1543 yy_load_buffer_state();
1545 /* We don't actually know whether we did this switch during
1546 * EOF (yywrap()) processing, but the only time this flag
1547 * is looked at is after yywrap() is called, so it's safe
1548 * to go ahead and always set it.
1550 yy_did_buffer_switch_on_eof = 1;
1554 #ifdef YY_USE_PROTOS
1555 void yy_load_buffer_state( void )
1557 void yy_load_buffer_state()
1560 yy_n_chars = yy_current_buffer->yy_n_chars;
1561 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1562 yyin = yy_current_buffer->yy_input_file;
1563 yy_hold_char = *yy_c_buf_p;
1567 #ifdef YY_USE_PROTOS
1568 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1570 YY_BUFFER_STATE yy_create_buffer( file, size )
1577 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1579 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1581 b->yy_buf_size = size;
1583 /* yy_ch_buf has to be 2 characters longer than the size given because
1584 * we need to put in 2 end-of-buffer characters.
1586 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1587 if ( ! b->yy_ch_buf )
1588 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1590 b->yy_is_our_buffer = 1;
1592 yy_init_buffer( b, file );
1598 #ifdef YY_USE_PROTOS
1599 void yy_delete_buffer( YY_BUFFER_STATE b )
1601 void yy_delete_buffer( b )
1608 if ( b == yy_current_buffer )
1609 yy_current_buffer = (YY_BUFFER_STATE) 0;
1611 if ( b->yy_is_our_buffer )
1612 yy_flex_free( (void *) b->yy_ch_buf );
1614 yy_flex_free( (void *) b );
1621 #ifndef YY_ALWAYS_INTERACTIVE
1622 #ifndef YY_NEVER_INTERACTIVE
1623 extern int isatty YY_PROTO(( int ));
1628 #ifdef YY_USE_PROTOS
1629 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1631 void yy_init_buffer( b, file )
1638 yy_flush_buffer( b );
1640 b->yy_input_file = file;
1641 b->yy_fill_buffer = 1;
1643 #if YY_ALWAYS_INTERACTIVE
1644 b->yy_is_interactive = 1;
1646 #if YY_NEVER_INTERACTIVE
1647 b->yy_is_interactive = 0;
1649 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1655 #ifdef YY_USE_PROTOS
1656 void yy_flush_buffer( YY_BUFFER_STATE b )
1658 void yy_flush_buffer( b )
1668 /* We always need two end-of-buffer characters. The first causes
1669 * a transition to the end-of-buffer state. The second causes
1670 * a jam in that state.
1672 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1673 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1675 b->yy_buf_pos = &b->yy_ch_buf[0];
1678 b->yy_buffer_status = YY_BUFFER_NEW;
1680 if ( b == yy_current_buffer )
1681 yy_load_buffer_state();
1685 #ifndef YY_NO_SCAN_BUFFER
1686 #ifdef YY_USE_PROTOS
1687 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1689 YY_BUFFER_STATE yy_scan_buffer( base, size )
1697 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1698 base[size-1] != YY_END_OF_BUFFER_CHAR )
1699 /* They forgot to leave room for the EOB's. */
1702 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1704 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1706 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1707 b->yy_buf_pos = b->yy_ch_buf = base;
1708 b->yy_is_our_buffer = 0;
1709 b->yy_input_file = 0;
1710 b->yy_n_chars = b->yy_buf_size;
1711 b->yy_is_interactive = 0;
1713 b->yy_fill_buffer = 0;
1714 b->yy_buffer_status = YY_BUFFER_NEW;
1716 yy_switch_to_buffer( b );
1723 #ifndef YY_NO_SCAN_STRING
1724 #ifdef YY_USE_PROTOS
1725 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1727 YY_BUFFER_STATE yy_scan_string( yy_str )
1728 yyconst char *yy_str;
1732 for ( len = 0; yy_str[len]; ++len )
1735 return yy_scan_bytes( yy_str, len );
1740 #ifndef YY_NO_SCAN_BYTES
1741 #ifdef YY_USE_PROTOS
1742 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1744 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1745 yyconst char *bytes;
1754 /* Get memory for full buffer, including space for trailing EOB's. */
1756 buf = (char *) yy_flex_alloc( n );
1758 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1760 for ( i = 0; i < len; ++i )
1763 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1765 b = yy_scan_buffer( buf, n );
1767 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1769 /* It's okay to grow etc. this buffer, and we should throw it
1770 * away when we're done.
1772 b->yy_is_our_buffer = 1;
1779 #ifndef YY_NO_PUSH_STATE
1780 #ifdef YY_USE_PROTOS
1781 static void yy_push_state( int new_state )
1783 static void yy_push_state( new_state )
1787 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1791 yy_start_stack_depth += YY_START_STACK_INCR;
1792 new_size = yy_start_stack_depth * sizeof( int );
1794 if ( ! yy_start_stack )
1795 yy_start_stack = (int *) yy_flex_alloc( new_size );
1798 yy_start_stack = (int *) yy_flex_realloc(
1799 (void *) yy_start_stack, new_size );
1801 if ( ! yy_start_stack )
1803 "out of memory expanding start-condition stack" );
1806 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1813 #ifndef YY_NO_POP_STATE
1814 static void yy_pop_state()
1816 if ( --yy_start_stack_ptr < 0 )
1817 YY_FATAL_ERROR( "start-condition stack underflow" );
1819 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1824 #ifndef YY_NO_TOP_STATE
1825 static int yy_top_state()
1827 return yy_start_stack[yy_start_stack_ptr - 1];
1831 #ifndef YY_EXIT_FAILURE
1832 #define YY_EXIT_FAILURE 2
1835 #ifdef YY_USE_PROTOS
1836 static void yy_fatal_error( yyconst char msg[] )
1838 static void yy_fatal_error( msg )
1842 (void) fprintf( stderr, "%s\n", msg );
1843 exit( YY_EXIT_FAILURE );
1848 /* Redefine yyless() so it works in section 3 code. */
1854 /* Undo effects of setting up yytext. */ \
1855 yytext[yyleng] = yy_hold_char; \
1856 yy_c_buf_p = yytext + n; \
1857 yy_hold_char = *yy_c_buf_p; \
1858 *yy_c_buf_p = '\0'; \
1864 /* Internal utility routines. */
1867 #ifdef YY_USE_PROTOS
1868 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1870 static void yy_flex_strncpy( s1, s2, n )
1877 for ( i = 0; i < n; ++i )
1882 #ifdef YY_NEED_STRLEN
1883 #ifdef YY_USE_PROTOS
1884 static int yy_flex_strlen( yyconst char *s )
1886 static int yy_flex_strlen( s )
1891 for ( n = 0; s[n]; ++n )
1899 #ifdef YY_USE_PROTOS
1900 static void *yy_flex_alloc( yy_size_t size )
1902 static void *yy_flex_alloc( size )
1906 return (void *) malloc( size );
1909 #ifdef YY_USE_PROTOS
1910 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1912 static void *yy_flex_realloc( ptr, size )
1917 /* The cast to (char *) in the following accommodates both
1918 * implementations that use char* generic pointers, and those
1919 * that use void* generic pointers. It works with the latter
1920 * because both ANSI C and C++ allow castless assignment from
1921 * any pointer type to void*, and deal with argument conversions
1922 * as though doing an assignment.
1924 return (void *) realloc( (char *) ptr, size );
1927 #ifdef YY_USE_PROTOS
1928 static void yy_flex_free( void *ptr )
1930 static void yy_flex_free( ptr )
1944 #line 307 "meta_lex_ind.l"
1947 /***************************************************************/
1948 /* 6. Auxiliary functions. */
1949 /***************************************************************/
1951 main(int argc, char *argv[])
1953 filename = malloc((sizeof('a')*2000));
1954 file_uri = malloc((sizeof('a')*2000));
1955 inductive_uri = malloc((sizeof('a')*2000));
1956 filename_prefix=argv[1];
1957 file_uri_prefix=argv[2];
1958 /* fprintf(stderr,"qua"); */
1959 yyin = fopen("tmp/inductive_type.xml", "r");
1965 FILE *out, *outrel, *outsort;
1967 if (!(out = fopen(filename,"w")))
1969 fprintf(stderr, "error in openinf file %s\n", filename);
1972 if (!(outrel = fopen("forward_rel.xml","a")))
1974 fprintf(stderr, "error in opening file forward_rel.xml\n");
1977 if (!(outsort = fopen("forward_sort.xml","a")))
1979 fprintf(stderr, "error in opening file forward_sort.xml\n");
1983 // We process the type
1985 fprintf(out,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
1986 fprintf(out,"<!DOCTYPE rdf:RDF [
1987 <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
1988 <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
1989 <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
1992 fprintf(out,"<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"&rdfns;\" xmlns:h=\"&hns;\" xmlns:hth=\"&hthns;\">\n");
1993 fprintf(out,"\t<h:Object rdf:about=\"");
1994 fprintf(out,"%s",file_uri);
1995 fprintf(out,"\">\n");
1996 print_all(file_uri,out,outrel,outsort);
1997 fprintf(out,"\t</h:Object>\n");
1998 fprintf(out,"</rdf:RDF>\n");
2004 search(uri,first_child,position,depth)
2009 if (position == MAINHYP)
2011 if (first_child == HERE)
2012 found = search_bucket(uri,MAINHYP,depth);
2014 found = search_bucket(uri,INHYP,0);
2016 else if (position == INCONCL)
2018 if (first_child == HERE)
2019 found = search_bucket(uri,MAINCONCL,depth);
2021 found = search_bucket(uri,INCONCL,0);
2025 found = search_bucket(uri,position,depth);
2026 /* if (found == NOTFOUND)
2027 printf( "pos = %d, uri = %s\n", position, uri); */