1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28 #ifndef YY_ALWAYS_INTERACTIVE
29 #ifndef YY_NEVER_INTERACTIVE
30 extern int isatty YY_PROTO(( int ));
35 /* Use prototypes in function declarations. */
38 /* The "const" storage-class-modifier is valid. */
41 #else /* ! __cplusplus */
49 #endif /* ! __cplusplus */
68 #define YY_PROTO(proto) proto
70 #define YY_PROTO(proto) ()
73 /* Returned upon end-of-file. */
76 /* Promotes a possibly negative, possibly signed char to an unsigned
77 * integer for use as an array index. If the signed char is negative,
78 * we want to instead treat it as an 8-bit unsigned char, hence the
81 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83 /* Enter a start condition. This macro really ought to take a parameter,
84 * but we do it the disgusting crufty way forced on us by the ()-less
85 * definition of BEGIN.
87 #define BEGIN yy_start = 1 + 2 *
89 /* Translate the current start state into a value that can be later handed
90 * to BEGIN to return to the state. The YYSTATE alias is for lex
93 #define YY_START ((yy_start - 1) / 2)
94 #define YYSTATE YY_START
96 /* Action number for EOF rule of a given start state. */
97 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99 /* Special action meaning "start processing a new file". */
100 #define YY_NEW_FILE yyrestart( yyin )
102 #define YY_END_OF_BUFFER_CHAR 0
104 /* Size of default input buffer. */
105 #define YY_BUF_SIZE 16384
107 typedef struct yy_buffer_state *YY_BUFFER_STATE;
110 extern FILE *yyin, *yyout;
112 #define EOB_ACT_CONTINUE_SCAN 0
113 #define EOB_ACT_END_OF_FILE 1
114 #define EOB_ACT_LAST_MATCH 2
116 /* The funky do-while in the following #define is used to turn the definition
117 * int a single C statement (which needs a semi-colon terminator). This
118 * avoids problems with code like:
120 * if ( condition_holds )
123 * do_something_else();
125 * Prior to using the do-while the compiler would get upset at the
126 * "else" because it interpreted the "if" statement as being all
127 * done when it reached the ';' after the yyless() call.
130 /* Return all but the first 'n' matched characters back to the input stream. */
135 /* Undo effects of setting up yytext. */ \
136 *yy_cp = yy_hold_char; \
137 YY_RESTORE_YY_MORE_OFFSET \
138 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
139 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
143 #define unput(c) yyunput( c, yytext_ptr )
145 /* The following is because we cannot portably get our hands on size_t
146 * (without autoconf's help, which isn't available because we want
147 * flex-generated scanners to compile on their own).
149 typedef unsigned int yy_size_t;
152 struct yy_buffer_state
156 char *yy_ch_buf; /* input buffer */
157 char *yy_buf_pos; /* current position in input buffer */
159 /* Size of input buffer in bytes, not including room for EOB
162 yy_size_t yy_buf_size;
164 /* Number of characters read into yy_ch_buf, not including EOB
169 /* Whether we "own" the buffer - i.e., we know we created it,
170 * and can realloc() it to grow it, and should free() it to
173 int yy_is_our_buffer;
175 /* Whether this is an "interactive" input source; if so, and
176 * if we're using stdio for input, then we want to use getc()
177 * instead of fread(), to make sure we stop fetching input after
180 int yy_is_interactive;
182 /* Whether we're considered to be at the beginning of a line.
183 * If so, '^' rules will be active on the next match, otherwise
188 /* Whether to try to fill the input buffer when we reach the
193 int yy_buffer_status;
194 #define YY_BUFFER_NEW 0
195 #define YY_BUFFER_NORMAL 1
196 /* When an EOF's been seen but there's still some text to process
197 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
198 * shouldn't try reading from the input source any more. We might
199 * still have a bunch of tokens to match, though, because of
200 * possible backing-up.
202 * When we actually see the EOF, we change the status to "new"
203 * (via yyrestart()), so that the user can continue scanning by
204 * just pointing yyin at a new input file.
206 #define YY_BUFFER_EOF_PENDING 2
209 static YY_BUFFER_STATE yy_current_buffer = 0;
211 /* We provide macros for accessing buffer states in case in the
212 * future we want to put the buffer states in a more general
215 #define YY_CURRENT_BUFFER yy_current_buffer
218 /* yy_hold_char holds the character lost when yytext is formed. */
219 static char yy_hold_char;
221 static int yy_n_chars; /* number of characters read into yy_ch_buf */
226 /* Points to current character in buffer. */
227 static char *yy_c_buf_p = (char *) 0;
228 static int yy_init = 1; /* whether we need to initialize */
229 static int yy_start = 0; /* start state number */
231 /* Flag which is used to allow yywrap()'s to do buffer switches
232 * instead of setting up a fresh yyin. A bit of a hack ...
234 static int yy_did_buffer_switch_on_eof;
236 void yyrestart YY_PROTO(( FILE *input_file ));
238 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
239 void yy_load_buffer_state YY_PROTO(( void ));
240 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
241 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
242 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
243 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
244 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
246 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
247 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
248 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
250 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
251 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
252 static void yy_flex_free YY_PROTO(( void * ));
254 #define yy_new_buffer yy_create_buffer
256 #define yy_set_interactive(is_interactive) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_is_interactive = is_interactive; \
263 #define yy_set_bol(at_bol) \
265 if ( ! yy_current_buffer ) \
266 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
267 yy_current_buffer->yy_at_bol = at_bol; \
270 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
272 typedef unsigned char YY_CHAR;
273 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
274 typedef int yy_state_type;
276 #define yytext_ptr yytext
278 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
279 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
280 static int yy_get_next_buffer YY_PROTO(( void ));
281 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
283 /* Done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext.
286 #define YY_DO_BEFORE_ACTION \
287 yytext_ptr = yy_bp; \
288 yyleng = (int) (yy_cp - yy_bp); \
289 yy_hold_char = *yy_cp; \
293 #define YY_NUM_RULES 21
294 #define YY_END_OF_BUFFER 22
295 static yyconst short int yy_accept[123] =
297 0, 0, 22, 7, 7, 7, 7, 0, 0, 0,
298 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
300 0, 0, 0, 0, 0, 0, 10, 0, 0, 12,
301 0, 14, 0, 0, 4, 0, 0, 0, 0, 0,
302 6, 0, 0, 0, 0, 0, 0, 0, 3, 0,
303 0, 0, 0, 0, 11, 15, 0, 0, 0, 0,
304 0, 0, 0, 0, 18, 0, 5, 8, 0, 0,
305 16, 0, 0, 0, 0, 0, 0, 9, 0, 0,
306 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
309 20, 2, 0, 0, 0, 17, 0, 0, 13, 0,
313 static yyconst int yy_ec[256] =
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 3, 1, 4, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 1, 1, 5, 6, 6, 6,
320 6, 6, 6, 6, 6, 6, 6, 1, 1, 7,
321 8, 9, 1, 1, 10, 11, 12, 13, 14, 15,
322 1, 1, 16, 1, 1, 17, 18, 19, 20, 1,
323 1, 21, 22, 23, 24, 25, 1, 26, 1, 1,
324 1, 1, 1, 1, 1, 1, 27, 28, 29, 30,
326 31, 32, 1, 1, 33, 1, 1, 34, 1, 35,
327 36, 37, 1, 38, 39, 40, 41, 42, 1, 1,
328 43, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 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,
337 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,
345 static yyconst int yy_meta[44] =
347 1, 1, 1, 2, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 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,
354 static yyconst short int yy_base[127] =
356 0, 1, 152, 153, 38, 115, 112, 0, 129, 132,
357 137, 122, 131, 124, 0, 112, 0, 109, 105, 109,
358 0, 113, 120, 114, 119, 114, 113, 95, 0, 96,
359 88, 122, 99, 2, 112, 105, 153, 115, 1, 153,
360 102, 153, 91, 89, 153, 87, 84, 116, 76, 84,
361 153, 91, 93, 102, 1, 95, 0, 86, 153, 73,
362 80, 0, 101, 100, 153, 153, 98, 85, 87, 92,
363 2, 76, 63, 94, 0, 44, 153, 153, 87, 78,
364 153, 72, 64, 59, 92, 55, 55, 153, 71, 59,
365 61, 83, 84, 46, 67, 46, 77, 81, 78, 46,
367 58, 50, 71, 62, 73, 47, 65, 68, 64, 42,
368 55, 153, 31, 48, 13, 153, 0, 18, 0, 2,
369 153, 153, 71, 5, 73, 0
372 static yyconst short int yy_def[127] =
374 123, 123, 122, 122, 122, 122, 122, 122, 122, 122,
375 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
376 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
377 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
378 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
379 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
380 122, 124, 122, 122, 122, 122, 122, 122, 122, 122,
381 122, 122, 122, 122, 124, 122, 122, 122, 122, 122,
382 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
383 122, 122, 122, 122, 122, 122, 125, 122, 122, 122,
385 122, 122, 125, 122, 122, 122, 122, 122, 122, 122,
386 122, 122, 122, 122, 122, 122, 126, 122, 126, 122,
387 122, 0, 122, 122, 122, 122
390 static yyconst short int yy_nxt[197] =
392 119, 71, 71, 71, 71, 75, 5, 5, 122, 27,
393 68, 30, 55, 122, 35, 122, 56, 122, 36, 122,
394 69, 122, 31, 122, 122, 122, 28, 19, 44, 20,
395 50, 45, 122, 51, 6, 6, 122, 122, 122, 122,
396 7, 7, 8, 82, 121, 86, 86, 120, 118, 9,
397 87, 117, 10, 116, 11, 12, 86, 86, 13, 14,
398 111, 87, 15, 109, 109, 109, 109, 16, 110, 115,
399 110, 4, 4, 103, 103, 114, 113, 112, 111, 104,
400 108, 107, 106, 99, 105, 104, 102, 101, 100, 99,
401 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
403 88, 85, 84, 83, 81, 80, 79, 78, 77, 76,
404 74, 73, 72, 70, 67, 66, 65, 64, 63, 62,
405 61, 60, 59, 58, 57, 54, 53, 52, 49, 48,
406 47, 46, 43, 42, 41, 40, 39, 38, 37, 34,
407 33, 32, 29, 26, 25, 24, 23, 22, 21, 18,
408 17, 122, 3, 122, 122, 122, 122, 122, 122, 122,
409 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
410 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
411 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
412 122, 122, 122, 122, 122, 122
416 static yyconst short int yy_chk[197] =
418 126, 57, 57, 71, 71, 124, 1, 2, 0, 15,
419 55, 17, 39, 0, 21, 0, 39, 0, 21, 0,
420 55, 0, 17, 0, 0, 0, 15, 8, 29, 8,
421 34, 29, 0, 34, 1, 2, 0, 0, 0, 0,
422 1, 2, 5, 71, 120, 76, 76, 118, 115, 5,
423 76, 114, 5, 113, 5, 5, 86, 86, 5, 5,
424 111, 86, 5, 104, 104, 109, 109, 5, 104, 110,
425 109, 123, 123, 125, 125, 108, 107, 106, 105, 103,
426 102, 101, 100, 99, 98, 97, 96, 95, 94, 93,
427 92, 91, 90, 89, 87, 85, 84, 83, 82, 80,
429 79, 74, 73, 72, 70, 69, 68, 67, 64, 63,
430 61, 60, 58, 56, 54, 53, 52, 50, 49, 48,
431 47, 46, 44, 43, 41, 38, 36, 35, 33, 32,
432 31, 30, 28, 27, 26, 25, 24, 23, 22, 20,
433 19, 18, 16, 14, 13, 12, 11, 10, 9, 7,
434 6, 3, 122, 122, 122, 122, 122, 122, 122, 122,
435 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
436 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
437 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
438 122, 122, 122, 122, 122, 122
442 static yy_state_type yy_last_accepting_state;
443 static char *yy_last_accepting_cpos;
445 /* The intent behind this definition is that it'll catch
446 * any uses of REJECT which flex missed.
448 #define REJECT reject_used_but_not_detected
449 #define yymore() yymore_used_but_not_detected
450 #define YY_MORE_ADJ 0
451 #define YY_RESTORE_YY_MORE_OFFSET
455 /******************************************************************/
456 /* Copyright (C) 2000, HELM Team */
458 /* This file is part of HELM, an Hypertextual, Electronic */
459 /* Library of Mathematics, developed at the Computer Science */
460 /* Department, University of Bologna, Italy. */
462 /* HELM is free software; you can redistribute it and/or */
463 /* modify it under the terms of the GNU General Public License */
464 /* as published by the Free Software Foundation; either version */
465 /* 2 of the License, or (at your option) any later version. */
467 /* HELM is distributed in the hope that it will be useful, */
468 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
469 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
470 /* GNU General Public License for more details. */
472 /* You should have received a copy of the GNU General Public */
473 /* License along with HELM; if not, write to the Free Software */
474 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, */
475 /* MA 02111-1307, USA. */
477 /* For details, see the HELM World-Wide-Web page, */
478 /* http://cs.unibo.it/helm/. */
479 /******************************************************************/
480 /***************************************************************/
482 /* Automatic Metadata Extractor */
483 /* First draft 11/12/2001, by Andrea Asperti */
484 /* more bugs added by domenico lordi on mon 12/17/2001 */
485 /***************************************************************/
486 /***************************************************************/
487 /* 1. Inclusion of header files. */
488 /***************************************************************/
489 #line 39 "meta_lex.l"
492 #include <sys/stat.h>
493 #include "sthandler.h"
494 /***************************************************************/
495 /* 2. Constants and Variables Definitions */
496 /***************************************************************/
497 #line 50 "meta_lex.l"
501 #define MUTCONSTRUCT 3
517 int found = NOTFOUND;
518 int position = INBODY;
519 int first_child = HERE;
520 int skip = 0; // boolean to skip the insertion of a URI
521 int no_open_source =0;
526 char *xpointer = "#xpointer(1/";
529 /***************************************************************/
530 /* 3. Regular definitions. */
531 /***************************************************************/
532 /***************************************************************/
534 /***************************************************************/
537 /* Macros after this point can all be overridden by user definitions in
541 #ifndef YY_SKIP_YYWRAP
543 extern "C" int yywrap YY_PROTO(( void ));
545 extern int yywrap YY_PROTO(( void ));
550 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
554 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
557 #ifdef YY_NEED_STRLEN
558 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
563 static int yyinput YY_PROTO(( void ));
565 static int input YY_PROTO(( void ));
570 static int yy_start_stack_ptr = 0;
571 static int yy_start_stack_depth = 0;
572 static int *yy_start_stack = 0;
573 #ifndef YY_NO_PUSH_STATE
574 static void yy_push_state YY_PROTO(( int new_state ));
576 #ifndef YY_NO_POP_STATE
577 static void yy_pop_state YY_PROTO(( void ));
579 #ifndef YY_NO_TOP_STATE
580 static int yy_top_state YY_PROTO(( void ));
584 #define YY_NO_PUSH_STATE 1
585 #define YY_NO_POP_STATE 1
586 #define YY_NO_TOP_STATE 1
589 #ifdef YY_MALLOC_DECL
597 /* Just try to get by without declaring the routines. This will fail
598 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
599 * or sizeof(void*) != sizeof(int).
604 /* Amount of stuff to slurp up with each read. */
605 #ifndef YY_READ_BUF_SIZE
606 #define YY_READ_BUF_SIZE 8192
609 /* Copy whatever the last rule matched to the standard output. */
612 /* This used to be an fputs(), but since the string might contain NUL's,
613 * we now use fwrite().
615 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
618 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
619 * is returned in "result".
622 #define YY_INPUT(buf,result,max_size) \
623 if ( yy_current_buffer->yy_is_interactive ) \
626 for ( n = 0; n < max_size && \
627 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
630 buf[n++] = (char) c; \
631 if ( c == EOF && ferror( yyin ) ) \
632 YY_FATAL_ERROR( "input in flex scanner failed" ); \
638 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
640 if( errno != EINTR) \
642 YY_FATAL_ERROR( "input in flex scanner failed" ); \
651 /* No semi-colon after return; correct usage is to write "yyterminate();" -
652 * we don't want an extra ';' after the "return" because that will cause
653 * some compilers to complain about unreachable statements.
656 #define yyterminate() return YY_NULL
659 /* Number of entries by which start-condition stack grows. */
660 #ifndef YY_START_STACK_INCR
661 #define YY_START_STACK_INCR 25
664 /* Report a fatal error. */
665 #ifndef YY_FATAL_ERROR
666 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
669 /* Default declaration of generated scanner - a define so the user can
670 * easily add parameters.
673 #define YY_DECL int yylex YY_PROTO(( void ))
676 /* Code executed at the beginning of each rule, after yytext and yyleng
679 #ifndef YY_USER_ACTION
680 #define YY_USER_ACTION
683 /* Code executed at the end of each rule. */
685 #define YY_BREAK break;
688 #define YY_RULE_SETUP \
693 register yy_state_type yy_current_state;
694 register char *yy_cp, *yy_bp;
697 #line 96 "meta_lex.l"
711 yy_start = 1; /* first start state */
719 if ( ! yy_current_buffer )
721 yy_create_buffer( yyin, YY_BUF_SIZE );
723 yy_load_buffer_state();
726 while ( 1 ) /* loops until end-of-file is reached */
730 /* Support of yytext. */
731 *yy_cp = yy_hold_char;
733 /* yy_bp points to the position in yy_ch_buf of the start of
738 yy_current_state = yy_start;
742 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
743 if ( yy_accept[yy_current_state] )
745 yy_last_accepting_state = yy_current_state;
746 yy_last_accepting_cpos = yy_cp;
748 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
750 yy_current_state = (int) yy_def[yy_current_state];
751 if ( yy_current_state >= 123 )
752 yy_c = yy_meta[(unsigned int) yy_c];
754 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
757 while ( yy_base[yy_current_state] != 153 );
760 yy_act = yy_accept[yy_current_state];
762 { /* have to back up */
763 yy_cp = yy_last_accepting_cpos;
764 yy_current_state = yy_last_accepting_state;
765 yy_act = yy_accept[yy_current_state];
771 do_action: /* This label is used only to access EOF actions. */
775 { /* beginning of action switch */
776 case 0: /* must back up */
777 /* undo the effects of YY_DO_BEFORE_ACTION */
778 *yy_cp = yy_hold_char;
779 yy_cp = yy_last_accepting_cpos;
780 yy_current_state = yy_last_accepting_state;
785 #line 98 "meta_lex.l"
787 position = INBODY; // Variables have both a body and a type
792 #line 102 "meta_lex.l"
794 position = INTYPE; // Variables have both a body and a type
798 #line 107 "meta_lex.l"
801 #line 107 "meta_lex.l"
803 if (position == INTYPE)
805 else if (position == MAINHYP)
811 #line 116 "meta_lex.l"
814 #line 116 "meta_lex.l"
816 if (position == INHYP)
819 if (no_open_source == 0)
826 else if (position == MAINHYP)
837 #line 137 "meta_lex.l"
842 #line 141 "meta_lex.l"
844 #line 142 "meta_lex.l"
846 #line 143 "meta_lex.l"
849 #line 143 "meta_lex.l"
856 #line 147 "meta_lex.l"
858 if (((position == INTYPE) | (position == MAINHYP)) &&
859 (first_child == HERE))
861 if (position == INTYPE) /* REL on the spine */
864 search("Rel",first_child,position,spine_depth);
866 else search("Rel",first_child,position,depth);
873 #line 161 "meta_lex.l"
875 if ((position == INTYPE) | (position == MAINHYP))
877 tmp=(char *)malloc((sizeof('a')*200));
880 if (position == INTYPE) /* SORT on the spine */
883 search(tmp,first_child,position,spine_depth);
885 else search(tmp,first_child,position,depth);
892 #line 177 "meta_lex.l"
900 #line 182 "meta_lex.l"
902 if (position == INTYPE) /* CONST on the spine */
909 #line 188 "meta_lex.l"
911 if (position == INTYPE) /* MUTIND on the spine */
918 #line 194 "meta_lex.l"
920 if (position == INTYPE) /* MUTCONSTRUCT on the spine */
922 where = MUTCONSTRUCT;
927 #line 200 "meta_lex.l"
930 uri=(char *)malloc((sizeof('a')*200));
935 if (position == INCONCL)
936 search(uri,first_child,position,spine_depth);
937 else search(uri,first_child,position,depth);
947 #line 217 "meta_lex.l"
949 if ((where == MUTIND) || (where == MUTCONSTRUCT))
950 { strsep(&yytext,&sep);
951 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
954 sprintf(tmp,"%d",tmp_n);
955 strcat(uri,"#xpointer(1/");
961 if (position == INCONCL)
962 search(uri,first_child,position,spine_depth);
963 else search(uri,first_child,position,depth);
967 first_child = AFTER;};
972 #line 239 "meta_lex.l"
974 if (where == MUTCONSTRUCT)
975 { strsep(&yytext,&sep);
976 tmp=(char *)malloc((sizeof(sep)*(strlen(yytext)+1)));
981 if (position == INCONCL)
982 search(uri,first_child,position,spine_depth);
983 else search(uri,first_child,position,depth);
987 first_child = AFTER;};
992 #line 258 "meta_lex.l"
996 case YY_STATE_EOF(INITIAL):
999 case YY_END_OF_BUFFER:
1001 /* Amount of text matched not including the EOB char. */
1002 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1004 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1005 *yy_cp = yy_hold_char;
1006 YY_RESTORE_YY_MORE_OFFSET
1008 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1010 /* We're scanning a new file or input source. It's
1011 * possible that this happened because the user
1012 * just pointed yyin at a new source and called
1013 * yylex(). If so, then we have to assure
1014 * consistency between yy_current_buffer and our
1015 * globals. Here is the right place to do so, because
1016 * this is the first action (other than possibly a
1017 * back-up) that will match for the new input source.
1019 yy_n_chars = yy_current_buffer->yy_n_chars;
1020 yy_current_buffer->yy_input_file = yyin;
1021 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1024 /* Note that here we test for yy_c_buf_p "<=" to the position
1025 * of the first EOB in the buffer, since yy_c_buf_p will
1026 * already have been incremented past the NUL character
1027 * (since all states make transitions on EOB to the
1028 * end-of-buffer state). Contrast this with the test
1031 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1032 { /* This was really a NUL. */
1033 yy_state_type yy_next_state;
1035 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1037 yy_current_state = yy_get_previous_state();
1039 /* Okay, we're now positioned to make the NUL
1040 * transition. We couldn't have
1041 * yy_get_previous_state() go ahead and do it
1042 * for us because it doesn't know how to deal
1043 * with the possibility of jamming (and we don't
1044 * want to build jamming into it because then it
1045 * will run more slowly).
1048 yy_next_state = yy_try_NUL_trans( yy_current_state );
1050 yy_bp = yytext_ptr + YY_MORE_ADJ;
1052 if ( yy_next_state )
1054 /* Consume the NUL. */
1055 yy_cp = ++yy_c_buf_p;
1056 yy_current_state = yy_next_state;
1063 goto yy_find_action;
1067 else switch ( yy_get_next_buffer() )
1069 case EOB_ACT_END_OF_FILE:
1071 yy_did_buffer_switch_on_eof = 0;
1075 /* Note: because we've taken care in
1076 * yy_get_next_buffer() to have set up
1077 * yytext, we can now set up
1078 * yy_c_buf_p so that if some total
1079 * hoser (like flex itself) wants to
1080 * call the scanner after we return the
1081 * YY_NULL, it'll still work - another
1082 * YY_NULL will get returned.
1084 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1086 yy_act = YY_STATE_EOF(YY_START);
1092 if ( ! yy_did_buffer_switch_on_eof )
1098 case EOB_ACT_CONTINUE_SCAN:
1100 yytext_ptr + yy_amount_of_matched_text;
1102 yy_current_state = yy_get_previous_state();
1105 yy_bp = yytext_ptr + YY_MORE_ADJ;
1108 case EOB_ACT_LAST_MATCH:
1110 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1112 yy_current_state = yy_get_previous_state();
1115 yy_bp = yytext_ptr + YY_MORE_ADJ;
1116 goto yy_find_action;
1123 "fatal flex scanner internal error--no action found" );
1124 } /* end of action switch */
1125 } /* end of scanning one token */
1126 } /* end of yylex */
1129 /* yy_get_next_buffer - try to read in a new buffer
1131 * Returns a code representing an action:
1132 * EOB_ACT_LAST_MATCH -
1133 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1134 * EOB_ACT_END_OF_FILE - end of file
1137 static int yy_get_next_buffer()
1139 register char *dest = yy_current_buffer->yy_ch_buf;
1140 register char *source = yytext_ptr;
1141 register int number_to_move, i;
1144 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1146 "fatal flex scanner internal error--end of buffer missed" );
1148 if ( yy_current_buffer->yy_fill_buffer == 0 )
1149 { /* Don't try to fill the buffer, so this is an EOF. */
1150 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1152 /* We matched a single character, the EOB, so
1153 * treat this as a final EOF.
1155 return EOB_ACT_END_OF_FILE;
1160 /* We matched some text prior to the EOB, first
1163 return EOB_ACT_LAST_MATCH;
1167 /* Try to read more data. */
1169 /* First move last chars to start of buffer. */
1170 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1172 for ( i = 0; i < number_to_move; ++i )
1173 *(dest++) = *(source++);
1175 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1176 /* don't do the read, it's not guaranteed to return an EOF,
1179 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1184 yy_current_buffer->yy_buf_size - number_to_move - 1;
1186 while ( num_to_read <= 0 )
1187 { /* Not enough room in the buffer - grow it. */
1188 #ifdef YY_USES_REJECT
1190 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1193 /* just a shorter name for the current buffer */
1194 YY_BUFFER_STATE b = yy_current_buffer;
1196 int yy_c_buf_p_offset =
1197 (int) (yy_c_buf_p - b->yy_ch_buf);
1199 if ( b->yy_is_our_buffer )
1201 int new_size = b->yy_buf_size * 2;
1203 if ( new_size <= 0 )
1204 b->yy_buf_size += b->yy_buf_size / 8;
1206 b->yy_buf_size *= 2;
1208 b->yy_ch_buf = (char *)
1209 /* Include room in for 2 EOB chars. */
1210 yy_flex_realloc( (void *) b->yy_ch_buf,
1211 b->yy_buf_size + 2 );
1214 /* Can't grow it, we don't own it. */
1217 if ( ! b->yy_ch_buf )
1219 "fatal error - scanner input buffer overflow" );
1221 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1223 num_to_read = yy_current_buffer->yy_buf_size -
1228 if ( num_to_read > YY_READ_BUF_SIZE )
1229 num_to_read = YY_READ_BUF_SIZE;
1231 /* Read in more data. */
1232 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1233 yy_n_chars, num_to_read );
1235 yy_current_buffer->yy_n_chars = yy_n_chars;
1238 if ( yy_n_chars == 0 )
1240 if ( number_to_move == YY_MORE_ADJ )
1242 ret_val = EOB_ACT_END_OF_FILE;
1248 ret_val = EOB_ACT_LAST_MATCH;
1249 yy_current_buffer->yy_buffer_status =
1250 YY_BUFFER_EOF_PENDING;
1255 ret_val = EOB_ACT_CONTINUE_SCAN;
1257 yy_n_chars += number_to_move;
1258 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1259 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1261 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1267 /* yy_get_previous_state - get the state just before the EOB char was reached */
1269 static yy_state_type yy_get_previous_state()
1271 register yy_state_type yy_current_state;
1272 register char *yy_cp;
1274 yy_current_state = yy_start;
1276 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1278 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1279 if ( yy_accept[yy_current_state] )
1281 yy_last_accepting_state = yy_current_state;
1282 yy_last_accepting_cpos = yy_cp;
1284 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1286 yy_current_state = (int) yy_def[yy_current_state];
1287 if ( yy_current_state >= 123 )
1288 yy_c = yy_meta[(unsigned int) yy_c];
1290 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1293 return yy_current_state;
1297 /* yy_try_NUL_trans - try to make a transition on the NUL character
1300 * next_state = yy_try_NUL_trans( current_state );
1303 #ifdef YY_USE_PROTOS
1304 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1306 static yy_state_type yy_try_NUL_trans( yy_current_state )
1307 yy_state_type yy_current_state;
1310 register int yy_is_jam;
1311 register char *yy_cp = yy_c_buf_p;
1313 register YY_CHAR yy_c = 1;
1314 if ( yy_accept[yy_current_state] )
1316 yy_last_accepting_state = yy_current_state;
1317 yy_last_accepting_cpos = yy_cp;
1319 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1321 yy_current_state = (int) yy_def[yy_current_state];
1322 if ( yy_current_state >= 123 )
1323 yy_c = yy_meta[(unsigned int) yy_c];
1325 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1326 yy_is_jam = (yy_current_state == 122);
1328 return yy_is_jam ? 0 : yy_current_state;
1333 #ifdef YY_USE_PROTOS
1334 static void yyunput( int c, register char *yy_bp )
1336 static void yyunput( c, yy_bp )
1338 register char *yy_bp;
1341 register char *yy_cp = yy_c_buf_p;
1343 /* undo effects of setting up yytext */
1344 *yy_cp = yy_hold_char;
1346 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1347 { /* need to shift things up to make room */
1348 /* +2 for EOB chars. */
1349 register int number_to_move = yy_n_chars + 2;
1350 register char *dest = &yy_current_buffer->yy_ch_buf[
1351 yy_current_buffer->yy_buf_size + 2];
1352 register char *source =
1353 &yy_current_buffer->yy_ch_buf[number_to_move];
1355 while ( source > yy_current_buffer->yy_ch_buf )
1356 *--dest = *--source;
1358 yy_cp += (int) (dest - source);
1359 yy_bp += (int) (dest - source);
1360 yy_current_buffer->yy_n_chars =
1361 yy_n_chars = yy_current_buffer->yy_buf_size;
1363 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1364 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1367 *--yy_cp = (char) c;
1371 yy_hold_char = *yy_cp;
1374 #endif /* ifndef YY_NO_UNPUT */
1378 static int yyinput()
1385 *yy_c_buf_p = yy_hold_char;
1387 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1389 /* yy_c_buf_p now points to the character we want to return.
1390 * If this occurs *before* the EOB characters, then it's a
1391 * valid NUL; if not, then we've hit the end of the buffer.
1393 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1394 /* This was really a NUL. */
1398 { /* need more input */
1399 int offset = yy_c_buf_p - yytext_ptr;
1402 switch ( yy_get_next_buffer() )
1404 case EOB_ACT_LAST_MATCH:
1405 /* This happens because yy_g_n_b()
1406 * sees that we've accumulated a
1407 * token and flags that we need to
1408 * try matching the token before
1409 * proceeding. But for input(),
1410 * there's no matching to consider.
1411 * So convert the EOB_ACT_LAST_MATCH
1412 * to EOB_ACT_END_OF_FILE.
1415 /* Reset buffer status. */
1420 case EOB_ACT_END_OF_FILE:
1425 if ( ! yy_did_buffer_switch_on_eof )
1434 case EOB_ACT_CONTINUE_SCAN:
1435 yy_c_buf_p = yytext_ptr + offset;
1441 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1442 *yy_c_buf_p = '\0'; /* preserve yytext */
1443 yy_hold_char = *++yy_c_buf_p;
1450 #ifdef YY_USE_PROTOS
1451 void yyrestart( FILE *input_file )
1453 void yyrestart( input_file )
1457 if ( ! yy_current_buffer )
1458 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1460 yy_init_buffer( yy_current_buffer, input_file );
1461 yy_load_buffer_state();
1465 #ifdef YY_USE_PROTOS
1466 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1468 void yy_switch_to_buffer( new_buffer )
1469 YY_BUFFER_STATE new_buffer;
1472 if ( yy_current_buffer == new_buffer )
1475 if ( yy_current_buffer )
1477 /* Flush out information for old buffer. */
1478 *yy_c_buf_p = yy_hold_char;
1479 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1480 yy_current_buffer->yy_n_chars = yy_n_chars;
1483 yy_current_buffer = new_buffer;
1484 yy_load_buffer_state();
1486 /* We don't actually know whether we did this switch during
1487 * EOF (yywrap()) processing, but the only time this flag
1488 * is looked at is after yywrap() is called, so it's safe
1489 * to go ahead and always set it.
1491 yy_did_buffer_switch_on_eof = 1;
1495 #ifdef YY_USE_PROTOS
1496 void yy_load_buffer_state( void )
1498 void yy_load_buffer_state()
1501 yy_n_chars = yy_current_buffer->yy_n_chars;
1502 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1503 yyin = yy_current_buffer->yy_input_file;
1504 yy_hold_char = *yy_c_buf_p;
1508 #ifdef YY_USE_PROTOS
1509 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1511 YY_BUFFER_STATE yy_create_buffer( file, size )
1518 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1520 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1522 b->yy_buf_size = size;
1524 /* yy_ch_buf has to be 2 characters longer than the size given because
1525 * we need to put in 2 end-of-buffer characters.
1527 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1528 if ( ! b->yy_ch_buf )
1529 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1531 b->yy_is_our_buffer = 1;
1533 yy_init_buffer( b, file );
1539 #ifdef YY_USE_PROTOS
1540 void yy_delete_buffer( YY_BUFFER_STATE b )
1542 void yy_delete_buffer( b )
1549 if ( b == yy_current_buffer )
1550 yy_current_buffer = (YY_BUFFER_STATE) 0;
1552 if ( b->yy_is_our_buffer )
1553 yy_flex_free( (void *) b->yy_ch_buf );
1555 yy_flex_free( (void *) b );
1562 #ifndef YY_ALWAYS_INTERACTIVE
1563 #ifndef YY_NEVER_INTERACTIVE
1564 extern int isatty YY_PROTO(( int ));
1569 #ifdef YY_USE_PROTOS
1570 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1572 void yy_init_buffer( b, file )
1579 yy_flush_buffer( b );
1581 b->yy_input_file = file;
1582 b->yy_fill_buffer = 1;
1584 #if YY_ALWAYS_INTERACTIVE
1585 b->yy_is_interactive = 1;
1587 #if YY_NEVER_INTERACTIVE
1588 b->yy_is_interactive = 0;
1590 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1596 #ifdef YY_USE_PROTOS
1597 void yy_flush_buffer( YY_BUFFER_STATE b )
1599 void yy_flush_buffer( b )
1609 /* We always need two end-of-buffer characters. The first causes
1610 * a transition to the end-of-buffer state. The second causes
1611 * a jam in that state.
1613 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1614 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1616 b->yy_buf_pos = &b->yy_ch_buf[0];
1619 b->yy_buffer_status = YY_BUFFER_NEW;
1621 if ( b == yy_current_buffer )
1622 yy_load_buffer_state();
1626 #ifndef YY_NO_SCAN_BUFFER
1627 #ifdef YY_USE_PROTOS
1628 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1630 YY_BUFFER_STATE yy_scan_buffer( base, size )
1638 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1639 base[size-1] != YY_END_OF_BUFFER_CHAR )
1640 /* They forgot to leave room for the EOB's. */
1643 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1645 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1647 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1648 b->yy_buf_pos = b->yy_ch_buf = base;
1649 b->yy_is_our_buffer = 0;
1650 b->yy_input_file = 0;
1651 b->yy_n_chars = b->yy_buf_size;
1652 b->yy_is_interactive = 0;
1654 b->yy_fill_buffer = 0;
1655 b->yy_buffer_status = YY_BUFFER_NEW;
1657 yy_switch_to_buffer( b );
1664 #ifndef YY_NO_SCAN_STRING
1665 #ifdef YY_USE_PROTOS
1666 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1668 YY_BUFFER_STATE yy_scan_string( yy_str )
1669 yyconst char *yy_str;
1673 for ( len = 0; yy_str[len]; ++len )
1676 return yy_scan_bytes( yy_str, len );
1681 #ifndef YY_NO_SCAN_BYTES
1682 #ifdef YY_USE_PROTOS
1683 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1685 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1686 yyconst char *bytes;
1695 /* Get memory for full buffer, including space for trailing EOB's. */
1697 buf = (char *) yy_flex_alloc( n );
1699 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1701 for ( i = 0; i < len; ++i )
1704 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1706 b = yy_scan_buffer( buf, n );
1708 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1710 /* It's okay to grow etc. this buffer, and we should throw it
1711 * away when we're done.
1713 b->yy_is_our_buffer = 1;
1720 #ifndef YY_NO_PUSH_STATE
1721 #ifdef YY_USE_PROTOS
1722 static void yy_push_state( int new_state )
1724 static void yy_push_state( new_state )
1728 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1732 yy_start_stack_depth += YY_START_STACK_INCR;
1733 new_size = yy_start_stack_depth * sizeof( int );
1735 if ( ! yy_start_stack )
1736 yy_start_stack = (int *) yy_flex_alloc( new_size );
1739 yy_start_stack = (int *) yy_flex_realloc(
1740 (void *) yy_start_stack, new_size );
1742 if ( ! yy_start_stack )
1744 "out of memory expanding start-condition stack" );
1747 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1754 #ifndef YY_NO_POP_STATE
1755 static void yy_pop_state()
1757 if ( --yy_start_stack_ptr < 0 )
1758 YY_FATAL_ERROR( "start-condition stack underflow" );
1760 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1765 #ifndef YY_NO_TOP_STATE
1766 static int yy_top_state()
1768 return yy_start_stack[yy_start_stack_ptr - 1];
1772 #ifndef YY_EXIT_FAILURE
1773 #define YY_EXIT_FAILURE 2
1776 #ifdef YY_USE_PROTOS
1777 static void yy_fatal_error( yyconst char msg[] )
1779 static void yy_fatal_error( msg )
1783 (void) fprintf( stderr, "%s\n", msg );
1784 exit( YY_EXIT_FAILURE );
1789 /* Redefine yyless() so it works in section 3 code. */
1795 /* Undo effects of setting up yytext. */ \
1796 yytext[yyleng] = yy_hold_char; \
1797 yy_c_buf_p = yytext + n; \
1798 yy_hold_char = *yy_c_buf_p; \
1799 *yy_c_buf_p = '\0'; \
1805 /* Internal utility routines. */
1808 #ifdef YY_USE_PROTOS
1809 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1811 static void yy_flex_strncpy( s1, s2, n )
1818 for ( i = 0; i < n; ++i )
1823 #ifdef YY_NEED_STRLEN
1824 #ifdef YY_USE_PROTOS
1825 static int yy_flex_strlen( yyconst char *s )
1827 static int yy_flex_strlen( s )
1832 for ( n = 0; s[n]; ++n )
1840 #ifdef YY_USE_PROTOS
1841 static void *yy_flex_alloc( yy_size_t size )
1843 static void *yy_flex_alloc( size )
1847 return (void *) malloc( size );
1850 #ifdef YY_USE_PROTOS
1851 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1853 static void *yy_flex_realloc( ptr, size )
1858 /* The cast to (char *) in the following accommodates both
1859 * implementations that use char* generic pointers, and those
1860 * that use void* generic pointers. It works with the latter
1861 * because both ANSI C and C++ allow castless assignment from
1862 * any pointer type to void*, and deal with argument conversions
1863 * as though doing an assignment.
1865 return (void *) realloc( (char *) ptr, size );
1868 #ifdef YY_USE_PROTOS
1869 static void yy_flex_free( void *ptr )
1871 static void yy_flex_free( ptr )
1885 #line 258 "meta_lex.l"
1888 /***************************************************************/
1889 /* 6. Auxiliary functions. */
1890 /***************************************************************/
1892 main(int argc, char *argv[])
1895 FILE *outrel, *outsort;
1897 init_symbol_table();
1898 if (!(outrel = fopen("forward_rel.rdf","a")))
1900 fprintf(stderr, "error in openinf file forward_rel.rdf\n");
1903 if (!(outsort = fopen("forward_sort.rdf","a")))
1905 fprintf(stderr, "error in openinf file forward_rel.rdf\n");
1908 // We process the body
1909 if (!stat("tmp/body.xml",&buf)) {
1910 yyin = fopen("tmp/body.xml", "r");
1916 // We process the type
1917 yyin = fopen("tmp/type.xml", "r");
1925 printf("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n");
1926 printf("<!DOCTYPE rdf:RDF [
1927 <!ENTITY rdfns 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
1928 <!ENTITY hthns 'http://www.cs.unibo.it/helm/schemas/schema-helmth#'>
1929 <!ENTITY hns 'http://www.cs.unibo.it/helm/schemas/schema-helm#'>
1933 printf("<rdf:RDF xml:lang=\"en\" xmlns:rdf=\"&rdfns;\" xmlns:h=\"&hns;\" xmlns:hth=\"&hthns;\">\n");
1934 printf("\t<h:Object rdf:about=\"");
1935 printf("%s",argv[1]);
1937 print_all(argv[1],outrel,outsort);
1938 printf("\t</h:Object>\n");
1939 printf("</rdf:RDF>\n");
1943 search(uri,first_child,position,depth)
1948 if (position == MAINHYP)
1950 if (first_child == HERE)
1951 found = search_bucket(uri,MAINHYP,depth);
1953 found = search_bucket(uri,INHYP,0);
1955 else if (position == INCONCL)
1957 if (first_child == HERE)
1958 found = search_bucket(uri,MAINCONCL,depth);
1960 found = search_bucket(uri,INCONCL,0);
1964 found = search_bucket(uri,position,depth);
1965 /* if (found == NOTFOUND)
1966 fprintf(stderr,"pos = %d, uri = %s\n", position, uri); */
1969 (first_child == HERE)
1971 if (position == MAINHYP)
1972 found = search_bucket(uri,MAINHYP,depth);
1973 else if (position == INCONCL)
1974 found = search_bucket(uri,MAINCONCL,0);
1975 else if (position == INHYP)
1976 found = search_bucket(uri,INHYP,0);
1977 if (found == NOTFOUND)
1978 printf( "pos = %d, uri = %s\n", MAINCONCL, uri);
1980 else if ((position == MAINHYP) && (first_child == AFTER))
1981 found = search_bucket(uri,INHYP,0);
1982 else found = search_bucket(uri,position,0);
1983 if (found == NOTFOUND)
1984 printf( "pos = %d, uri = %s\n", position, uri);