MicroModelicaCCompiler  4.5.3
alg_usage.hpp
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  This file is part of QSS Solver.
4 
5  QSS Solver is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  QSS Solver is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QSS Solver. If not, see <http://www.gnu.org/licenses/>.
17 
18  ******************************************************************************/
19 
20 #ifndef ALG_USAGE_H
21 #define ALG_USAGE_H
22 
23 #include "index.hpp"
24 #include "expression.hpp"
25 
26 namespace MicroModelica {
27 namespace IR {
28 
29 class VariableUsage {
30  public:
31  VariableUsage(Expression lhs, Expression rhs, Index usage);
32  VariableUsage(Expression usage, Range range);
33  VariableUsage(Expression exp, Index usage);
34  ~VariableUsage() = default;
35 
36  Expression lhs() const;
37  Expression rhs() const;
38  Expression usage() const;
39 
40  protected:
41  void generateMapFromUsage();
42  void generateMapFromRange();
43  void generateMapFromLHS();
44 
45  Expression _lhs;
46  Expression _rhs;
47  Expression _replaced;
48  Index _usage;
49  Range _range;
50  map<std::string, AST_Expression> _usage_map;
51 };
52 
53 } // namespace IR
54 } // namespace MicroModelica
55 
56 #endif /* ALG_USAGE_H */
MicroModelica::IR::VariableUsage::generateMapFromLHS
void generateMapFromLHS()
Definition: alg_usage.cpp:126
MicroModelica::IR::VariableUsage::~VariableUsage
~VariableUsage()=default
index.hpp
expression.hpp
MicroModelica::IR::VariableUsage::rhs
Expression rhs() const
Definition: alg_usage.cpp:67
MicroModelica::IR::VariableUsage::_rhs
Expression _rhs
Definition: alg_usage.hpp:97
MicroModelica::IR::VariableUsage::usage
Expression usage() const
Definition: alg_usage.cpp:69
MicroModelica::IR::VariableUsage::VariableUsage
VariableUsage(Expression lhs, Expression rhs, Index usage)
Definition: alg_usage.cpp:49
MicroModelica::IR::VariableUsage::_replaced
Expression _replaced
Definition: alg_usage.hpp:98
MicroModelica::IR::VariableUsage::_usage_map
map< std::string, AST_Expression > _usage_map
Definition: alg_usage.hpp:101
MicroModelica::IR::VariableUsage::lhs
Expression lhs() const
Definition: alg_usage.cpp:65
MicroModelica::IR::VariableUsage::_lhs
Expression _lhs
Definition: alg_usage.hpp:96
MicroModelica::IR::VariableUsage::generateMapFromUsage
void generateMapFromUsage()
Definition: alg_usage.cpp:96
MicroModelica
Definition: files.cpp:45
MicroModelica::IR::VariableUsage::generateMapFromRange
void generateMapFromRange()
Definition: alg_usage.cpp:71
MicroModelica::IR::VariableUsage::_range
Range _range
Definition: alg_usage.hpp:100
MicroModelica::IR::VariableUsage::_usage
Index _usage
Definition: alg_usage.hpp:99