Diff for /rpl/src/analyse_notation_algebrique.c between versions 1.43 and 1.51

version 1.43, 2013/03/20 17:11:43 version 1.51, 2013/12/03 09:36:10
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.13    RPL/2 (R) version 4.1.17
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2013 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
Line 57  analyse_algebrique(struct_processus *s_e Line 57  analyse_algebrique(struct_processus *s_e
     logical1                            presence_fonction;      logical1                            presence_fonction;
     logical1                            presence_liste;      logical1                            presence_liste;
   
     long                                k;  
   
     unsigned char                       *chaine_arguments;      unsigned char                       *chaine_arguments;
     unsigned char                       *chaine_centrale;      unsigned char                       *chaine_centrale;
     unsigned char                       *chaine_droite;      unsigned char                       *chaine_droite;
Line 88  analyse_algebrique(struct_processus *s_e Line 86  analyse_algebrique(struct_processus *s_e
     integer8                            fin_zone_algebrique;      integer8                            fin_zone_algebrique;
     integer8                            i;      integer8                            i;
     integer8                            j;      integer8                            j;
       integer8                            k;
     integer8                            longueur_chaine;      integer8                            longueur_chaine;
     integer8                            longueur_tampon;      integer8                            longueur_tampon;
     integer8                            niveau;      integer8                            niveau;
Line 117  analyse_algebrique(struct_processus *s_e Line 116  analyse_algebrique(struct_processus *s_e
   
         if (chaine_algebrique[i] == '"')          if (chaine_algebrique[i] == '"')
         {          {
             presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;              if (chaine_algebrique[i - 1] != '\\')
               {
                   presence_chaine = (presence_chaine == d_faux) ? d_vrai : d_faux;
               }
         }          }
         else if (presence_chaine == d_faux)          else if (presence_chaine == d_faux)
         {          {
Line 178  analyse_algebrique(struct_processus *s_e Line 180  analyse_algebrique(struct_processus *s_e
     {      {
         if ((*ptr1) == '"')          if ((*ptr1) == '"')
         {          {
             if (presence_chaine == d_faux)              if (ptr1 != chaine_travail)
             {              { // Il existe un caractère précédent.
                 presence_chaine = d_vrai;                  if ((*(ptr1 - 1)) != '\\')
                   {
                       if (presence_chaine == d_faux)
                       {
                           presence_chaine = d_vrai;
                       }
                       else
                       {
                           presence_chaine = d_faux;
                       }
                   }
             }              }
             else              else
             {              { // Il n'existe pas de caractère précédent.
                 presence_chaine = d_faux;                  if (presence_chaine == d_faux)
                   {
                       presence_chaine = d_vrai;
                   }
                   else
                   {
                       presence_chaine = d_faux;
                   }
             }              }
         }          }
   
Line 269  analyse_algebrique(struct_processus *s_e Line 288  analyse_algebrique(struct_processus *s_e
                 }                  }
                 else if (chaine_travail[i] == '"')                  else if (chaine_travail[i] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (i > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[i - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 i++;                  i++;
Line 307  analyse_algebrique(struct_processus *s_e Line 337  analyse_algebrique(struct_processus *s_e
   
                 if (chaine_travail[j] == '"')                  if (chaine_travail[j] == '"')
                 {                  {
                     presence_chaine = (presence_chaine == d_vrai)                      if (j > 0)
                             ? d_faux : d_vrai;                      {
                           if (chaine_travail[j - 1] != '\\')
                           {
                               presence_chaine = (presence_chaine == d_vrai)
                                       ? d_faux : d_vrai;
                           }
                       }
                       else
                       {
                           presence_chaine = (presence_chaine == d_vrai)
                                   ? d_faux : d_vrai;
                       }
                 }                  }
   
                 j++;                  j++;
Line 359  analyse_algebrique(struct_processus *s_e Line 400  analyse_algebrique(struct_processus *s_e
                 {                  {
                     if (chaine_centrale[i] == '"')                      if (chaine_centrale[i] == '"')
                     {                      {
                         presence_chaine = (presence_chaine == d_faux)                          if (i > 0)
                                 ? d_vrai : d_faux;                          {
                               if (chaine_centrale[i - 1] != '\\')
                               {
                                   presence_chaine = (presence_chaine == d_faux)
                                           ? d_vrai : d_faux;
                               }
                           }
                           else
                           {
                               presence_chaine = (presence_chaine == d_faux)
                                       ? d_vrai : d_faux;
                           }
   
                         if (i == 1)                          if (i == 1)
                         {                          {
Line 1098  analyse_algebrique(struct_processus *s_e Line 1150  analyse_algebrique(struct_processus *s_e
 unsigned char *  unsigned char *
 purification_chaine(unsigned char *chaine)  purification_chaine(unsigned char *chaine)
 {  {
     long                        i;      integer8                    i;
     long                        j;      integer8                    j;
   
     unsigned char               *chaine_purifiee;      unsigned char               *chaine_purifiee;
   
Line 1137  purification_chaine(unsigned char *chain Line 1189  purification_chaine(unsigned char *chain
 logical1  logical1
 test_expression_rpn(unsigned char *chaine)  test_expression_rpn(unsigned char *chaine)
 {  {
     long                    j;  
   
     int                     t;      int                     t;
     int                     t0;      int                     t0;
     int                     t1;      int                     t1;
Line 1149  test_expression_rpn(unsigned char *chain Line 1199  test_expression_rpn(unsigned char *chain
     integer8                compteur;      integer8                compteur;
     integer8                longueur_chaine;      integer8                longueur_chaine;
     integer8                i;      integer8                i;
       integer8                j;
     integer8                niveau;      integer8                niveau;
   
     /*      /*
Line 1168  test_expression_rpn(unsigned char *chain Line 1219  test_expression_rpn(unsigned char *chain
         if (chaine[i - 1] == '"')          if (chaine[i - 1] == '"')
         {          {
             i++;              i++;
             while(chaine[i - 1] != '"')              while(!((chaine[i - 1] == '"') && (chaine[i - 2] != '\\')))
             {              {
                 i++;                  i++;
             }              }
Line 1317  extraction_chaine(unsigned char *chaine, Line 1368  extraction_chaine(unsigned char *chaine,
     unsigned char           *sous_chaine;      unsigned char           *sous_chaine;
   
     if ((position_1 < 1) || (position_2 < position_1) ||      if ((position_1 < 1) || (position_2 < position_1) ||
             (position_1 > ((integer8) strlen(chaine))))              (position_2 > ((integer8) strlen(chaine))))
     {  
         if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))  
                 == NULL)  
         {  
             return(NULL);  
         }  
   
         (*sous_chaine) = d_code_fin_chaine;  
         return(sous_chaine);  
     }  
   
     if (position_2 > ((integer8) strlen(chaine)))  
     {      {
         if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))          if ((sous_chaine = (unsigned char *) malloc(sizeof(unsigned char)))
                 == NULL)                  == NULL)

Removed from v.1.43  
changed lines
  Added in v.1.51


CVSweb interface <joel.bertrand@systella.fr>