X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmetadata%2Fcreate_V7_mowgli%2FMETADATA%2Fmeta_lex_ind.l;h=acf86244658752e9388088e775fb963d18ee5e7e;hb=89262281b6e83bd2321150f81f1a0583645eb0c8;hp=6d09578f90a94a7673efaa7e7d6b81c03485ca5c;hpb=0e6b8620b9c128c3f256c00b422cee7708321171;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 6d09578f9..acf862446 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.xml\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; } + + + +