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)) &&
935 (first_child == HERE))
937 tmp=(char *)malloc((sizeof('a')*200));
940 if (position == INTYPE) /* SORT on the spine */
943 search(tmp,first_child,position,spine_depth);
945 else search(tmp,first_child,position,depth);
952 #line 227 "meta_lex_ind.l"
960 #line 232 "meta_lex_ind.l"
962 if (position == INTYPE) /* CONST on the spine */
969 #line 238 "meta_lex_ind.l"
971 if (position == INTYPE) /* MUTIND on the spine */
978 #line 244 "meta_lex_ind.l"
980 if (position == INTYPE) /* MUTCONSTRUCT on the spine */
982 where = MUTCONSTRUCT;
987 #line 250 "meta_lex_ind.l"
990 uri=(char *)malloc((sizeof('a')*200));
995 if (position == INCONCL)
996 search(uri,first_child,position,spine_depth);
997 else search(uri,first_child,position,depth);
1007 #line 267 "meta_lex_ind.l"
1009 if ((where == MUTIND) || (where == MUTCONSTRUCT))
1010 { strsep(&yytext,&sep);
1011 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1013 tmp_n = atoi(tmp)+1;
1014 sprintf(tmp,"%d",tmp_n);
1015 strcat(uri,"#xpointer(1/");
1018 if (where == MUTIND)
1021 if (position == INCONCL)
1022 search(uri,first_child,position,spine_depth);
1023 else search(uri,first_child,position,depth);
1027 first_child = AFTER;};
1032 #line 289 "meta_lex_ind.l"
1034 if (where == MUTCONSTRUCT)
1035 { strsep(&yytext,&sep);
1036 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
1041 if (position == INCONCL)
1042 search(uri,first_child,position,spine_depth);
1043 else search(uri,first_child,position,depth);
1047 first_child = AFTER;};
1052 #line 308 "meta_lex_ind.l"
1055 #line 1056 "lex.yy_ind.c"
1056 case YY_STATE_EOF(INITIAL):
1059 case YY_END_OF_BUFFER:
1061 /* Amount of text matched not including the EOB char. */
1062 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1064 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1065 *yy_cp = yy_hold_char;
1066 YY_RESTORE_YY_MORE_OFFSET
1068 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1070 /* We're scanning a new file or input source. It's
1071 * possible that this happened because the user
1072 * just pointed yyin at a new source and called
1073 * yylex(). If so, then we have to assure
1074 * consistency between yy_current_buffer and our
1075 * globals. Here is the right place to do so, because
1076 * this is the first action (other than possibly a
1077 * back-up) that will match for the new input source.
1079 yy_n_chars = yy_current_buffer->yy_n_chars;
1080 yy_current_buffer->yy_input_file = yyin;
1081 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1084 /* Note that here we test for yy_c_buf_p "<=" to the position
1085 * of the first EOB in the buffer, since yy_c_buf_p will
1086 * already have been incremented past the NUL character
1087 * (since all states make transitions on EOB to the
1088 * end-of-buffer state). Contrast this with the test
1091 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1092 { /* This was really a NUL. */
1093 yy_state_type yy_next_state;
1095 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1097 yy_current_state = yy_get_previous_state();
1099 /* Okay, we're now positioned to make the NUL
1100 * transition. We couldn't have
1101 * yy_get_previous_state() go ahead and do it
1102 * for us because it doesn't know how to deal
1103 * with the possibility of jamming (and we don't
1104 * want to build jamming into it because then it
1105 * will run more slowly).
1108 yy_next_state = yy_try_NUL_trans( yy_current_state );
1110 yy_bp = yytext_ptr + YY_MORE_ADJ;
1112 if ( yy_next_state )
1114 /* Consume the NUL. */
1115 yy_cp = ++yy_c_buf_p;
1116 yy_current_state = yy_next_state;
1123 goto yy_find_action;
1127 else switch ( yy_get_next_buffer() )
1129 case EOB_ACT_END_OF_FILE:
1131 yy_did_buffer_switch_on_eof = 0;
1135 /* Note: because we've taken care in
1136 * yy_get_next_buffer() to have set up
1137 * yytext, we can now set up
1138 * yy_c_buf_p so that if some total
1139 * hoser (like flex itself) wants to
1140 * call the scanner after we return the
1141 * YY_NULL, it'll still work - another
1142 * YY_NULL will get returned.
1144 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1146 yy_act = YY_STATE_EOF(YY_START);
1152 if ( ! yy_did_buffer_switch_on_eof )
1158 case EOB_ACT_CONTINUE_SCAN:
1160 yytext_ptr + yy_amount_of_matched_text;
1162 yy_current_state = yy_get_previous_state();
1165 yy_bp = yytext_ptr + YY_MORE_ADJ;
1168 case EOB_ACT_LAST_MATCH:
1170 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1172 yy_current_state = yy_get_previous_state();
1175 yy_bp = yytext_ptr + YY_MORE_ADJ;
1176 goto yy_find_action;
1183 "fatal flex scanner internal error--no action found" );
1184 } /* end of action switch */
1185 } /* end of scanning one token */
1186 } /* end of yylex */
1189 /* yy_get_next_buffer - try to read in a new buffer
1191 * Returns a code representing an action:
1192 * EOB_ACT_LAST_MATCH -
1193 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1194 * EOB_ACT_END_OF_FILE - end of file
1197 static int yy_get_next_buffer()
1199 register char *dest = yy_current_buffer->yy_ch_buf;
1200 register char *source = yytext_ptr;
1201 register int number_to_move, i;
1204 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1206 "fatal flex scanner internal error--end of buffer missed" );
1208 if ( yy_current_buffer->yy_fill_buffer == 0 )
1209 { /* Don't try to fill the buffer, so this is an EOF. */
1210 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1212 /* We matched a single character, the EOB, so
1213 * treat this as a final EOF.
1215 return EOB_ACT_END_OF_FILE;
1220 /* We matched some text prior to the EOB, first
1223 return EOB_ACT_LAST_MATCH;
1227 /* Try to read more data. */
1229 /* First move last chars to start of buffer. */
1230 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1232 for ( i = 0; i < number_to_move; ++i )
1233 *(dest++) = *(source++);
1235 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1236 /* don't do the read, it's not guaranteed to return an EOF,
1239 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1244 yy_current_buffer->yy_buf_size - number_to_move - 1;
1246 while ( num_to_read <= 0 )
1247 { /* Not enough room in the buffer - grow it. */
1248 #ifdef YY_USES_REJECT
1250 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1253 /* just a shorter name for the current buffer */
1254 YY_BUFFER_STATE b = yy_current_buffer;
1256 int yy_c_buf_p_offset =
1257 (int) (yy_c_buf_p - b->yy_ch_buf);
1259 if ( b->yy_is_our_buffer )
1261 int new_size = b->yy_buf_size * 2;
1263 if ( new_size <= 0 )
1264 b->yy_buf_size += b->yy_buf_size / 8;
1266 b->yy_buf_size *= 2;
1268 b->yy_ch_buf = (char *)
1269 /* Include room in for 2 EOB chars. */
1270 yy_flex_realloc( (void *) b->yy_ch_buf,
1271 b->yy_buf_size + 2 );
1274 /* Can't grow it, we don't own it. */
1277 if ( ! b->yy_ch_buf )
1279 "fatal error - scanner input buffer overflow" );
1281 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1283 num_to_read = yy_current_buffer->yy_buf_size -
1288 if ( num_to_read > YY_READ_BUF_SIZE )
1289 num_to_read = YY_READ_BUF_SIZE;
1291 /* Read in more data. */
1292 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1293 yy_n_chars, num_to_read );
1295 yy_current_buffer->yy_n_chars = yy_n_chars;
1298 if ( yy_n_chars == 0 )
1300 if ( number_to_move == YY_MORE_ADJ )
1302 ret_val = EOB_ACT_END_OF_FILE;
1308 ret_val = EOB_ACT_LAST_MATCH;
1309 yy_current_buffer->yy_buffer_status =
1310 YY_BUFFER_EOF_PENDING;
1315 ret_val = EOB_ACT_CONTINUE_SCAN;
1317 yy_n_chars += number_to_move;
1318 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1319 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1321 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1327 /* yy_get_previous_state - get the state just before the EOB char was reached */
1329 static yy_state_type yy_get_previous_state()
1331 register yy_state_type yy_current_state;
1332 register char *yy_cp;
1334 yy_current_state = yy_start;
1336 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1338 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1339 if ( yy_accept[yy_current_state] )
1341 yy_last_accepting_state = yy_current_state;
1342 yy_last_accepting_cpos = yy_cp;
1344 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1346 yy_current_state = (int) yy_def[yy_current_state];
1347 if ( yy_current_state >= 138 )
1348 yy_c = yy_meta[(unsigned int) yy_c];
1350 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1353 return yy_current_state;
1357 /* yy_try_NUL_trans - try to make a transition on the NUL character
1360 * next_state = yy_try_NUL_trans( current_state );
1363 #ifdef YY_USE_PROTOS
1364 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1366 static yy_state_type yy_try_NUL_trans( yy_current_state )
1367 yy_state_type yy_current_state;
1370 register int yy_is_jam;
1371 register char *yy_cp = yy_c_buf_p;
1373 register YY_CHAR yy_c = 1;
1374 if ( yy_accept[yy_current_state] )
1376 yy_last_accepting_state = yy_current_state;
1377 yy_last_accepting_cpos = yy_cp;
1379 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1381 yy_current_state = (int) yy_def[yy_current_state];
1382 if ( yy_current_state >= 138 )
1383 yy_c = yy_meta[(unsigned int) yy_c];
1385 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1386 yy_is_jam = (yy_current_state == 137);
1388 return yy_is_jam ? 0 : yy_current_state;
1393 #ifdef YY_USE_PROTOS
1394 static void yyunput( int c, register char *yy_bp )
1396 static void yyunput( c, yy_bp )
1398 register char *yy_bp;
1401 register char *yy_cp = yy_c_buf_p;
1403 /* undo effects of setting up yytext */
1404 *yy_cp = yy_hold_char;
1406 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1407 { /* need to shift things up to make room */
1408 /* +2 for EOB chars. */
1409 register int number_to_move = yy_n_chars + 2;
1410 register char *dest = &yy_current_buffer->yy_ch_buf[
1411 yy_current_buffer->yy_buf_size + 2];
1412 register char *source =
1413 &yy_current_buffer->yy_ch_buf[number_to_move];
1415 while ( source > yy_current_buffer->yy_ch_buf )
1416 *--dest = *--source;
1418 yy_cp += (int) (dest - source);
1419 yy_bp += (int) (dest - source);
1420 yy_current_buffer->yy_n_chars =
1421 yy_n_chars = yy_current_buffer->yy_buf_size;
1423 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1424 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1427 *--yy_cp = (char) c;
1431 yy_hold_char = *yy_cp;
1434 #endif /* ifndef YY_NO_UNPUT */
1438 static int yyinput()
1445 *yy_c_buf_p = yy_hold_char;
1447 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1449 /* yy_c_buf_p now points to the character we want to return.
1450 * If this occurs *before* the EOB characters, then it's a
1451 * valid NUL; if not, then we've hit the end of the buffer.
1453 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1454 /* This was really a NUL. */
1458 { /* need more input */
1459 int offset = yy_c_buf_p - yytext_ptr;
1462 switch ( yy_get_next_buffer() )
1464 case EOB_ACT_LAST_MATCH:
1465 /* This happens because yy_g_n_b()
1466 * sees that we've accumulated a
1467 * token and flags that we need to
1468 * try matching the token before
1469 * proceeding. But for input(),
1470 * there's no matching to consider.
1471 * So convert the EOB_ACT_LAST_MATCH
1472 * to EOB_ACT_END_OF_FILE.
1475 /* Reset buffer status. */
1480 case EOB_ACT_END_OF_FILE:
1485 if ( ! yy_did_buffer_switch_on_eof )
1494 case EOB_ACT_CONTINUE_SCAN:
1495 yy_c_buf_p = yytext_ptr + offset;
1501 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1502 *yy_c_buf_p = '\0'; /* preserve yytext */
1503 yy_hold_char = *++yy_c_buf_p;
1510 #ifdef YY_USE_PROTOS
1511 void yyrestart( FILE *input_file )
1513 void yyrestart( input_file )
1517 if ( ! yy_current_buffer )
1518 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1520 yy_init_buffer( yy_current_buffer, input_file );
1521 yy_load_buffer_state();
1525 #ifdef YY_USE_PROTOS
1526 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1528 void yy_switch_to_buffer( new_buffer )
1529 YY_BUFFER_STATE new_buffer;
1532 if ( yy_current_buffer == new_buffer )
1535 if ( yy_current_buffer )
1537 /* Flush out information for old buffer. */
1538 *yy_c_buf_p = yy_hold_char;
1539 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1540 yy_current_buffer->yy_n_chars = yy_n_chars;
1543 yy_current_buffer = new_buffer;
1544 yy_load_buffer_state();
1546 /* We don't actually know whether we did this switch during
1547 * EOF (yywrap()) processing, but the only time this flag
1548 * is looked at is after yywrap() is called, so it's safe
1549 * to go ahead and always set it.
1551 yy_did_buffer_switch_on_eof = 1;
1555 #ifdef YY_USE_PROTOS
1556 void yy_load_buffer_state( void )
1558 void yy_load_buffer_state()
1561 yy_n_chars = yy_current_buffer->yy_n_chars;
1562 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1563 yyin = yy_current_buffer->yy_input_file;
1564 yy_hold_char = *yy_c_buf_p;
1568 #ifdef YY_USE_PROTOS
1569 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1571 YY_BUFFER_STATE yy_create_buffer( file, size )
1578 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1580 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1582 b->yy_buf_size = size;
1584 /* yy_ch_buf has to be 2 characters longer than the size given because
1585 * we need to put in 2 end-of-buffer characters.
1587 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1588 if ( ! b->yy_ch_buf )
1589 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1591 b->yy_is_our_buffer = 1;
1593 yy_init_buffer( b, file );
1599 #ifdef YY_USE_PROTOS
1600 void yy_delete_buffer( YY_BUFFER_STATE b )
1602 void yy_delete_buffer( b )
1609 if ( b == yy_current_buffer )
1610 yy_current_buffer = (YY_BUFFER_STATE) 0;
1612 if ( b->yy_is_our_buffer )
1613 yy_flex_free( (void *) b->yy_ch_buf );
1615 yy_flex_free( (void *) b );
1622 #ifndef YY_ALWAYS_INTERACTIVE
1623 #ifndef YY_NEVER_INTERACTIVE
1624 extern int isatty YY_PROTO(( int ));
1629 #ifdef YY_USE_PROTOS
1630 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1632 void yy_init_buffer( b, file )
1639 yy_flush_buffer( b );
1641 b->yy_input_file = file;
1642 b->yy_fill_buffer = 1;
1644 #if YY_ALWAYS_INTERACTIVE
1645 b->yy_is_interactive = 1;
1647 #if YY_NEVER_INTERACTIVE
1648 b->yy_is_interactive = 0;
1650 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1656 #ifdef YY_USE_PROTOS
1657 void yy_flush_buffer( YY_BUFFER_STATE b )
1659 void yy_flush_buffer( b )
1669 /* We always need two end-of-buffer characters. The first causes
1670 * a transition to the end-of-buffer state. The second causes
1671 * a jam in that state.
1673 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1674 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1676 b->yy_buf_pos = &b->yy_ch_buf[0];
1679 b->yy_buffer_status = YY_BUFFER_NEW;
1681 if ( b == yy_current_buffer )
1682 yy_load_buffer_state();
1686 #ifndef YY_NO_SCAN_BUFFER
1687 #ifdef YY_USE_PROTOS
1688 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1690 YY_BUFFER_STATE yy_scan_buffer( base, size )
1698 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1699 base[size-1] != YY_END_OF_BUFFER_CHAR )
1700 /* They forgot to leave room for the EOB's. */
1703 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1705 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1707 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1708 b->yy_buf_pos = b->yy_ch_buf = base;
1709 b->yy_is_our_buffer = 0;
1710 b->yy_input_file = 0;
1711 b->yy_n_chars = b->yy_buf_size;
1712 b->yy_is_interactive = 0;
1714 b->yy_fill_buffer = 0;
1715 b->yy_buffer_status = YY_BUFFER_NEW;
1717 yy_switch_to_buffer( b );
1724 #ifndef YY_NO_SCAN_STRING
1725 #ifdef YY_USE_PROTOS
1726 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1728 YY_BUFFER_STATE yy_scan_string( yy_str )
1729 yyconst char *yy_str;
1733 for ( len = 0; yy_str[len]; ++len )
1736 return yy_scan_bytes( yy_str, len );
1741 #ifndef YY_NO_SCAN_BYTES
1742 #ifdef YY_USE_PROTOS
1743 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1745 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1746 yyconst char *bytes;
1755 /* Get memory for full buffer, including space for trailing EOB's. */
1757 buf = (char *) yy_flex_alloc( n );
1759 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1761 for ( i = 0; i < len; ++i )
1764 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1766 b = yy_scan_buffer( buf, n );
1768 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1770 /* It's okay to grow etc. this buffer, and we should throw it
1771 * away when we're done.
1773 b->yy_is_our_buffer = 1;
1780 #ifndef YY_NO_PUSH_STATE
1781 #ifdef YY_USE_PROTOS
1782 static void yy_push_state( int new_state )
1784 static void yy_push_state( new_state )
1788 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1792 yy_start_stack_depth += YY_START_STACK_INCR;
1793 new_size = yy_start_stack_depth * sizeof( int );
1795 if ( ! yy_start_stack )
1796 yy_start_stack = (int *) yy_flex_alloc( new_size );
1799 yy_start_stack = (int *) yy_flex_realloc(
1800 (void *) yy_start_stack, new_size );
1802 if ( ! yy_start_stack )
1804 "out of memory expanding start-condition stack" );
1807 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1814 #ifndef YY_NO_POP_STATE
1815 static void yy_pop_state()
1817 if ( --yy_start_stack_ptr < 0 )
1818 YY_FATAL_ERROR( "start-condition stack underflow" );
1820 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1825 #ifndef YY_NO_TOP_STATE
1826 static int yy_top_state()
1828 return yy_start_stack[yy_start_stack_ptr - 1];
1832 #ifndef YY_EXIT_FAILURE
1833 #define YY_EXIT_FAILURE 2
1836 #ifdef YY_USE_PROTOS
1837 static void yy_fatal_error( yyconst char msg[] )
1839 static void yy_fatal_error( msg )
1843 (void) fprintf( stderr, "%s\n", msg );
1844 exit( YY_EXIT_FAILURE );
1849 /* Redefine yyless() so it works in section 3 code. */
1855 /* Undo effects of setting up yytext. */ \
1856 yytext[yyleng] = yy_hold_char; \
1857 yy_c_buf_p = yytext + n; \
1858 yy_hold_char = *yy_c_buf_p; \
1859 *yy_c_buf_p = '\0'; \
1865 /* Internal utility routines. */
1868 #ifdef YY_USE_PROTOS
1869 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1871 static void yy_flex_strncpy( s1, s2, n )
1878 for ( i = 0; i < n; ++i )
1883 #ifdef YY_NEED_STRLEN
1884 #ifdef YY_USE_PROTOS
1885 static int yy_flex_strlen( yyconst char *s )
1887 static int yy_flex_strlen( s )
1892 for ( n = 0; s[n]; ++n )
1900 #ifdef YY_USE_PROTOS
1901 static void *yy_flex_alloc( yy_size_t size )
1903 static void *yy_flex_alloc( size )
1907 return (void *) malloc( size );
1910 #ifdef YY_USE_PROTOS
1911 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1913 static void *yy_flex_realloc( ptr, size )
1918 /* The cast to (char *) in the following accommodates both
1919 * implementations that use char* generic pointers, and those
1920 * that use void* generic pointers. It works with the latter
1921 * because both ANSI C and C++ allow castless assignment from
1922 * any pointer type to void*, and deal with argument conversions
1923 * as though doing an assignment.
1925 return (void *) realloc( (char *) ptr, size );
1928 #ifdef YY_USE_PROTOS
1929 static void yy_flex_free( void *ptr )
1931 static void yy_flex_free( ptr )
1945 #line 308 "meta_lex_ind.l"
1948 /***************************************************************/
1949 /* 6. Auxiliary functions. */
1950 /***************************************************************/
1952 main(int argc, char *argv[])
1954 filename = malloc((sizeof('a')*2000));
1955 file_uri = malloc((sizeof('a')*2000));
1956 inductive_uri = malloc((sizeof('a')*2000));
1957 filename_prefix=argv[1];
1958 file_uri_prefix=argv[2];
1959 /* fprintf(stderr,"qua"); */
1960 yyin = fopen("tmp/inductive_type.xml", "r");
1966 FILE *out, *outrel, *outsort;
1968 if (!(out = fopen(filename,"w")))
1970 fprintf(stderr, "error in openinf file %s\n", filename);
1973 if (!(outrel = fopen("forward_rel.rdf","a")))
1975 fprintf(stderr, "error in openinf file forward_rel.rdf\n");
1978 if (!(outsort = fopen("forward_sort.rdf","a")))
1980 fprintf(stderr, "error in openinf file forward_rel.rdf\n");
1984 // We process the type
1986 fprintf(out,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
1987 fprintf(out,"<!DOCTYPE rdf:RDF [
1988 <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
1989 <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
1990 <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
1993 fprintf(out,"<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"&rdfns;\" xmlns:h=\"&hns;\" xmlns:hth=\"&hthns;\">\n");
1994 fprintf(out,"\t<h:Object rdf:about=\"");
1995 fprintf(out,"%s",file_uri);
1996 fprintf(out,"\">\n");
1997 print_all(file_uri,out,outrel,outsort);
1998 fprintf(out,"\t</h:Object>\n");
1999 fprintf(out,"</rdf:RDF>\n");
2005 search(uri,first_child,position,depth)
2010 if (position == MAINHYP)
2012 if (first_child == HERE)
2013 found = search_bucket(uri,MAINHYP,depth);
2015 found = search_bucket(uri,INHYP,0);
2017 else if (position == INCONCL)
2019 if (first_child == HERE)
2020 found = search_bucket(uri,MAINCONCL,depth);
2022 found = search_bucket(uri,INCONCL,0);
2026 found = search_bucket(uri,position,depth);
2027 /* if (found == NOTFOUND)
2028 printf( "pos = %d, uri = %s\n", position, uri); */