MicroModelicaCCompiler  4.5.3
mmo_model_checker.cpp
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 #include "mmo_model_checker.hpp"
21 
22 #include <ast/class.hpp>
23 #include <ast/composition.hpp>
24 #include <ast/element.hpp>
25 #include <ast/equation.hpp>
26 #include <ast/expression.hpp>
27 #include <ast/modification.hpp>
28 #include <ast/statement.hpp>
30 #include <util/error.hpp>
31 #include <util/util.hpp>
32 
33 using namespace MicroModelica::Util;
34 
35 namespace MicroModelica {
36 namespace IR {
37 
38 /* MicroModelica model checker interface */
39 
40 ModelChecker::ModelChecker(string name) : _has_parent(false), _class_name(), _class_prefix(0), _class_modification(false), _else_when(false)
41 {
42 }
43 
45 
46 void ModelChecker::visit(AST_Class x)
47 {
48  Error::instance().setClassName(*(x->name()));
49  if (x->isFinal()) {
50  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Final definition.");
51  }
52  if (x->isEncapsulated()) {
53  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Encapsulated definition.");
54  }
55  if (x->hasExtends()) {
56  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Extend modifier to Class definition.");
57  }
58  if ((x->prefix() != CP_FUNCTION && x->prefix() != CP_IMPURE && x->prefix() != CP_PURE) && _has_parent) {
59  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Only Function classes allowed.");
60  }
61  _class_prefix = x->prefix();
62  if (_class_prefix == CP_MODEL) {
63  _has_parent = true;
64  }
65  switch (_class_prefix) {
66  case CP_PARTIAL:
67  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Partial definition.");
68  break;
69  case CP_CLASS:
70  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Class definition.");
71  break;
72  case CP_BLOCK:
73  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Block definition.");
74  break;
75  case CP_RECORD:
76  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Record definition.");
77  break;
78  case CP_CONNECTOR:
79  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Connector definition.");
80  break;
81  case CP_TYPE:
82  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Type definition.");
83  break;
84  case CP_OPERATOR:
85  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Operator definition.");
86  break;
87  case CP_EXPANDABLE:
88  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Expandable definition.");
89  break;
90  default:
91  break;
92  }
93  if (x->hasElementComponentList()) {
94  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Class definition.");
95  }
96 }
97 
98 void ModelChecker::leave(AST_Class x)
99 {
100  if (x->prefix() == CP_MODEL) {
101  _has_parent = false;
102  }
103 }
104 
105 void ModelChecker::visit(AST_Composition x)
106 {
108  if (x->hasCompositionList()) {
109  AST_CompositionElementListIterator it;
110  AST_CompositionElementList cl = x->compositionList();
111  foreach (it, cl) {
112  if (current_element(it)->hasEquations()) {
113  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Equation section inside function definition.");
114  }
115  }
116  }
117  } else if (_class_prefix == CP_MODEL) {
118  if (x->hasExternalFunctionCall()) {
119  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "External function call inside Model class.");
120  }
121  } else if (_class_prefix == CP_PACKAGE) {
122  if (x->hasCompositionList()) {
123  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Composition elements inside Package class.");
124  }
125  if (x->hasExternalFunctionCall()) {
126  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "External function call inside Package class.");
127  }
128  }
129 }
130 
131 void ModelChecker::leave(AST_Composition x) {}
132 
133 void ModelChecker::visit(AST_CompositionElement x)
134 {
135  if (_class_prefix == CP_MODEL) {
136  if (x->hasElements()) {
137  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Protected element definition inside Model Class.");
138  }
139  }
140 }
141 
142 void ModelChecker::leave(AST_CompositionElement x) {}
143 
144 void ModelChecker::visit(AST_CompositionEqsAlgs x)
145 {
147  if (x->isInitial() && !_has_parent) {
148  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Initial section inside function definition.");
149  }
150  }
151 }
152 
153 void ModelChecker::leave(AST_CompositionEqsAlgs x) {}
154 
155 void ModelChecker::visit(AST_External_Function_Call x)
156 {
157  if (x->languageString() != Utils::instance().languageEspecification()) {
158  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Language Specification not recognized.");
159  }
160 }
161 
162 void ModelChecker::visit(AST_Element x)
163 {
164  ElementType e = x->elementType();
165  if (e == EXTENDS) {
166  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Extends clause not allowed.");
167  }
168  if (e == COMPONENT) {
169  AST_Element_Component c = x->getAsComponent();
170  AST_DeclarationListIterator it;
171  AST_TypePrefix tp = c->typePrefix();
172  AST_DeclarationList dl = c->nameList();
173  foreach (it, dl) {
174  if (Utils::instance().checkCompiledFunctions(current_element(it)->name())) {
175  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Redefinition of symbol used in variable name: %s.",
176  current_element(it)->name().c_str());
177  }
178  if (Utils::instance().checkBuiltInFunctions(current_element(it)->name())) {
179  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Redefinition of symbol used in variable name: %s.",
180  current_element(it)->name().c_str());
181  }
182  if (current_element(it)->hasModification() && !(tp & TP_PARAMETER) && !(tp & TP_CONSTANT)) {
183  if (current_element(it)->modification()->modificationType() == MODEQUAL) {
184  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Only parameters or constants can be assigned.");
185  }
186  }
187  }
188  if (c->hasIndexes()) {
189  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Array subscripts modifiers in component.");
190  }
191  if (c->isStream()) {
192  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Stream type prefixes not allowed.");
193  }
194  if (c->isFlow()) {
195  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Flow type prefixes not allowed.");
196  }
197  if (c->isConstant()) {
198  AST_DeclarationListIterator it;
199  AST_DeclarationList dl = c->nameList();
200  foreach (it, dl) {
201  if (current_element(it)->hasModification()) {
202  AST_Modification m = current_element(it)->modification();
203  if (m->modificationType() == MODCLASS) {
204  AST_ArgumentListIterator it;
205  AST_Expression asgExp = m->getAsClass()->exp();
206  if (asgExp->expressionType() == EXPNULL) {
207  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong constant definition %s.",
208  c->name().c_str());
209  }
210  }
211  } else {
212  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong constant definition %s.", c->name().c_str());
213  }
214  }
215  }
216  if (!Utils::instance().checkTypeString(c->type())) {
217  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Predefined type not recognized.");
218  }
219  }
220  if (_class_prefix == CP_PACKAGE) {
221  if (e == ELCLASS) {
222  AST_ClassPrefix c = x->getAsClassWrapper()->getClass()->prefix();
223  if (!(c & CP_FUNCTION) && !(c & CP_PURE) && !(c & CP_IMPURE)) {
225  "Only function class definitions allowed inside Package class.");
226  }
227  }
228  }
229  if (e == ELCLASS) {
230  AST_Class c = x->getAsClassWrapper()->getClass();
231  visit(c);
232  }
233 }
234 
235 void ModelChecker::visit(AST_Modification x)
236 {
237  if (x->modificationType() == MODASSIGN) {
238  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Assign modifier.");
239  }
240  if (x->modificationType() == MODCLASS) {
241  _class_modification = true;
242  }
243 }
244 
245 void ModelChecker::leave(AST_Modification x)
246 {
247  if (x->modificationType() == MODCLASS) {
248  _class_modification = false;
249  }
250 }
251 
252 void ModelChecker::visit(AST_Comment x) {}
253 
254 bool ModelChecker::_lValue(AST_Expression left)
255 {
256  ExpressionType et = left->expressionType();
257  if (et == EXPCOMPREF || et == EXPDERIVATIVE || et == EXPOUTPUT) {
258  if (et == EXPDERIVATIVE) {
259  AST_ExpressionList el = left->getAsDerivative()->arguments();
260  if (el->size() > 1) {
261  Error::instance().add(left->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong LValue expression.");
262  return false;
263  }
264  AST_Expression e = AST_ListFirst(el);
265  if (e->expressionType() != EXPCOMPREF) {
266  Error::instance().add(e->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong LValue expression.");
267  return false;
268  }
269  AST_Expression_ComponentReference cr = e->getAsComponentReference();
270  if (cr->hasIndexes()) {
271  AST_ExpressionList ell = AST_ListFirst(cr->indexes());
272  AST_ExpressionListIterator elit;
273  foreach (elit, ell) {
274  AST_Expression exp = current_element(elit);
275  ExpressionType et = exp->expressionType();
276  if (et != EXPCOMPREF && et != EXPINTEGER && et != EXPBINOP) {
277  Error::instance().add(exp->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong index formula.");
278  }
279  }
280  }
281  } else if (et == EXPOUTPUT) {
282  AST_Expression_Output eout = left->getAsOutput();
283  AST_ExpressionList el = eout->expressionList();
284  AST_ExpressionListIterator it;
285  foreach (it, el) {
286  if (current_element(it)->expressionType() != EXPCOMPREF) {
287  Error::instance().add(current_element(it)->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong algebraic expression.");
288  return false;
289  }
290  }
291  }
292  return true;
293  }
294  return false;
295 }
296 
297 void ModelChecker::visit(AST_Equation x)
298 {
299  EquationType e = x->equationType();
300  if (e == EQCALL || e == EQCONNECT || e == EQIF) {
301  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Equation type not allowed %d.", e);
302  }
303  if (e == EQEQUALITY) {
304  AST_Equation_Equality ec = x->getAsEquality();
305  if (!_lValue(ec->left())) {
306  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong left hand side equation.");
307  }
308  visit(ec->right());
309  }
310  if (e == EQFOR) {
311  AST_Equation_For ef = x->getAsFor();
312  if (ef->forIndexList()->size() == 0) {
313  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "No index found in For equation.");
314  }
315  AST_ForIndexList fil = ef->forIndexList();
316  AST_ForIndexListIterator filit;
317  foreach (filit, fil) {
318  visit(current_element(filit));
319  }
320  AST_EquationList eql = ef->equationList();
321  AST_EquationListIterator eq;
322  foreach (eq, eql) {
323  visit(current_element(eq));
324  }
325  }
326 }
327 
328 void ModelChecker::visit(AST_ForIndex x)
329 {
330  if (x->in_exp()->expressionType() != EXPRANGE) {
331  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong For index expression.");
332  AST_Expression_Range er = x->in_exp()->getAsRange();
333  if (er->expressionList()->size() > 2) {
334  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong For index expression.");
335  }
336  }
337 }
338 
339 void ModelChecker::visit(AST_Equation_Else x)
340 {
341  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "If equation.");
342 }
343 
344 void ModelChecker::visit(AST_Expression x)
345 {
346  ExpressionType et = x->expressionType();
347  switch (et) {
348  case EXPIF:
349  case EXPELSEIF:
350  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "If equation not allowed.");
351  break;
352  case EXPCOMPREF: {
353  AST_Expression_ComponentReference cr = x->getAsComponentReference();
354  if (cr->names()->size() > 1) {
355  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "Wrong Component reference.");
356  }
357  AST_ExpressionList el = cr->indexes()->front();
358  if (el->size() > 0) {
359  visit(el->front());
360  }
361  break;
362  }
363  default:
364  break;
365  }
366 }
367 
368 void ModelChecker::visit(AST_Argument x)
369 {
370  if (x->argumentType() == AR_REDECLARATION) {
371  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "Argument Re-declaration.");
372  }
373  if (x->isFinal()) {
374  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "Final modifier.");
375  }
376  if (x->argumentType() == AR_MODIFICATION) {
377  AST_Argument_Modification am = x->getAsModification();
378  if (am->hasModification() && _class_modification == false) {
379  if (Utils::instance().checkExperimentAnnotations(am->name())) {
380  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "Annotation not recognized.");
381  }
382  }
383  }
384 }
385 
386 bool ModelChecker::_whenStatement(AST_Expression cond)
387 {
388  AST_Expression exp = cond;
389  if (cond->expressionType() == EXPOUTPUT) {
390  exp = AST_ListFirst(cond->getAsOutput()->expressionList());
391  }
392  if (exp->expressionType() != EXPBINOP) {
393  return false;
394  }
395  BinOpType bot = exp->getAsBinOp()->binopType();
396  if (bot != BINOPLOWER && bot != BINOPLOWEREQ && bot != BINOPGREATER && bot != BINOPGREATEREQ) {
397  return false;
398  }
399  return true;
400 }
401 
402 void ModelChecker::visit(AST_Statement x)
403 {
404  StatementType st = x->statementType();
405  switch (st) {
406  case STWHILE:
407  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "While statement not allowed.");
408  break;
409  case STBREAK:
410  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "Break statement not allowed.");
411  break;
412  case STFOR: {
413  AST_Statement_For ef = x->getAsFor();
414  if (ef->forIndexList()->size() == 0) {
415  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "No index found in for statement.");
416  }
417  AST_ForIndexList fil = ef->forIndexList();
418  AST_ForIndexListIterator filit;
419  foreach (filit, fil) {
420  visit(current_element(filit));
421  }
422  AST_StatementList eql = ef->statements();
423  AST_StatementListIterator eq;
424  foreach (eq, eql) {
425  visit(current_element(eq));
426  }
427  break;
428  }
429  case STRETURN:
431  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "return statement outside function class.");
432  }
433  break;
434  case STWHEN: {
435  AST_Statement_When sw = x->getAsWhen();
436  if (!_whenStatement(sw->condition())) {
437  Error::instance().add(x->lineNum(), EM_AST | EM_CLASS_DEFINITION, ER_Error, "When condition must be a simple relation.");
438  }
439  AST_StatementList stl = sw->statements();
440  AST_StatementListIterator st;
441  foreach (st, stl) {
442  visit(current_element(st));
443  }
444  if (sw->hasElsewhen()) {
445  _else_when = true;
446  AST_Statement_ElseList ell = sw->else_when();
447  AST_Statement_ElseListIterator elt;
448  foreach (elt, ell) {
449  visit(current_element(elt));
450  }
451  }
452  if (sw->hasComment()) {
453  visit(sw->comment());
454  }
455  break;
456  }
457  default:
458  break;
459  }
460 }
461 
462 void ModelChecker::leave(AST_Statement x)
463 {
464  if (x->statementType() == STWHEN) {
465  if (x->getAsWhen()->hasElsewhen()) {
466  _else_when = false;
467  }
468  }
469 }
470 
471 void ModelChecker::visit(AST_Statement_Else x)
472 {
473  if (_else_when == true) {
474  _whenStatement(x->condition());
475  }
476  AST_StatementList stl = x->statements();
477  AST_StatementListIterator sti;
478  foreach (sti, stl) {
479  visit(current_element(sti));
480  }
481 }
482 
483 void ModelChecker::visit(AST_StoredDefinition x)
484 {
485  if (x->hasWithin()) {
486  Error::instance().add(x->lineNum(), EM_AST | EM_DEFINITION_NOT_ALLOWED, ER_Error, "Within inside stored definition.");
487  }
488 }
489 
490 void ModelChecker::leave(AST_StoredDefinition x) { Error::instance().show(); }
491 
492 int ModelChecker::apply(AST_Node x)
493 {
494  x->accept(this);
495  return Error::instance().errors();
496 }
497 } // namespace IR
498 } // namespace MicroModelica
EM_DEFINITION_NOT_ALLOWED
#define EM_DEFINITION_NOT_ALLOWED
Definition: error.hpp:110
equation.hpp
EXPINTEGER
@ EXPINTEGER
Definition: ast_types.hpp:180
EXPOUTPUT
@ EXPOUTPUT
Definition: ast_types.hpp:182
MicroModelica::Util::Error::instance
static Error & instance()
Definition: error.hpp:128
MicroModelica::Util::Utils::languageEspecification
std::string languageEspecification()
Definition: util.cpp:108
MicroModelica::Util
Definition: equation.hpp:44
MODASSIGN
@ MODASSIGN
Definition: ast_types.hpp:189
mmo_model_checker.hpp
EXPCOMPREF
@ EXPCOMPREF
Definition: ast_types.hpp:165
CP_BLOCK
@ CP_BLOCK
Definition: ast_types.hpp:216
MicroModelica::IR::ModelChecker::ModelChecker
ModelChecker(string name)
Definition: mmo_model_checker.cpp:40
STWHILE
@ STWHILE
Definition: ast_types.hpp:191
EXPELSEIF
@ EXPELSEIF
Definition: ast_types.hpp:174
EQCONNECT
@ EQCONNECT
Definition: ast_types.hpp:161
ELCLASS
@ ELCLASS
Definition: ast_types.hpp:159
BINOPGREATER
@ BINOPGREATER
Definition: ast_types.hpp:142
MicroModelica::IR::ModelChecker::~ModelChecker
~ModelChecker()
Definition: mmo_model_checker.cpp:44
element.hpp
EQIF
@ EQIF
Definition: ast_types.hpp:161
TP_CONSTANT
@ TP_CONSTANT
Definition: ast_types.hpp:200
ExpressionType
ExpressionType
Definition: ast_types.hpp:163
EXPIF
@ EXPIF
Definition: ast_types.hpp:170
MicroModelica::IR::ModelChecker::leave
void leave(AST_Class x)
Definition: mmo_model_checker.cpp:98
composition.hpp
BINOPLOWER
@ BINOPLOWER
Definition: ast_types.hpp:140
CP_IMPURE
@ CP_IMPURE
Definition: ast_types.hpp:223
EXPRANGE
@ EXPRANGE
Definition: ast_types.hpp:183
EQFOR
@ EQFOR
Definition: ast_types.hpp:161
STBREAK
@ STBREAK
Definition: ast_types.hpp:191
EXTENDS
@ EXTENDS
Definition: ast_types.hpp:159
AST_ClassPrefix
int AST_ClassPrefix
Definition: ast_types.hpp:51
STFOR
@ STFOR
Definition: ast_types.hpp:191
EXPDERIVATIVE
@ EXPDERIVATIVE
Definition: ast_types.hpp:167
TP_PARAMETER
@ TP_PARAMETER
Definition: ast_types.hpp:197
MicroModelica::IR::ModelChecker::_else_when
bool _else_when
Definition: mmo_model_checker.hpp:118
MicroModelica::Util::ER_Error
@ ER_Error
ER_Error.
Definition: error.hpp:122
EM_CLASS_DEFINITION
#define EM_CLASS_DEFINITION
Definition: error.hpp:111
MicroModelica::IR::ModelChecker::visit
void visit(AST_Class x)
Definition: mmo_model_checker.cpp:46
AST_TypePrefix
int AST_TypePrefix
Definition: ast_types.hpp:50
MicroModelica::Util::Error::show
void show()
Definition: error.cpp:66
stored_definition.hpp
BINOPGREATEREQ
@ BINOPGREATEREQ
Definition: ast_types.hpp:143
MicroModelica::Util::Error::setClassName
void setClassName(std::string class_name)
Definition: error.cpp:38
MicroModelica::Util::Error::add
void add(int pos, unsigned int code, ER_Type t, const std::string message,...)
Definition: error.cpp:42
MicroModelica::Util::Error::errors
int errors()
Definition: error.cpp:257
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
EXPNULL
@ EXPNULL
Definition: ast_types.hpp:168
MODEQUAL
@ MODEQUAL
Definition: ast_types.hpp:189
AST_ListFirst
T1 AST_ListFirst(list< T1 > *l)
Definition: ast_types.hpp:271
CP_TYPE
@ CP_TYPE
Definition: ast_types.hpp:219
AR_MODIFICATION
@ AR_MODIFICATION
Definition: ast_types.hpp:206
MicroModelica::IR::ModelChecker::_lValue
bool _lValue(AST_Expression left)
Definition: mmo_model_checker.cpp:254
EQCALL
@ EQCALL
Definition: ast_types.hpp:161
MicroModelica::IR::ModelChecker::_whenStatement
bool _whenStatement(AST_Expression cond)
Definition: mmo_model_checker.cpp:386
AR_REDECLARATION
@ AR_REDECLARATION
Definition: ast_types.hpp:206
class.hpp
CP_PURE
@ CP_PURE
Definition: ast_types.hpp:222
ElementType
ElementType
Definition: ast_types.hpp:159
modification.hpp
MicroModelica
Definition: files.cpp:45
STRETURN
@ STRETURN
Definition: ast_types.hpp:191
StatementType
StatementType
Definition: ast_types.hpp:191
MicroModelica::IR::ModelChecker::apply
int apply(AST_Node x)
Definition: mmo_model_checker.cpp:492
CP_OPERATOR
@ CP_OPERATOR
Definition: ast_types.hpp:220
CP_CONNECTOR
@ CP_CONNECTOR
Definition: ast_types.hpp:218
MODCLASS
@ MODCLASS
Definition: ast_types.hpp:189
EXPBINOP
@ EXPBINOP
Definition: ast_types.hpp:166
CP_RECORD
@ CP_RECORD
Definition: ast_types.hpp:217
MicroModelica::Util::Utils::instance
static Utils & instance()
Definition: util.hpp:83
CP_PACKAGE
@ CP_PACKAGE
Definition: ast_types.hpp:224
BINOPLOWEREQ
@ BINOPLOWEREQ
Definition: ast_types.hpp:141
CP_EXPANDABLE
@ CP_EXPANDABLE
Definition: ast_types.hpp:221
EQEQUALITY
@ EQEQUALITY
Definition: ast_types.hpp:161
CP_PARTIAL
@ CP_PARTIAL
Definition: ast_types.hpp:213
CP_FUNCTION
@ CP_FUNCTION
Definition: ast_types.hpp:225
EquationType
EquationType
Definition: ast_types.hpp:161
EM_AST
#define EM_AST
Definition: error.hpp:65
BinOpType
BinOpType
Definition: ast_types.hpp:137
STWHEN
@ STWHEN
Definition: ast_types.hpp:191
CP_CLASS
@ CP_CLASS
Definition: ast_types.hpp:214
CP_MODEL
@ CP_MODEL
Definition: ast_types.hpp:215
MicroModelica::IR::ModelChecker::_class_prefix
AST_ClassPrefix _class_prefix
Definition: mmo_model_checker.hpp:116
COMPONENT
@ COMPONENT
Definition: ast_types.hpp:159
current_element
#define current_element(it)
Definition: ast_types.hpp:34
util.hpp
error.hpp
expression.hpp
statement.hpp