TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Interprete_bloc.h
1/****************************************************************************
2* Copyright (c) 2024, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Interprete_bloc_included
17#define Interprete_bloc_included
18
19#include <Interprete.h>
20#include <Liste_bloc.h>
21#include <TRUST_Ref.h>
22#include <Noms.h>
23
24/*! @brief Interprete un bloc d'instructions dans le jeu de donnees.
25 *
26 * Voir Interprete_bloc::interpreter()
27 *
28 *
29 */
31{
32 Declare_instanciable(Interprete_bloc);
33public:
34 // Indique si le bloc se termine par une accolade, un EOF ou le mot FIN
36
37 Entree& interpreter_bloc(Entree& is, Bloc_Type bloc_type, int verifier_sans_interpreter);
38 Objet_U& ajouter(const Nom& nom, DerObjU& object_to_add);
39 Objet_U& objet_local(const Nom& nom);
40 int objet_local_existant(const Nom& nom);
41
43 static Objet_U& objet_global(const Nom& nom);
44 static int objet_global_existant(const Nom& nom);
45 inline const Noms& les_noms() const { return les_noms_ ; }
46
47protected:
48 // Noms des objets lus dans le bloc:
50 // Reference a l'interprete courant avant la creation de celui-ci
52};
53
54
55
56#endif
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Interprete un bloc d'instructions dans le jeu de donnees.
OBS_PTR(Interprete_bloc) pere_
Objet_U & ajouter(const Nom &nom, DerObjU &object_to_add)
Ajoute l'objet ob a la liste des objets de l'interprete, et nomme l'objet avec nom.
Entree & interpreter_bloc(Entree &is, Bloc_Type bloc_type, int verifier_sans_interpreter)
Interpretation d'un bloc d'instructions prises dans l'entree is.
static int objet_global_existant(const Nom &nom)
renvoie un drapeau indiquant si un objet de ce nom existe dans inteprete_courant() ou l'un de ses par...
Objet_U & objet_local(const Nom &nom)
Renvoie l'Objet_U correspondant a nom contenu dans cet interprete_bloc Si l'objet n'existe pas,...
static Interprete_bloc & interprete_courant()
renvoie l'interprete_bloc en train d'etre lu dans le jeu de donnees.
const Noms & les_noms() const
int objet_local_existant(const Nom &nom)
renvoie un drapeau indiquant si un objet de ce nom est enregistre dans cet inteprete (ne teste pas le...
static Objet_U & objet_global(const Nom &nom)
cherche l'objet demande dans l'Interprete_bloc courant (Interprete_bloc::interprete_courant()) et dan...
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73