version 1.60, 2013/12/03 09:36:13
|
version 1.86, 2021/03/13 12:50:43
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.17 |
RPL/2 (R) version 4.1.33 |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
Copyright (C) 1989-2021 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 85 instruction_fleche(struct_processus *s_e
|
Line 85 instruction_fleche(struct_processus *s_e
|
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n", |
" %s, %s, %s\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
printf(" ...\n"); |
printf(" ...\n"); |
printf(" 1: %s, %s, %s, %s, %s, %s,\n" |
printf(" 1: %s, %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s, %s, %s,\n" |
" %s, %s\n", |
" %s, %s, %s\n", |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK, |
d_SQL, d_SLB, d_PRC, d_MTX); |
d_SQL, d_SLB, d_PRC, d_MTX, d_REC); |
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
Line 110 instruction_fleche(struct_processus *s_e
|
Line 110 instruction_fleche(struct_processus *s_e
|
|
|
printf(" -> (variables) %s\n\n", d_RPN); |
printf(" -> (variables) %s\n\n", d_RPN); |
|
|
printf(" -> (variables) %s\n", d_ALG); |
printf(" -> (variables) %s\n\n", d_ALG); |
|
|
|
printf(" -> (variables) %s\n", d_NOM); |
|
|
return; |
return; |
} |
} |
Line 189 instruction_fleche(struct_processus *s_e
|
Line 191 instruction_fleche(struct_processus *s_e
|
|
|
if ((*s_etat_processus).instruction_valide == 'N') |
if ((*s_etat_processus).instruction_valide == 'N') |
{ |
{ |
|
(*s_etat_processus).type_en_cours = NON; |
recherche_type(s_etat_processus); |
recherche_type(s_etat_processus); |
|
|
if ((*s_etat_processus).erreur_execution != d_ex) |
if ((*s_etat_processus).erreur_execution != d_ex) |
Line 223 instruction_fleche(struct_processus *s_e
|
Line 226 instruction_fleche(struct_processus *s_e
|
else if ((*((struct_nom *) (*(*(*s_etat_processus).l_base_pile) |
else if ((*((struct_nom *) (*(*(*s_etat_processus).l_base_pile) |
.donnee).objet)).symbole == d_vrai) |
.donnee).objet)).symbole == d_vrai) |
{ |
{ |
(*s_etat_processus).erreur_execution = d_ex_nom_invalide; |
(*s_etat_processus).niveau_courant++; |
(*s_etat_processus).instruction_courante = tampon; |
fin_scrutation = d_vrai; |
return; |
presence_expression_algebrique = d_vrai; |
|
|
|
if (depilement(s_etat_processus, &((*s_etat_processus) |
|
.l_base_pile), &s_expression_algebrique) |
|
== d_erreur) |
|
{ |
|
(*s_etat_processus).erreur_execution = |
|
d_ex_manque_argument; |
|
(*s_etat_processus).instruction_courante = tampon; |
|
return; |
|
} |
} |
} |
else |
else |
{ |
{ |
Line 292 instruction_fleche(struct_processus *s_e
|
Line 305 instruction_fleche(struct_processus *s_e
|
(*s_etat_processus).erreur_execution = d_ex_nom_invalide; |
(*s_etat_processus).erreur_execution = d_ex_nom_invalide; |
return; |
return; |
} |
} |
|
else if ((*((struct_nom *) (*(*l_element_courant).donnee).objet)) |
|
.symbole == d_vrai) |
|
{ |
|
(*s_etat_processus).niveau_courant++; |
|
fin_scrutation = d_vrai; |
|
presence_expression_algebrique = d_vrai; |
|
|
|
s_expression_algebrique = (*l_element_courant).donnee; |
|
} |
else |
else |
{ |
{ |
if ((s_objet_elementaire = copie_objet(s_etat_processus, |
if ((s_objet_elementaire = copie_objet(s_etat_processus, |
Line 726 instruction_fleche(struct_processus *s_e
|
Line 748 instruction_fleche(struct_processus *s_e
|
|
|
if (presence_expression_algebrique == d_vrai) |
if (presence_expression_algebrique == d_vrai) |
{ |
{ |
|
// Si l'expression algébrique est réduite à un simple nom, il |
|
// s'agit toujours d'un nom symbolique. Il faut alors lui retirer |
|
// son caractère de constante symbolique pour faire remonter les |
|
// erreurs de type 'variable indéfinie'. |
|
|
|
if ((*s_expression_algebrique).type == NOM) |
|
{ |
|
(*((struct_nom *) (*s_expression_algebrique).objet)).symbole = |
|
d_faux; |
|
} |
|
|
evaluation(s_etat_processus, s_expression_algebrique, 'N'); |
evaluation(s_etat_processus, s_expression_algebrique, 'N'); |
|
|
|
if ((*s_expression_algebrique).type == NOM) |
|
{ |
|
(*((struct_nom *) (*s_expression_algebrique).objet)).symbole = |
|
d_vrai; |
|
} |
|
|
if ((*s_etat_processus).mode_execution_programme == 'Y') |
if ((*s_etat_processus).mode_execution_programme == 'Y') |
{ |
{ |
liberation(s_etat_processus, s_expression_algebrique); |
liberation(s_etat_processus, s_expression_algebrique); |
} |
} |
|
|
|
(*s_etat_processus).autorisation_empilement_programme = 'Y'; |
(*s_etat_processus).niveau_courant--; |
(*s_etat_processus).niveau_courant--; |
|
|
if (retrait_variables_par_niveau(s_etat_processus) == d_erreur) |
if (retrait_variables_par_niveau(s_etat_processus) == d_erreur) |
{ |
{ |
return; |
return; |
} |
} |
|
|
(*s_etat_processus).autorisation_empilement_programme = 'Y'; |
|
} |
} |
|
|
return; |
return; |
Line 1008 instruction_for(struct_processus *s_etat
|
Line 1046 instruction_for(struct_processus *s_etat
|
return; |
return; |
} |
} |
|
|
if (((*s_objet_2).type != INT) && |
if (((*s_objet_2).type != INT) && ((*s_objet_2).type != REL)) |
((*s_objet_2).type != REL)) |
|
{ |
{ |
liberation(s_etat_processus, s_objet_1); |
liberation(s_etat_processus, s_objet_1); |
liberation(s_etat_processus, s_objet_2); |
liberation(s_etat_processus, s_objet_2); |
Line 1018 instruction_for(struct_processus *s_etat
|
Line 1055 instruction_for(struct_processus *s_etat
|
return; |
return; |
} |
} |
|
|
tampon = (*s_etat_processus).instruction_courante; |
|
test_instruction = (*s_etat_processus).test_instruction; |
|
instruction_valide = (*s_etat_processus).instruction_valide; |
|
(*s_etat_processus).test_instruction = 'Y'; |
|
|
|
empilement_pile_systeme(s_etat_processus); |
empilement_pile_systeme(s_etat_processus); |
|
|
if ((*s_etat_processus).erreur_systeme != d_es) |
if ((*s_etat_processus).erreur_systeme != d_es) |
Line 1032 instruction_for(struct_processus *s_etat
|
Line 1064 instruction_for(struct_processus *s_etat
|
|
|
if ((*s_etat_processus).mode_execution_programme == 'Y') |
if ((*s_etat_processus).mode_execution_programme == 'Y') |
{ |
{ |
|
tampon = (*s_etat_processus).instruction_courante; |
|
test_instruction = (*s_etat_processus).test_instruction; |
|
instruction_valide = (*s_etat_processus).instruction_valide; |
|
(*s_etat_processus).test_instruction = 'Y'; |
|
|
if (recherche_instruction_suivante(s_etat_processus) == d_erreur) |
if (recherche_instruction_suivante(s_etat_processus) == d_erreur) |
{ |
{ |
return; |
return; |
Line 1046 instruction_for(struct_processus *s_etat
|
Line 1083 instruction_for(struct_processus *s_etat
|
|
|
free((*s_etat_processus).instruction_courante); |
free((*s_etat_processus).instruction_courante); |
(*s_etat_processus).instruction_courante = tampon; |
(*s_etat_processus).instruction_courante = tampon; |
|
(*s_etat_processus).instruction_valide = instruction_valide; |
|
(*s_etat_processus).test_instruction = test_instruction; |
|
|
depilement_pile_systeme(s_etat_processus); |
depilement_pile_systeme(s_etat_processus); |
|
|
Line 1053 instruction_for(struct_processus *s_etat
|
Line 1092 instruction_for(struct_processus *s_etat
|
return; |
return; |
} |
} |
|
|
|
(*s_etat_processus).type_en_cours = NON; |
recherche_type(s_etat_processus); |
recherche_type(s_etat_processus); |
|
|
free((*s_etat_processus).instruction_courante); |
free((*s_etat_processus).instruction_courante); |
(*s_etat_processus).instruction_courante = tampon; |
(*s_etat_processus).instruction_courante = tampon; |
|
(*s_etat_processus).instruction_valide = instruction_valide; |
|
(*s_etat_processus).test_instruction = test_instruction; |
|
|
if ((*s_etat_processus).erreur_execution != d_ex) |
if ((*s_etat_processus).erreur_execution != d_ex) |
{ |
{ |
Line 1148 instruction_for(struct_processus *s_etat
|
Line 1190 instruction_for(struct_processus *s_etat
|
|
|
liberation(s_etat_processus, s_objet_3); |
liberation(s_etat_processus, s_objet_3); |
|
|
(*s_etat_processus).test_instruction = test_instruction; |
|
(*s_etat_processus).instruction_valide = instruction_valide; |
|
|
|
(*(*s_etat_processus).l_base_pile_systeme).limite_indice_boucle = s_objet_1; |
(*(*s_etat_processus).l_base_pile_systeme).limite_indice_boucle = s_objet_1; |
|
|
if ((*s_etat_processus).mode_execution_programme == 'Y') |
if ((*s_etat_processus).mode_execution_programme == 'Y') |