make_proper_main.c

Go to the documentation of this file.
00001 /******************************************************************************
00002  *                                S Y N T A X
00003  *-----------------------------------------------------------------------------
00004  *   Copyright (C) 1972-2008 INRIA (Institut National de Recherche en
00005  *   Informatique et Automatique)
00006  *-----------------------------------------------------------------------------
00007  *   URL: http://syntax.gforge.inria.fr
00008  *-----------------------------------------------------------------------------
00009  *   The source code of SYNTAX is distributed with two different licenses,
00010  *   depending on the files:
00011  *   - The recursive content of src/ and incl/ and the non-recursive content
00012  *     of SYNTAX's root directory are distributed under the CeCILL-C license
00013  *   - The recursive content of all other repertories is distributed under
00014  *     the CeCILL license
00015  *   All code produced by SYNTAX must be considered as being under the
00016  *   CeCILL-C license. Information about the CeCILL and CeCILL-C licenses
00017  *   can be found at, e.g., http://www.cecill.fr
00018  *****************************************************************************/
00019 /*** THIS FILE IS NOT PART OF THE SYNTAX LIBRARY libsx.a ***/ 
00020 
00021 
00022 
00023 /* Main module for "make_proper" a SYNTAX module which outputs a CFG in BNF format
00024    From both an input CFG (%include LC_TABLES_H) which has been produced by an
00025    execution of bnf -huge L.bnf > L_huge.h (L_huge.h and LC_TABLES_H are synonyms)
00026    and a source text which is a list of terminal symbols.  This list is converted into
00027    T' a subset of T (option -exclude).  The proper subgrammar whose set of terminals is T'
00028    is printed on stdout using the SYNTAX library module lexicalizer_mngr.c */
00029 
00030 
00031 
00032 static char ME [] = "make_proper_main";
00033 
00034 #include "sxversion.h"
00035 #include "sxunix.h"
00036 char WHAT_MAKE_PROPER_MAIN[] = "@(#)SYNTAX - $Id: make_proper_main.c 1579 2008-09-16 11:24:22Z sagot $" WHAT_DEBUG;
00037 
00038 //#ifdef LC_TABLES_H
00039 /* On compile les tables "left_corner" ... */
00040 /* ... uniquement celles dont on va avoir besoin ds lexicalizer_mngr */
00041 
00042 #define def_lispro
00043 #define def_prolis
00044 #define def_prolon
00045 #define def_lhs
00046 #define def_BVIDE
00047 #define def_npg
00048 #define def_numpg
00049 #define def_npd
00050 #define def_numpd
00051 #define def_ntstring
00052 #define def_tstring
00053 
00054 #define def_multiple_t_item_set
00055 #define def_sxdfa_comb_inflected_form
00056 /* Attention depuis le 17/01/08 le dictionnaire des terminaux est sous la forme d'un sxdfa_comb (voir "fsa.h") et
00057    non plus sous la forme d'un sxword */
00058 
00059 #include LC_TABLES_H
00060 //#endif /* LC_TABLES_H */
00061 
00062 /* Pour avoir la definition et l'initialisation de spf faite ici par sxspf.h et celle de idag faite par udag_scanner.h */
00063 #define SX_DFN_EXT_VAR2
00064 #include "sxspf.h"
00065 #include "varstr.h"
00066 #include "udag_scanner.h"
00067 
00068 SXINT n;
00069 SXBOOLEAN is_print_time;
00070 
00071 VARSTR   concat_ff_tstr (VARSTR vstr, char* ff, int Tpq) {return NULL;}
00072 struct sxtoken *tok_no2tok (int tok_no) {return NULL;}
00073 int      get_SEMLEX_lahead () {return 0;}
00074 void     local_fill_Tij2tok_no () {}
00075 void fill_Tij2tok_no () {}
00076 
00077 
00078 extern struct sxtables  sxtables;
00079 extern SXBA            basic_item_set; 
00080 static VARSTR          vstr;
00081 
00082 /*---------------*/
00083 /*    options    */
00084 /*---------------*/
00085 
00086 
00087 static SXBOOLEAN    is_help, is_exclude, is_prod_mapping, is_terminal_mapping, is_non_terminal_mapping;
00088 
00089 #define SXEOF   (-tmax)
00090 
00091 static char Usage [] = "\
00092 Usage:\t%s [options] [file]\n\
00093 options=\t--help,\n\
00094 \t\t-v, -verbose,\n\
00095 \t\t-e, -exclude,\n\
00096 \t\t-pm, -prod_mapping,\n\
00097 \t\t-tm, -terminal_mapping,\n\
00098 \t\t-nm, -non_terminal_mapping,\n\
00099 ";
00100 
00101 #define OPTION(opt) (1 << (opt - 1))
00102 #define noOPTION(opt)   (~OPTION (opt))
00103 
00104 #define OPT_NB ((sizeof(option_tbl)/sizeof(*option_tbl))-1)
00105 
00106 #define UNKNOWN_ARG       0
00107 #define HELP              1
00108 #define VERBOSE       2
00109 #define EXCLUDE       3
00110 #define PROD_MAPPING      4
00111 #define TERMINAL_MAPPING  5
00112 #define NON_TERMINAL_MAPPING  6
00113 #define SOURCE_FILE   7
00114 #define STDIN             8
00115 
00116 
00117 static char *option_tbl [] = {
00118     "",
00119     "-help",  
00120     "v", "verbose",
00121     "e", "exclude",
00122     "pm", "prod_mapping",
00123     "tm", "terminal_mapping",
00124     "nm", "non_terminal_mapping",
00125 };
00126 
00127 static SXINT    option_kind [] = {
00128     UNKNOWN_ARG,
00129     HELP,
00130     VERBOSE, VERBOSE,
00131     EXCLUDE, EXCLUDE,
00132     PROD_MAPPING, PROD_MAPPING,
00133     TERMINAL_MAPPING, TERMINAL_MAPPING,
00134     NON_TERMINAL_MAPPING, NON_TERMINAL_MAPPING,
00135 };
00136 
00137 
00138 
00139 static SXINT    option_get_kind (arg)
00140     char    *arg;
00141 {
00142   char  **opt;
00143 
00144   if (*arg++ != '-')
00145     return SOURCE_FILE;
00146 
00147   if (*arg == SXNUL)
00148     return STDIN;
00149 
00150   for (opt = &(option_tbl [OPT_NB]); opt > option_tbl; opt--) {
00151     if (strcmp (*opt, arg) == 0 /* egalite */ )
00152       break;
00153   }
00154 
00155   return option_kind [opt - option_tbl];
00156 }
00157 
00158 
00159 
00160 static char *option_get_text (kind)
00161     SXINT   kind;
00162 {
00163   SXINT i;
00164 
00165   for (i = OPT_NB; i > 0; i--) {
00166     if (option_kind [i] == kind)
00167       break;
00168   }
00169 
00170   return option_tbl [i];
00171 }
00172 
00173 
00174 
00175 static void
00176 make_proper_run (pathname)
00177     char    *pathname;
00178 {
00179   FILE  *infile;
00180 
00181   if (pathname == NULL) {
00182     SXINT   c;
00183 
00184     if (sxverbosep) {
00185       fputs ("\"stdin\":\n", sxtty);
00186     }
00187 
00188     if ((infile = sxtmpfile ()) == NULL) {
00189       fprintf (sxstderr, "%s: Unable to create ", ME);
00190       sxperror ("temp file");
00191       sxerrmngr.nbmess [2]++;
00192       return;
00193     }
00194 
00195     while ((c = getchar ()) != EOF) {
00196       putc (c, infile);
00197     }
00198 
00199     rewind (infile);
00200     sxsrc_mngr (SXINIT, infile, "");
00201   }
00202   else {
00203     if ((infile = sxfopen (pathname, "r")) == NULL) {
00204       fprintf (sxstderr, "%s: Cannot open (read) ", ME);
00205       sxperror (pathname);
00206       sxerrmngr.nbmess [2]++;
00207       return;
00208     }
00209     else {
00210       if (sxverbosep) {
00211     fprintf (sxtty, "%s:\n", pathname);
00212       }
00213 
00214       sxsrc_mngr (SXINIT, infile, pathname);
00215     }
00216   }
00217 
00218   sxerr_mngr (SXBEGIN);
00219   syntax (SXACTION, &sxtables);
00220   sxerr_mngr (SXEND);
00221   fclose (infile);
00222   sxsrc_mngr (SXFINAL);
00223 }
00224 
00225 
00226 
00227 /************************************************************************/
00228 /* main function
00229 /************************************************************************/
00230 int main(int argc, char *argv[])
00231 {
00232   SXINT     argnum;
00233   SXBOOLEAN is_source_file, is_stdin;
00234   char          *source_file;
00235 
00236   n = 0;
00237 
00238   if (sxstdout == NULL) {
00239     sxstdout = stdout;
00240   }
00241   if (sxstderr == NULL) {
00242     sxstderr = stderr;
00243   }
00244   
00245 #ifdef BUG
00246   /* Suppress bufferisation, in order to have proper     */
00247   /* messages when something goes wrong...       */
00248   setbuf (stdout, NULL);
00249 #endif
00250   
00251   sxopentty ();
00252 
00253   /* valeurs par defaut */
00254   sxverbosep = SXFALSE;
00255   is_help = SXFALSE;
00256   is_exclude = SXFALSE;
00257   is_prod_mapping = SXFALSE;
00258   is_terminal_mapping = SXFALSE;
00259   is_non_terminal_mapping = SXFALSE;
00260   is_stdin = SXTRUE;
00261   is_source_file = SXFALSE;
00262   
00263   argnum = 0;
00264 
00265   while (++argnum < argc) {
00266     switch (option_get_kind (argv [argnum])) {
00267     case HELP:
00268       is_help = SXTRUE;
00269       break;
00270 
00271     case VERBOSE:
00272       sxverbosep = SXTRUE;
00273       break;
00274 
00275     case EXCLUDE:
00276       is_exclude = SXTRUE;
00277 
00278     case PROD_MAPPING:
00279       is_prod_mapping = SXTRUE;
00280       break;
00281 
00282     case TERMINAL_MAPPING:
00283       is_terminal_mapping = SXTRUE;
00284       break;
00285 
00286     case NON_TERMINAL_MAPPING:
00287       is_non_terminal_mapping = SXTRUE;
00288       break;
00289 
00290     case STDIN:
00291       is_stdin = SXTRUE;
00292       break;
00293 
00294     case SOURCE_FILE:
00295       is_stdin = SXFALSE;
00296       is_source_file = SXTRUE;
00297       source_file = argv [argnum];
00298       break;
00299 
00300     case UNKNOWN_ARG:
00301       fprintf (sxstderr, "%s: unknown option \"%s\".\n", ME, argv [argnum]);
00302       fprintf (sxstderr, Usage, ME);
00303       SXEXIT (3);
00304     }
00305   }
00306 
00307   if (!is_stdin && !is_source_file || is_help) {
00308     fprintf (sxstderr, Usage, ME);
00309     SXEXIT (3);
00310   }
00311 
00312 
00313   sxstr_mngr (SXBEGIN);
00314   (*(sxtables.analyzers.parser)) (SXBEGIN, &sxtables) /* Allocation des variables globales du parser */ ;
00315   syntax (SXOPEN, &sxtables) /* Initialisation de SYNTAX */ ;
00316 
00317   make_proper_run (is_stdin ? NULL : source_file);
00318 
00319   syntax (SXCLOSE, &sxtables);
00320   (*(sxtables.analyzers.parser)) (SXEND, &sxtables);
00321   sxstr_mngr (SXEND);
00322 
00323   {
00324     SXINT   severity;
00325 
00326     for (severity = SXSEVERITIES - 1; severity > 0 && sxerrmngr.nbmess [severity] == 0; severity--)
00327       ;
00328 
00329     SXEXIT (severity);
00330   }
00331 
00332   return EXIT_SUCCESS; /* Jamais atteint !! pour les compilo susceptibles ... */
00333 }
00334 
00335 /* Utilisees ds lexicalizer_mngr */
00336 static void
00337 output_nt (SXINT nt)
00338 {
00339   printf ("<%s> ", spf.inputG.ntstring [nt]);
00340 }
00341 
00342 
00343 static void
00344 output_t (SXINT t)
00345 {
00346   varstr_raz (vstr);
00347   vstr = varstr_quote (vstr, spf.inputG.tstring [t]);
00348   printf ("%s ", varstr_tostr (vstr));
00349 }
00350 
00351 
00352 
00353 void
00354 output_prod (SXINT prod)
00355 {
00356   SXINT        item, X;
00357 
00358   output_nt (spf.inputG.lhs [prod]);
00359 
00360   fputs ("\t= ", stdout);
00361 
00362   item = spf.inputG.prolon [prod];
00363 
00364   while ((X = spf.inputG.lispro [item++]) != 0) {
00365     if (X > 0)
00366       output_nt (X);
00367     else
00368       output_t (-X);
00369   }
00370 
00371   fputs (";\n", stdout);
00372 }
00373 
00374 /* "Semantique" de make_proper */
00375 SXVOID
00376 make_proper_semact (what, arg)
00377     SXINT       what, arg;
00378 {
00379   static SXINT          word_pos;//, glbl_source_size;
00380   struct sxtoken    *tok;
00381   SXINT                 t_code, new_prod, word_lgth;
00382   char                  *word;
00383 
00384   switch (what) {
00385   case SXOPEN:
00386 #if 0
00387     glbl_source_size = 100;
00388     glbl_source_area = glbl_source = (SXINT*) sxalloc (glbl_source_size+1, sizeof (SXINT));
00389 #endif /* 0 */
00390     idag.source_set = sxba_calloc (SXEOF+1);
00391     break;
00392 
00393   case SXINIT:
00394 #if 0
00395     sxword_reuse (&inflected_form_names, "inflected_form_names", sxcont_malloc, sxcont_alloc, sxcont_realloc, NULL, sxcont_free, NULL, NULL);
00396 #endif /* 0 */
00397     word_pos = 0;
00398     break;
00399 
00400   case SXACTION:
00401     if (arg == 0)
00402     return;
00403 
00404 #if EBUG
00405     if (arg != 1)
00406       sxtrap (ME, "make_proper_semact");
00407 #endif /* EBUG */
00408 
00409 #if 0
00410     if (++word_pos > glbl_source_size) {
00411       glbl_source_size *= 2;
00412       glbl_source_area = glbl_source = (SXINT*) sxrealloc (glbl_source, glbl_source_size+1, sizeof (SXINT));
00413     }
00414 #endif /* 0 */
00415 
00416     tok = &(SXSTACKtoken (SXSTACKtop ()));
00417     word = sxstrget (tok->string_table_entry);
00418     word_lgth = strlen (word);
00419 
00420     t_code = sxdfa_comb_seek_a_string (&sxdfa_comb_inflected_form, word, &word_lgth);
00421 
00422     if (word_lgth != 0)
00423       t_code = 0;
00424 
00425     if (t_code == 0)
00426       sxerror (tok->source_index,
00427            sxsvar.sxtables->err_titles [1][0],
00428            "%s: The unknown terminal symbol \"%s\" is ignored.",
00429            sxsvar.sxtables->err_titles [1]+1,
00430            word);
00431     else {
00432       SXBA_1_bit (idag.source_set, t_code);
00433 #if 0
00434       glbl_source [word_pos] = t_code;
00435 #endif /* 0 */
00436     }
00437 
00438 #if 0
00439     t_code = sxword_retrieve (&inflected_form_names, word);
00440 
00441     if (t_code <= 1) {
00442       sxerror (tok->source_index,
00443            sxsvar.sxtables->err_titles [1][0],
00444            "%s: The unknown terminal symbol \"%s\" is ignored.",
00445            sxsvar.sxtables->err_titles [1]+1);
00446       t_code = 0;
00447     }
00448     else {
00449       t_code--;
00450       SXBA_1_bit (source_set, t_code);
00451     }
00452 
00453     glbl_source [word_pos] = t_code;
00454 #endif /* 0 */
00455 
00456     break;
00457 
00458   case SXSEMPASS:
00459     n = word_pos;
00460 #if 0
00461     init_mlstn = 1;
00462     final_mlstn = n+1;
00463 #endif /* 0 */
00464 
00465     /*  On prepare l'appel de lexicalizer_mngr */
00466     if (is_exclude) {
00467       sxba_not (idag.source_set); 
00468       SXBA_0_bit (idag.source_set, 0);
00469     }
00470     else
00471       SXBA_1_bit (idag.source_set, SXEOF);
00472 
00473     vstr = varstr_alloc (32); /* Pour output_t () !! */
00474       
00475     /* Attention, lexicalizer_mngr doit etre compile' avec l'option -DMAKE_PROPER */
00476     if (lexicalizer2basic_item_set (SXFALSE, SXFALSE)) {
00477       /* On sort la grammaire reduite contenue ds spf.insideG */
00478       SXINT               new_prod, prod, i, X;
00479       extern char   *ctime ();
00480       long          date_time;
00481     
00482       date_time = time (0);
00483 
00484       printf ("\
00485 *   *****************************************************************************************\n\
00486 *    This proper sub-grammar for the language \"%s\" in BNF format has been generated\n\
00487 *    on %s\
00488 *    by the SYNTAX(*) make_proper processor\n\
00489 *   *****************************************************************************************\n\
00490 *    (*) SYNTAX is a trademark of INRIA.\n\
00491 *   *****************************************************************************************\n\n\n",
00492           LANGUAGE_NAME, ctime (&date_time));
00493 
00494       for (new_prod = 1; new_prod <= spf.insideG.maxprod; new_prod++) {
00495     prod = spf.insideG.prod2init_prod [new_prod];
00496 
00497     if (is_prod_mapping)
00498       printf ("*[P%i %i]\n", new_prod, prod);
00499 
00500     output_prod (prod);
00501       }
00502 
00503       if (is_non_terminal_mapping) {
00504     fputs ("\n* *********************** NON-TERMINAL MAPPING [new_nt_code -> old_nt_code] ***********************", stdout);
00505 
00506     for (i = 1; i <= spf.insideG.maxnt; i++) {
00507       X = spf.insideG.nt2init_nt [i];
00508       printf ("\n*[N%i %i] ", i, X);
00509       output_nt (X);
00510     }
00511 
00512     fputs ("\n", stdout);
00513       }
00514 
00515       if (is_terminal_mapping) {
00516     fputs ("\n* *********************** TERMINAL MAPPING [new_t_code -> old_t_code] ***********************", stdout);
00517 
00518     for (i = 1; i < -spf.insideG.maxt; i++) {
00519       X = spf.insideG.t2init_t [i];
00520       printf ("\n*[T%i %i] ", i, X);
00521       output_t (X);
00522     }
00523 
00524     fputs ("\n", stdout);
00525       }
00526 
00527       spf_free_insideG (&spf.insideG);
00528     }
00529     else {
00530       sxtmsg (sxsvar.sxlv.terminal_token.source_index.file_name,
00531           "%sNo proper sub-grammar for the language \"%s\" can be constructed from the input terminal sub-set.",
00532           sxplocals.sxtables->err_titles [2],
00533           LANGUAGE_NAME);
00534     }
00535 
00536     varstr_free (vstr), vstr = NULL;
00537 
00538 #if 0
00539     /* Attention, lexicalizer_mngr doit etre compile' avec l'option -DMAKE_PROPER */
00540     if (lexicalizer2basic_item_set (SXFALSE, SXFALSE)) {
00541       /* On sort la grammaire reduite */
00542       SXINT               item, prod, i, X, id;
00543       extern char   *ctime ();
00544       long          date_time;
00545       sxword_header     t_names, nt_names;
00546       SXINT               *new_t2old_t, *new_nt2old_nt, top_t_names, top_nt_names;
00547     
00548       date_time = time (0);
00549 
00550       printf ("\
00551 *   *****************************************************************************************\n\
00552 *    This proper sub-grammar for the language \"%s\" in BNF format has been generated\n\
00553 *    on %s\
00554 *    by the SYNTAX(*) make_proper processor\n\
00555 *   *****************************************************************************************\n\
00556 *    (*) SYNTAX is a trademark of INRIA.\n\
00557 *   *****************************************************************************************\n\n\n",
00558           LANGUAGE_NAME, ctime (&date_time));
00559 
00560       vstr = varstr_alloc (32);
00561 
00562       if (is_terminal_mapping) {
00563     new_t2old_t = (SXINT*) sxalloc (-spf.insideG.maxt+1, sizeof (SXINT)), new_t2old_t [0] = 0;
00564     sxword_alloc (&t_names, "t_names", -spf.insideG.maxt+1, 1, 32, sxcont_malloc, sxcont_alloc, sxcont_realloc, NULL /* resize */, sxcont_free, NULL, NULL);
00565     top_t_names = 1;
00566       }
00567 
00568       if (is_non_terminal_mapping) {
00569     new_nt2old_nt = (SXINT*) sxalloc (spf.insideG.maxnt+1, sizeof (SXINT)), new_nt2old_nt [0] = 0;
00570     sxword_alloc (&nt_names, "nt_names", spf.inputG.maxnt+1, 1, 32, sxcont_malloc, sxcont_alloc, sxcont_realloc, NULL /* resize */, sxcont_free, NULL, NULL);
00571     top_nt_names = 1;
00572       }
00573 
00574       new_prod = 0;
00575       item = 3;
00576 
00577       while ((item = sxba_scan (basic_item_set, item)) > 0) {
00578     prod = spf.inputG.prolis [item];
00579 
00580     if (is_prod_mapping)
00581       printf ("*[P%i %i]\n", ++new_prod, prod);
00582 
00583     output_prod (prod);
00584 
00585     if (is_non_terminal_mapping) {
00586       X = spf.inputG.lhs [prod];
00587       id = sxword_save (&nt_names, spf.inputG.ntstring [X]);
00588       
00589       if (id > top_nt_names) {
00590         /* Nouveau */
00591         top_nt_names = id;
00592         new_nt2old_nt [id-1] = X;
00593       }
00594     }
00595 
00596     if (is_terminal_mapping || is_non_terminal_mapping) {
00597       while ((X = spf.inputG.lispro [item]) != 0) {
00598         if (X > 0) {
00599           if (is_non_terminal_mapping) {
00600         id = sxword_save (&nt_names, spf.inputG.ntstring [X]);
00601 
00602         if (id > top_nt_names) {
00603           /* Nouveau */
00604           top_nt_names = id;
00605           new_nt2old_nt [id-1] = X;
00606         }
00607           }
00608         }
00609         else {
00610           if (is_terminal_mapping) {
00611         X = -X;
00612         id = sxword_save (&t_names, spf.inputG.tstring [X]);
00613 
00614         if (id > top_t_names) {
00615           /* Nouveau */
00616           top_t_names = id;
00617           new_t2old_t [id-1] = X;
00618         }
00619           }
00620         }
00621 
00622         item++;
00623       }
00624     }
00625     else
00626       item = spf.inputG.prolon [prod+1]-1;
00627       }
00628 
00629       if (is_non_terminal_mapping) {
00630     fputs ("\n* *********************** NON-TERMINAL MAPPING [new_nt_code -> old_nt_code] ***********************", stdout);
00631 
00632     for (i = 1; i < top_nt_names; i++) {
00633       X = new_nt2old_nt [i];
00634       printf ("\n*[N%i %i] ", i, X);
00635       output_nt (X);
00636     }
00637 
00638     fputs ("\n", stdout);
00639 
00640     sxword_free (&nt_names);
00641     sxfree (new_nt2old_nt);
00642       }
00643 
00644       if (is_terminal_mapping) {
00645     fputs ("\n* *********************** TERMINAL MAPPING [new_t_code -> old_t_code] ***********************", stdout);
00646 
00647     for (i = 1; i < top_t_names; i++) {
00648       X = new_t2old_t [i];
00649       printf ("\n*[T%i %i] ", i, X);
00650       output_t (X);
00651     }
00652 
00653     fputs ("\n", stdout);
00654 
00655     sxword_free (&t_names);
00656     sxfree (new_t2old_t);
00657       }
00658 
00659       varstr_free (vstr), vstr = NULL;
00660       sxfree (basic_item_set), basic_item_set = NULL;
00661     }
00662     else {
00663       sxtmsg (sxsvar.sxlv.terminal_token.source_index.file_name,
00664           "%sNo proper sub-grammar for the language \"%s\" can be constructed from the input terminal sub-set.",
00665           sxplocals.sxtables->err_titles [2],
00666           LANGUAGE_NAME);
00667     }
00668 #endif /* 0 */
00669 
00670     break;
00671 
00672   case SXFINAL:
00673     break;
00674 
00675   case SXCLOSE:
00676 #if 0
00677     sxfree (glbl_source_area), glbl_source_area = glbl_source = NULL;
00678 #endif /* 0 */
00679     sxfree (idag.source_set), idag.source_set /*= source_top*/ = NULL;
00680     break;
00681 
00682   default:
00683     fputs ("The function \"make_proper_semact\" is out of date with respect to its specification.\n", sxstderr);
00684     sxexit(1);
00685   }
00686 }
00687 
00688 
00689 SXVOID
00690 make_proper_scanact (code, act_no)
00691     SXINT       code;
00692     SXINT       act_no;
00693 {
00694   switch (code) {
00695   case SXOPEN:
00696   case SXCLOSE:
00697   case SXINIT:
00698   case SXFINAL:
00699     return;
00700 
00701   case SXACTION:
00702     switch (act_no) {
00703       SXSHORT   c;
00704 
00705     case 1: /* \nnn => char */
00706       {
00707     SXINT   val;
00708     char    c, *s, *t;
00709 
00710     t = s = sxsvar.sxlv_s.token_string + sxsvar.sxlv.mark.index;
00711 
00712     for (val = *s++ - '0'; (c = *s++) != SXNUL; ) {
00713       val = (val << 3) + c - '0';
00714     }
00715 
00716     *t = val;
00717     sxsvar.sxlv.ts_lgth = sxsvar.sxlv.mark.index + 1;
00718     sxsvar.sxlv.mark.index = -1;
00719       }
00720 
00721       return;
00722     }
00723 
00724   default:
00725     fputs ("The function \"make_proper_scanact\" is out of date with respect to its specification.\n", sxstderr);
00726     sxexit(1);
00727   }
00728 }
00729 
00730 
00731 /* Le 20/12/04 sxtime devient un module de la librairie  sxtm_mngr.c */
00732 
00733 
00734 /* Appelees ds sxspf_mngr */
00735 void idag_source_processing  (SXINT i, SXBA *t2suffix_t_set, SXBA *mlstn2suffix_source_set, SXBA *mlstn2la_tset, SXBA *t2la_t_set){}
00736 SXINT get_repair_Tpq2tok_no (SXINT Tpq) {return 0;}
00737 void   idag_p_t_q2tok_no_stack (SXINT **tok_no_stack_ptr, SXINT p, SXINT t, SXINT q) {};
00738 VARSTR  rcvr_out_range    (VARSTR vstr, SXINT lb, SXINT ub) {return NULL;}
00739 SXINT   special_Apq_name  (char *string, SXINT lgth) {return 0;}
00740 SXINT   special_Tpq_name  (char *string, SXINT lgth) {return 0;}
00741 VARSTR sub_dag_to_comment      (VARSTR vstr, SXINT p, SXINT q) {return NULL;}
00742 void sxearley_open_for_semact (void) {};
00743 SXINT  dag_scanner             (SXINT what, struct sxtables *arg) {return 1;};

Generated on Wed Apr 21 16:39:33 2010 for syntax-6.0b7 by  doxygen 1.6.1