xc
ExprPostfija.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 //ExprPostFija.h
22 
23 #ifndef EXPRPOSTFIJA_H
24 #define EXPRPOSTFIJA_H
25 
26 #include <iostream>
27 #include "ExprInfija.h"
28 #include <stack>
29 #include "PilaPunteros.h"
30 #include "Operando.h"
31 
32 
33 class ExprPostfija: public Expresion
34  {
35  protected:
37 
38  void TrataParentDcho(Pila &pila,const Segnal *t);
39  void TrataOpBinario(Pila &pila,const Segnal *t);
40  void TrataFinExpr(Pila &pila);
41  void Traduce(const ExprInfija &infija);
42  void Traduce(std::istream &is);
43  public:
44  ExprPostfija(void)
45  : Expresion() {}
46  ExprPostfija(const std::string &str): Expresion()
47  { Expresion::operator=(str); }
48  ExprPostfija(const ExprPostfija &other): Expresion(other) {}
49  ExprPostfija &operator=(const ExprPostfija &other)
50  {
51  Expresion::operator =(other);
52  return *this;
53  }
54  ExprPostfija(const ExprInfija &other): Expresion(other)
55  { Traduce(other); }
56  ExprPostfija &operator=(const ExprInfija &other)
57  {
58  Traduce(other);
59  return *this;
60  }
61  ExprPostfija &operator=(const std::string &str)
62  {
64  return *this;
65  }
66  };
67 
68 #endif
69 
70 
71 
72 
73 
Expresion & operator=(const Expresion &other)
Operador de asignación.
Definition: Expresion.h:56
Definition: ExprPostfija.h:33
Definition: Expresion.h:31
Componente elemental de una expresión.
Definition: Segnal.h:60
Definition: PilaPunteros.h:29
Definition: ExprInfija.h:33
Expresion(void)
Constructor por defecto.
Definition: Expresion.h:49