xc
ProtoExpr.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //ProtoExpresion.h
22 
23 #ifndef PROTOEXPRESION_H
24 #define PROTOEXPRESION_H
25 
26 #include <string>
27 
28 class Lexico;
29 class LexAlgebra;
30 class Operando;
31 class NamedOperand;
32 class Segnal;
33 class Variable;
34 
36  {
37  protected:
38  static LexAlgebra *ptr_lex;
39 
40  static Segnal *CalcularDireccion(const std::string &nmb);
41  public:
42  ProtoExpresion(void);
43  static LexAlgebra &CreaLexico(void);
44  static Lexico &Lex(void);
45  static LexAlgebra &LexA(void);
46  static bool TieneLexico(void);
47  static NamedOperand *NuevaVar(const Variable &v);
48  static NamedOperand *NuevaVar(const std::string &palabra);
49  static Variable *CalcDirVar(const std::string &nmb);
50  static void Asigna(const std::string &palabra,const double &d);
51  static void DesAsigna(const std::string &palabra);
52  };
53 
54 #endif
static Lexico & Lex(void)
Devuelve una referencia al léxico.
Definition: ProtoExpr.cc:32
Definition: NamedOperand.h:28
Definition: ProtoExpr.h:35
ProtoExpresion(void)
Constructor.
Definition: ProtoExpr.cc:28
static NamedOperand * NuevaVar(const Variable &v)
Creates the variable being passed as parameter.
Definition: ProtoExpr.cc:58
Definition: Variable.h:31
static Segnal * CalcularDireccion(const std::string &nmb)
Return a pointer to the signal which name is being passed as parameter.
Definition: ProtoExpr.cc:67
Operando.
Definition: Operando.h:42
static Variable * CalcDirVar(const std::string &nmb)
Return a pointer to the variable which name is being passed as parameter.
Definition: ProtoExpr.cc:55
static void Asigna(const std::string &palabra, const double &d)
Assigns to the variable named &#39;palabra&#39; the value being passed as parameter.
Definition: ProtoExpr.cc:72
Componente elemental de una expresión.
Definition: Segnal.h:60
Léxico para expresiones algebraicas.
Definition: LexAlgebra.h:33
static LexAlgebra & CreaLexico(void)
Devuelve una referencia al léxico.
Definition: ProtoExpr.cc:40
Definition: Lexico.h:42
static void DesAsigna(const std::string &palabra)
Removes the assignment to the variable which name is being passed as parameter.
Definition: ProtoExpr.cc:76
static LexAlgebra & LexA(void)
Devuelve una referencia al léxico.
Definition: ProtoExpr.cc:36