/* ================================================================================ RPL/2 (R) version 4.1.22 Copyright (C) 1989-2015 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" /* ================================================================================ Fonction '<<' ================================================================================ Entrées : -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void instruction_vers_niveau_superieur(struct_processus *s_etat_processus) { (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') { return; } else if ((*s_etat_processus).test_instruction == 'Y') { (*s_etat_processus).instruction_valide = 'Y'; (*s_etat_processus).nombre_arguments = -1; return; } empilement_pile_systeme(s_etat_processus); if ((*s_etat_processus).erreur_systeme != d_es) { return; } if ((*s_etat_processus).mode_execution_programme == 'I') { (*(*s_etat_processus).l_base_pile_systeme).niveau_courant = (*s_etat_processus).niveau_courant; (*(*s_etat_processus).l_base_pile_systeme) .origine_routine_evaluation = 'Y'; (*s_etat_processus).mode_execution_programme = 'N'; } (*s_etat_processus).niveau_courant++; (*s_etat_processus).autorisation_empilement_programme = 'Y'; if ((*s_etat_processus).debug == d_vrai) if (((*s_etat_processus).type_debug & d_debug_niveaux) != 0) { if ((*s_etat_processus).langue == 'F') { printf("[%d] Initialisation du niveau %lld\n", (int) getpid(), (*s_etat_processus).niveau_courant); } else { printf("[%d] Initialization of level %lld\n", (int) getpid(), (*s_etat_processus).niveau_courant); } fflush(stdout); } return; } /* ================================================================================ Fonction '>>' ================================================================================ Entrées : -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void instruction_vers_niveau_inferieur(struct_processus *s_etat_processus) { (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') { return; } else if ((*s_etat_processus).test_instruction == 'Y') { (*s_etat_processus).instruction_valide = 'Y'; (*s_etat_processus).nombre_arguments = -1; return; } if ((*s_etat_processus).debug == d_vrai) if (((*s_etat_processus).type_debug & d_debug_niveaux) != 0) { if ((*s_etat_processus).langue == 'F') { printf("[%d] Fermeture du niveau %lld\n", (int) getpid(), (*s_etat_processus).niveau_courant); } else { printf("[%d] Closing of level %lld\n", (int) getpid(), (*s_etat_processus).niveau_courant); } fflush(stdout); } (*s_etat_processus).niveau_courant--; depilement_pile_systeme(s_etat_processus); if ((*s_etat_processus).erreur_systeme != d_es) { return; } if ((*(*s_etat_processus).l_base_pile_systeme).retour_definition == 'Y') { if ((*s_etat_processus).debug == d_vrai) if (((*s_etat_processus).type_debug & d_debug_appels_fonctions) != 0) { if ((*s_etat_processus).niveau_recursivite == 0) { if ((*s_etat_processus).langue == 'F') { printf("[%d] Retour\n", (int) getpid()); } else { printf("[%d] Return\n", (int) getpid()); } } else { if ((*s_etat_processus).langue == 'F') { printf("[%d] Retour récursif de niveau " "%lld\n", (int) getpid(), (*s_etat_processus) .niveau_recursivite); } else { printf("[%d] Level %lld recursive " "return\n", (int) getpid(), (*s_etat_processus) .niveau_recursivite); } } fflush(stdout); } if ((*s_etat_processus).l_base_pile_systeme != NULL) { if ((*(*s_etat_processus).l_base_pile_systeme) .origine_routine_evaluation == 'N') { (*s_etat_processus).position_courante = (*(*s_etat_processus).l_base_pile_systeme) .adresse_retour; if ((*s_etat_processus).profilage == d_vrai) { profilage(s_etat_processus, NULL); } depilement_pile_systeme(s_etat_processus); if ((*s_etat_processus).erreur_systeme != d_es) { return; } } else { (*s_etat_processus).retour_routine_evaluation = 'Y'; } } } /* * Destruction des variables locales * de niveau supérieur au niveau courant. */ if (((*s_etat_processus).niveau_recursivite == 0) && ((*s_etat_processus) .gel_liste_variables == d_faux)) { if (retrait_variables_par_niveau(s_etat_processus) == d_erreur) { return; } } return; } // vim: ts=4