version 1.51, 2014/10/20 19:01:35
|
version 1.59, 2016/03/01 22:12:36
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.19 |
RPL/2 (R) version 4.1.25 |
Copyright (C) 1989-2014 Dr. BERTRAND Joël |
Copyright (C) 1989-2016 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 66 transcription_arbre(struct_processus *s_
|
Line 66 transcription_arbre(struct_processus *s_
|
} |
} |
} |
} |
|
|
if ((l_liste = allocation_maillon(s_etat_processus)) == NULL) |
// Ajout des fonctions |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return(NULL); |
|
} |
|
|
|
// Ajout de la fonction |
l_liste = (*s_arbre).feuille; |
|
|
(*l_liste).suivant = NULL; |
|
(*l_liste).donnee = (*s_arbre).feuille; |
|
|
|
free((*s_arbre).branches); |
free((*s_arbre).branches); |
free(s_arbre); |
free(s_arbre); |
Line 130 inversion_fonctions_arbre(struct_arbre *
|
Line 123 inversion_fonctions_arbre(struct_arbre *
|
|
|
static void |
static void |
simplification_arbre(struct_processus *s_etat_processus, |
simplification_arbre(struct_processus *s_etat_processus, |
struct_arbre **s_arbre) |
struct_arbre *s_arbre) |
{ |
{ |
|
integer8 i; |
|
|
|
if ((*(*(*s_arbre).feuille).donnee).type != FCT) |
|
{ |
|
// L'objet formant le noeud n'est pas une fonction. Il n'y a aucune |
|
// simplification possible. |
|
|
|
return; |
|
} |
|
|
|
if ((strcmp((*((struct_fonction *) (*(*(*s_arbre).feuille).donnee).objet)) |
|
.nom_fonction, "+") == 0) || (strcmp((*((struct_fonction *) |
|
(*(*(*s_arbre).feuille).donnee).objet)).nom_fonction, "-") == 0)) |
|
{ |
|
for(i = 0; i < (*s_arbre).nombre_branches; i++) |
|
{ |
|
} |
|
} |
|
else if ((strcmp((*((struct_fonction *) (*(*(*s_arbre).feuille).donnee) |
|
.objet)).nom_fonction, "*") == 0) || (strcmp((*((struct_fonction *) |
|
(*(*(*s_arbre).feuille).donnee).objet)).nom_fonction, "/") == 0)) |
|
{ |
|
for(i = 0; i < (*s_arbre).nombre_branches; i++) |
|
{ |
|
} |
|
} |
|
|
return; |
return; |
} |
} |
|
|
Line 210 simplification(struct_processus *s_etat_
|
Line 230 simplification(struct_processus *s_etat_
|
return(NULL); |
return(NULL); |
} |
} |
|
|
(*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).feuille = allocation_maillon( |
|
s_etat_processus)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return(NULL); |
|
} |
|
|
|
(*(*s_arbre).feuille).donnee = copie_objet( |
|
s_etat_processus, (*l_element_courant).donnee, |
|
'P'); |
|
(*(*s_arbre).feuille).suivant = NULL; |
|
|
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 283 simplification(struct_processus *s_etat_
|
Line 313 simplification(struct_processus *s_etat_
|
return(NULL); |
return(NULL); |
} |
} |
|
|
(*s_arbre).feuille = copie_objet(s_etat_processus, |
if (((*s_arbre).feuille = allocation_maillon( |
(*l_element_courant).donnee, 'P'); |
s_etat_processus)) == NULL) |
(*s_arbre).inversion = d_faux; |
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return(NULL); |
|
} |
|
|
|
(*(*s_arbre).feuille).donnee = copie_objet( |
|
s_etat_processus, (*l_element_courant).donnee, 'P'); |
|
(*(*s_arbre).feuille).suivant = NULL; |
(*s_arbre).nombre_branches = 0; |
(*s_arbre).nombre_branches = 0; |
(*s_arbre).branches = NULL; |
(*s_arbre).branches = NULL; |
|
|
Line 322 simplification(struct_processus *s_etat_
|
Line 360 simplification(struct_processus *s_etat_
|
*/ |
*/ |
|
|
# ifdef EXPERIMENTAL_CODE |
# ifdef EXPERIMENTAL_CODE |
simplification_arbre(s_etat_processus, &s_arbre); |
simplification_arbre(s_etat_processus, s_arbre); |
|
|
if ((*s_etat_processus).erreur_systeme != d_es) |
if ((*s_etat_processus).erreur_systeme != d_es) |
{ |
{ |