X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmetadata%2Fcreate_V7_mowgli%2FMETADATA%2Fmeta_lex_ind.l;h=a7a62666f64219d6ea4ea293935f50645e2682e2;hb=cb9f345924b8595b2e4922326ff335af133e46ce;hp=7fd23b21aa936a6f9293976685befe2947189b63;hpb=49e52032242e39eba0cf24ca16a37c84b52cc356;p=helm.git diff --git a/helm/metadata/create_V7_mowgli/METADATA/meta_lex_ind.l b/helm/metadata/create_V7_mowgli/METADATA/meta_lex_ind.l index 7fd23b21a..a7a62666f 100644 --- a/helm/metadata/create_V7_mowgli/METADATA/meta_lex_ind.l +++ b/helm/metadata/create_V7_mowgli/METADATA/meta_lex_ind.l @@ -38,6 +38,7 @@ %{ #include #include +#include #include "sthandler_ind.h" %} @@ -50,6 +51,7 @@ #define CONST 1 #define MUTIND 2 #define MUTCONSTRUCT 3 +#define SORT 4 #define INBODY 0 #define MAINHYP 1 @@ -65,12 +67,14 @@ int where = NOWHERE; int found = NOTFOUND; -int position = INTYPE; +int position = INBODY; int first_child = HERE; int skip = 0; // boolean to skip the insertion of a URI int no_open_source =0; +int spine_depth = 0; +int depth = 0; int tmp_n; -int inductive_type =0; +int inductive_type = 0; int constructor = 0; int deep_type = 0; char sep = '"'; @@ -82,48 +86,30 @@ char *file_uri; char *inductive_uri; char *filename_prefix; char *file_uri_prefix; - %} -/*%x deeptype*/ - - /***************************************************************/ /* 3. Regular definitions. */ /***************************************************************/ uri [^"]+ -digits [0-9]+ +digits [0-9]+ +value [^"]+ /***************************************************************/ /* 4. Rules. */ /***************************************************************/ -/* -"" { - BEGIN(deeptype); - deep_type++; - } - -"" { - deep_type++; - } - -"" { - deep_type--; - if (deeptype == 0) BEGIN(0); - } - -.|\n { - } -*/ %% "" { tmp = (char *)malloc(sizeof('a')*128); strcpy(filename,filename_prefix); - fprintf(stderr,"tre"); + /* fprintf(stderr,"tre"); */ strcpy(file_uri,file_uri_prefix); sprintf(tmp,",%d.xml", inductive_type); - fprintf(stderr,"quattro"); + /* fprintf(stderr,"quattro"); */ strcat(filename,tmp); sprintf(tmp,"#xpointer(1/%d)", inductive_type); strcat(file_uri,tmp); - fprintf(stderr,"cinque"); + /* fprintf(stderr,"cinque"); */ free(tmp); print_file(); } "\n\n"); - fprintf(out,"\n"); - fprintf(out,"\t\n"); - print_all(out); - fprintf(out,"\t\n"); - fprintf(out,"\n"); - fclose(out); + fprintf(stderr, "error in openinf file forward_rel.rdf\n"); + exit(-1); } + + // We process the type + + fprintf(out,"\n\n"); +fprintf(out," + + + + ]>\n"); + fprintf(out,"\n"); + fprintf(out,"\t\n"); + print_all(file_uri,out,outrel,outsort); + fprintf(out,"\t\n"); + fprintf(out,"\n"); + fclose(out); + fclose(outrel); + fclose(outsort); } -search(uri,first_child,position) +search(uri,first_child,position,depth) char *uri; int first_child; int position; { - if (first_child == HERE) - { - if (position == INHYP) - found = search_bucket(uri,MAINHYP); - else if (position == INCONCL) - found = search_bucket(uri,MAINCONCL); - /* if (found == NOTFOUND) - printf( "pos = %d, uri = %s\n", MAINCONCL, uri); */ - } - else found = search_bucket(uri,position); - /* if (found == NOTFOUND) - printf( "pos = %d, uri = %s\n", position, uri); */ - } + if (position == MAINHYP) + { + if (first_child == HERE) + found = search_bucket(uri,MAINHYP,depth); + else + found = search_bucket(uri,INHYP,0); + } + else if (position == INCONCL) + { + if (first_child == HERE) + found = search_bucket(uri,MAINCONCL,depth); + else + found = search_bucket(uri,INCONCL,0); + } + + else + found = search_bucket(uri,position,depth); + /* if (found == NOTFOUND) + printf( "pos = %d, uri = %s\n", position, uri); */ +} + int yywrap() { return 1; } + + + +