version 1.50, 2014/10/13 07:12:54
|
version 1.51, 2014/10/20 19:01:35
|
Line 111 transcription_arbre(struct_processus *s_
|
Line 111 transcription_arbre(struct_processus *s_
|
|
|
/* |
/* |
================================================================================ |
================================================================================ |
|
Fonction de simplification d'un arbre |
|
================================================================================ |
|
Entrées : pointeur sur une structure struct_processus |
|
-------------------------------------------------------------------------------- |
|
Sorties : |
|
-------------------------------------------------------------------------------- |
|
Effets de bord : néant |
|
================================================================================ |
|
*/ |
|
|
|
static void |
|
inversion_fonctions_arbre(struct_arbre *s_arbre) |
|
{ |
|
return; |
|
} |
|
|
|
|
|
static void |
|
simplification_arbre(struct_processus *s_etat_processus, |
|
struct_arbre **s_arbre) |
|
{ |
|
return; |
|
} |
|
|
|
|
|
/* |
|
================================================================================ |
Fonction 'simplification' (ne libère pas les paramètres) |
Fonction 'simplification' (ne libère pas les paramètres) |
================================================================================ |
================================================================================ |
Entrées : pointeur sur une structure struct_processus |
Entrées : pointeur sur une structure struct_processus |
Line 126 simplification(struct_processus *s_etat_
|
Line 153 simplification(struct_processus *s_etat_
|
{ |
{ |
struct_objet *s_objet_simplifie; |
struct_objet *s_objet_simplifie; |
|
|
# ifdef EXPERIMENTAL_CODE |
|
|
|
integer8 i; |
integer8 i; |
integer8 nombre_arguments; |
integer8 nombre_arguments; |
|
|
Line 187 simplification(struct_processus *s_etat_
|
Line 212 simplification(struct_processus *s_etat_
|
|
|
(*s_arbre).inversion = d_faux; |
(*s_arbre).inversion = d_faux; |
(*s_arbre).nombre_branches = nombre_arguments; |
(*s_arbre).nombre_branches = nombre_arguments; |
|
(*s_arbre).feuille = copie_objet(s_etat_processus, |
|
(*l_element_courant).donnee, 'P'); |
|
|
if (((*s_arbre).branches = malloc(((size_t) (*s_arbre) |
if (((*s_arbre).branches = malloc(((size_t) (*s_arbre) |
.nombre_branches) * sizeof(struct_arbre *))) |
.nombre_branches) * sizeof(struct_arbre *))) |
Line 197 simplification(struct_processus *s_etat_
|
Line 224 simplification(struct_processus *s_etat_
|
return(NULL); |
return(NULL); |
} |
} |
|
|
for(i = 0; i < nombre_arguments; i++) |
for(i = nombre_arguments - 1; i >= 0; i--) |
{ |
{ |
if (l_liste_locale == NULL) |
if (l_liste_locale == NULL) |
{ |
{ |
Line 206 simplification(struct_processus *s_etat_
|
Line 233 simplification(struct_processus *s_etat_
|
return(NULL); |
return(NULL); |
} |
} |
|
|
if (((*s_arbre).branches[i] = malloc( |
(*s_arbre).branches[i] = (struct_arbre *) |
sizeof(struct_arbre))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return(NULL); |
|
} |
|
|
|
(*(*s_arbre).branches[i]).feuille = |
|
(*l_liste_locale).donnee; |
(*l_liste_locale).donnee; |
(*(*s_arbre).branches[i]).inversion = d_faux; |
|
(*(*s_arbre).branches[i]).nombre_branches = 0; |
|
(*(*s_arbre).branches[i]).branches = NULL; |
|
|
|
l_ancienne_liste_locale = l_liste_locale; |
l_ancienne_liste_locale = l_liste_locale; |
l_liste_locale = (*l_liste_locale).suivant; |
l_liste_locale = (*l_liste_locale).suivant; |
Line 305 simplification(struct_processus *s_etat_
|
Line 321 simplification(struct_processus *s_etat_
|
* Simplification de l'arbre |
* Simplification de l'arbre |
*/ |
*/ |
|
|
# if 0 |
# ifdef EXPERIMENTAL_CODE |
simplification_arbre(); |
simplification_arbre(s_etat_processus, &s_arbre); |
|
|
|
if ((*s_etat_processus).erreur_systeme != d_es) |
|
{ |
|
return(NULL); |
|
} |
# endif |
# endif |
|
|
/* |
/* |
Line 397 simplification(struct_processus *s_etat_
|
Line 418 simplification(struct_processus *s_etat_
|
.nom_fonction, ">>"); |
.nom_fonction, ">>"); |
} |
} |
else |
else |
# endif |
|
{ |
{ |
s_objet_simplifie = copie_objet(s_etat_processus, s_objet, 'P'); |
s_objet_simplifie = copie_objet(s_etat_processus, s_objet, 'P'); |
} |
} |