MicroModelicaCCompiler  4.5.3
mmo_model_checker.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 #pragma once
21 
22 #include <string>
23 
24 #include <ast/ast_types.hpp>
25 #include <util/ast_util.hpp>
26 #include <util/util_types.hpp>
27 
28 namespace MicroModelica {
29 namespace IR {
30 
31 class ModelChecker : public AST_Visitor {
32  public:
33  ModelChecker(string name);
34  ~ModelChecker();
35  void visit(AST_Class x);
36  void leave(AST_Class x);
37  void visit(AST_Composition x);
38  void leave(AST_Composition x);
39  void visit(AST_CompositionElement x);
40  void leave(AST_CompositionElement x);
41  void visit(AST_CompositionEqsAlgs x);
42  void leave(AST_CompositionEqsAlgs x);
43  void visit(AST_External_Function_Call);
44  void visit(AST_Element x);
45  void visit(AST_Modification x);
46  void leave(AST_Modification x);
47  void visit(AST_Comment x);
48  void visit(AST_Equation x);
49  void visit(AST_ForIndex x);
50  void visit(AST_Equation_Else x);
51  void visit(AST_Expression x);
52  void visit(AST_Argument x);
53  void visit(AST_Statement x);
54  void leave(AST_Statement x);
55  void visit(AST_Statement_Else x);
56  void visit(AST_StoredDefinition x);
57  void leave(AST_StoredDefinition x);
58  int apply(AST_Node x);
59 
60  private:
61  bool _lValue(AST_Expression left);
62  bool _whenStatement(AST_Expression cond);
63  bool _has_parent;
64  std::string _class_name;
67  bool _else_when;
68 };
69 } // namespace IR
70 } // namespace MicroModelica
MicroModelica::IR::ModelChecker::ModelChecker
ModelChecker(string name)
Definition: mmo_model_checker.cpp:40
MicroModelica::IR::ModelChecker::~ModelChecker
~ModelChecker()
Definition: mmo_model_checker.cpp:44
ast_util.hpp
MicroModelica::IR::ModelChecker::leave
void leave(AST_Class x)
Definition: mmo_model_checker.cpp:98
AST_ClassPrefix
int AST_ClassPrefix
Definition: ast_types.hpp:51
MicroModelica::IR::ModelChecker::_else_when
bool _else_when
Definition: mmo_model_checker.hpp:118
MicroModelica::IR::ModelChecker::visit
void visit(AST_Class x)
Definition: mmo_model_checker.cpp:46
util_types.hpp
MicroModelica::IR::ModelChecker::_has_parent
bool _has_parent
Definition: mmo_model_checker.hpp:114
MicroModelica::IR::ModelChecker::_class_modification
bool _class_modification
Definition: mmo_model_checker.hpp:117
MicroModelica::IR::ModelChecker::_class_name
std::string _class_name
Definition: mmo_model_checker.hpp:115
MicroModelica::IR::ModelChecker::_lValue
bool _lValue(AST_Expression left)
Definition: mmo_model_checker.cpp:254
MicroModelica::IR::ModelChecker::_whenStatement
bool _whenStatement(AST_Expression cond)
Definition: mmo_model_checker.cpp:386
MicroModelica
Definition: files.cpp:45
MicroModelica::IR::ModelChecker::apply
int apply(AST_Node x)
Definition: mmo_model_checker.cpp:492
ast_types.hpp
AST_Visitor
Definition: ast_util.hpp:224
MicroModelica::IR::ModelChecker::_class_prefix
AST_ClassPrefix _class_prefix
Definition: mmo_model_checker.hpp:116