MicroModelicaCCompiler  4.5.3
helpers.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 <sstream>
21 
22 #include "helpers.hpp"
23 
24 #include <generator/macros.hpp>
26 #include <ir/equation.hpp>
27 #include <ir/expression.hpp>
28 #include <util/error.hpp>
29 #include <util/model_config.hpp>
30 #include <util/util.hpp>
31 #include <util/visitors/get_index_variables.hpp>
32 #include <util/visitors/is_constant_expression.hpp>
33 
34 namespace MicroModelica {
35 using namespace Deps;
36 using namespace Util;
37 using namespace Generator;
38 namespace IR {
39 
40 /* ExternalFunction Class Implementation */
41 
42 ExternalFunction::ExternalFunction(string lvalue, string name, AST_ExpressionList args) : _lvalue(lvalue), _name(name), _args(args) {}
43 
44 std::ostream& operator<<(std::ostream& out, const ExternalFunction& e)
45 {
46  list<string> ret;
47  stringstream buffer;
48  if (!e._lvalue.empty()) {
49  buffer << e._lvalue << " = ";
50  }
51  buffer << e._name << "(";
52  if (e._args != nullptr) {
53  AST_ExpressionListIterator it;
54  unsigned int count = 0;
55  foreach (it, e._args) {
56  Expression ex(current_element(it));
57  buffer << ex;
58  if (++count < e._args->size()) {
59  buffer << ",";
60  }
61  }
62  }
63  buffer << ");";
64  out << buffer.str();
65  return out;
66 }
67 
68 /* CompiledFunction Class Implementation */
69 
70 CompiledFunction::CompiledFunction() : _name(), _prototype(), _includeDirectory(), _libraryDirectory(), _libraries() {}
71 
72 CompiledFunction::CompiledFunction(string name, string includeDir, string libraryDir, SymbolTable& libraries, string prefix)
73  : _name(name), _prefix(prefix), _prototype(), _includeDirectory(includeDir), _libraryDirectory(libraryDir), _libraries(libraries)
74 {
75 }
76 
77 std::ostream& operator<<(std::ostream& out, const CompiledFunction& cf)
78 {
79  out << cf.print();
80  return out;
81 }
82 
83 string CompiledFunction::print() const
84 {
86  stringstream buffer;
87  buffer << _prefix + _name << "(";
88  AST_ExpressionListIterator it;
89  int size = _arguments->size(), i = 0;
90  foreach (it, _arguments) {
91  i++;
93  buffer << ex;
94  buffer << (i < size ? ", " : "");
95  }
96  if (size > 0 && _output_arguments->size()) {
97  buffer << ", ";
98  }
99  size = _output_arguments->size();
100  i = 0;
101  foreach (it, _output_arguments) {
102  i++;
103  Expression ex(current_element(it));
104  if (ex.isReference()) {
105  Option<Variable> var = ex.reference();
106  assert(var);
107  if (ModelConfig::instance().functionCode()) {
108  if (var->isArray()) {
109  buffer << "&";
110  }
111  } else {
112  buffer << "&";
113  }
114  }
115  buffer << ex;
116  buffer << (i < size ? ", " : "");
117  }
118  buffer << ")";
120  return buffer.str();
121 }
122 
123 /* CompiledPackage Class Implementation */
124 
126 
127 CompiledPackage::CompiledPackage(string name) : _name(name), _cft(), _objects() {}
128 
129 CompiledPackage::CompiledPackage(string name, CompiledFunctionTable cft, ImportTable objects) : _name(name), _cft(cft), _objects(objects) {}
130 
131 string CompiledPackage::name() { return _name; }
132 
133 string CompiledPackage::prefix() { return "__" + _name + "__"; }
134 
136 
138 
140 {
141  SymbolTable ret;
143  for (CompiledFunction cf = _cft.begin(it); !_cft.end(it); cf = _cft.next(it)) {
144  if (cf.hasLibraries()) {
145  ret.merge(cf.libraries());
146  }
147  }
148  return ret;
149 }
150 
152 {
153  SymbolTable ret;
155  for (CompiledFunction cf = _cft.begin(it); !_cft.end(it); cf = _cft.next(it)) {
156  if (cf.hasLibraryDirectory()) {
157  string ld = cf.libraryDirectory();
158  ret.insert(ld, ld);
159  }
160  }
161  return ret;
162 }
163 
165 {
166  SymbolTable ret;
168  for (CompiledFunction cf = _cft.begin(it); !_cft.end(it); cf = _cft.next(it)) {
169  if (cf.hasIncludeDirectory()) {
170  string id = cf.includeDirectory();
171  ret.insert(id, id);
172  }
173  }
174  return ret;
175 }
176 
177 /* Function Printer implementation */
178 
179 string FunctionPrinter::loop(int end)
180 {
181  stringstream buffer;
182  buffer << "for (idx = 0; idx <" << end << "; idx++) {";
183  return buffer.str();
184 }
185 
187 {
188  stringstream buffer;
189  buffer << "}";
190  return buffer.str();
191 }
192 
194 {
195  stringstream buffer;
196  buffer << "switch(idx) {";
197  return buffer.str();
198 }
199 
200 string FunctionPrinter::endSwitch() { return "}"; }
201 
202 string FunctionPrinter::beginExpression(string token, Option<Range> range) const
203 {
204  stringstream buffer;
205  if (range) {
206  buffer << "if (_is_var" << token << "(idx)) {" << endl;
207  buffer << TAB << "_get" << token << "_idxs(idx);" << endl;
208  range->addLocalVariables();
209  } else {
210  buffer << TAB << "case " << token << ": {" << endl;
211  }
212  return buffer.str();
213 }
214 
216 {
217  stringstream buffer;
218  switch (ret) {
220  buffer << "return;" << endl;
221  break;
223  if (!range) {
224  buffer << "break;" << endl;
225  }
226  break;
227  }
229  buffer << "continue;" << endl;
230  break;
231  }
232  if (!range) {
233  buffer << TAB;
234  }
235  buffer << "}";
236  return buffer.str();
237 }
238 
240 {
241  if (range) {
242  stringstream buffer;
243  buffer << "}" << endl;
244  return buffer.str();
245  }
246  return "";
247 }
248 
249 string FunctionPrinter::beginDimGuards(string token, string args, Option<Range> range, std::multimap<std::string, int> used_variables) const
250 {
251  stringstream buffer;
252  if (range) {
253  buffer << TAB << "_apply_usage" << token << "(" << args << ");" << endl;
254  RangeDefinitionTable ranges = range->definition();
256  int size = ranges.size(), idx = 1;
257  buffer << TAB << "if (";
258  for (RangeDefinition rd = ranges.begin(it); !ranges.end(it); rd = ranges.next(it), idx++) {
259  string variable = ranges.key(it);
260  if (used_variables.find(variable) != used_variables.end()) {
261  buffer << "(" << ranges.key(it) << " >= " << rd.begin() << " && " << ranges.key(it) << " <= " << rd.end() << ")";
262  buffer << (idx < size ? " && " : "");
263  }
264  }
265  buffer << ") {" << endl;
266  range->addLocalVariables();
267  }
268  return buffer.str();
269 }
270 
271 string FunctionPrinter::algebraic(Equation alg, bool reduction)
272 {
273  stringstream buffer;
274  Option<Range> range = alg.range();
275  bool reduction_range = reduction && range;
276  if (reduction_range) {
277  buffer << range.get();
278  }
279  buffer << TAB << alg;
280  if (reduction_range) {
281  buffer << range.get().end() << endl;
282  }
283  return buffer.str();
284 }
285 
286 string FunctionPrinter::getIndexes(string var, Option<Range> range, int offset, bool modelica_index) const
287 {
288  stringstream buffer;
289  if (range) {
290  map<string, string> parsed_indexes = parseIndexes(var, range, offset, modelica_index);
291  for (auto index_def : parsed_indexes) {
292  buffer << TAB << index_def.first << " = " << index_def.second << endl;
293  }
294  }
295  return buffer.str();
296 }
297 
298 map<int, string> FunctionPrinter::parseConstants(Expression ref) const
299 {
300  map<int, string> ctes;
301  list<Expression> indexes = ref.indexes();
302  int i = 1;
303  for (Expression exp : indexes) {
304  IsConstantExpression constant_exp;
305  if (constant_exp.apply(exp.expression())) {
306  ctes[i] = exp.print();
307  }
308  i++;
309  }
310  return ctes;
311 }
312 
313 map<string, string> FunctionPrinter::parseIndexes(string var, Option<Range> range, int offset, bool modelica_index) const
314 {
315  map<string, string> parsed_indexes;
316  if (range) {
317  RangeDefinitionTable rdt = range->definition();
319  int size = rdt.size(), i = 0, idx = 0;
320  stringstream offset_var;
321  offset_var << "(" << var;
322  if (offset > 0) {
323  offset_var << "-" << offset;
324  }
325  offset_var << ")";
326  string alligned_var = offset_var.str();
327  for (RangeDefinition rd = rdt.begin(it); !rdt.end(it); rd = rdt.next(it), idx++) {
328  stringstream key;
329  stringstream def;
330  key << rdt.key(it);
331  def << (i + 1 < size ? div(mod(alligned_var, idx - 1, range), idx, range) : mod(alligned_var, idx - 1, range))
332  << (modelica_index ? "+ 1;" : ";") << (i + 1 < size ? "\\" : "");
333  parsed_indexes[key.str()] = def.str();
334  i++;
335  }
336  }
337  return parsed_indexes;
338 }
339 
340 string FunctionPrinter::printAlgebraicGuards(Equation alg, Index usage)
341 {
342  stringstream buffer;
343  string arguments;
344  FunctionPrinter printer;
345  Option<Range> range = alg.range();
346  if (range) {
347  Index revert = usage.replace();
348  arguments = revert.usageExp();
349  }
350  buffer << printer.beginDimGuards(alg.applyId(), arguments, range, alg.usedVariables());
351  return buffer.str();
352 }
353 
354 string FunctionPrinter::accessMacros(string token, int offset, Option<Range> range, bool modelica_index) const
355 {
356  stringstream macros;
357  if (range && !range->isEmpty()) {
358  macros << "#define _is_var" << token << "(idx) ";
359  macros << "idx >= " << offset << " && ";
360  macros << "idx < " << offset + range->size() << endl;
361  macros << "#define _get" << token << "_idxs(idx)\\" << endl;
362  macros << TAB << getIndexes("idx", range, offset, modelica_index);
363  }
364  return macros.str();
365 }
366 
367 string FunctionPrinter::mod(string idx, int dim, Option<Range> range) const
368 {
369  if (dim < 0) {
370  return idx;
371  }
372  stringstream buffer;
373  buffer << "(" << mod(idx, dim - 1, range) << "%" << range->rowSize(dim) << ")";
374  return buffer.str();
375 }
376 
377 string FunctionPrinter::div(string idx, int dim, Option<Range> range) const
378 {
379  stringstream buffer;
380  buffer << "(" << idx << "/" << range->rowSize(dim) << ")";
381  return buffer.str();
382 }
383 
385 {
386  assert(exp.isReference());
387  stringstream buffer;
388  Option<Variable> var = exp.reference();
389  assert(var);
390  buffer << "\"" << var->name();
391  if (var->isArray()) {
392  buffer << "[";
393  }
394  if (range) {
395  buffer << range->getPrintDimensionVarsString() << "]\"," << exp.usage();
396  } else if (var->isArray()) {
397  buffer << exp.usage() << "]\"";
398  } else {
399  buffer << exp.usage() << "\"";
400  }
401  return buffer.str();
402 }
403 
404 string FunctionPrinter::equationVariableMacros(Option<Range> range, Expression lhs, string id) const
405 {
406  stringstream buffer;
407  if (range) {
408  GetIndexVariables index_usage;
409  RangeDefinitionTable range_def = range->definition();
410  buffer << "#define _get" << id << "_var_idxs";
411  buffer << "(row, var)\\" << endl;
412  multimap<string, int> usage = index_usage.apply(lhs.expression());
413  map<string, string> parse_row = parseIndexes("row", range, 1);
414  map<int, string> ctes = parseConstants(lhs);
415  int i = 1, size = usage.size();
416  static const bool USE_RANGE_DIM_VARS = true;
417  for (auto index : usage) {
418  string local_range_var = range->getDimensionVar(index.second, USE_RANGE_DIM_VARS);
419  buffer << TAB << local_range_var << " = ";
420  buffer << range_def[index.first]->cBegin() << " + " << parse_row[index.first];
421  buffer << ((i + 1 <= size) ? "\n" : "\\\n");
422  i++;
423  }
424  size = ctes.size();
425  for (auto index : ctes) {
426  string local_range_var = range->getDimensionVar(index.first, USE_RANGE_DIM_VARS);
427  buffer << TAB << local_range_var << " = " << index.second << ";\\\n";
428  }
429  vector<string> exps;
430  exps.push_back(lhs.dimVariables(USE_RANGE_DIM_VARS));
431  Expression a_exp = Expression::generate(lhs.reference()->name(), exps);
432  Index var_ind(a_exp);
433  buffer << TAB << "var = " << var_ind << ";";
434  }
435  return buffer.str();
436 }
437 
438 string FunctionPrinter::jacMacrosAccess(Equation eq, string index, string tab) const
439 {
440  stringstream code;
441  if (eq.hasRange()) {
442  Option<Variable> var = eq.LHSVariable();
443  assert(var);
444  code << tab << "_get" << eq.applyId() << "_var_idxs(" << index << ", eq_var);" << endl;
445  code << tab << "_get" << var.get() << "_idxs(eq_var);" << endl;
446  eq.range()->addRangeLocalVariables();
447  eq.range()->addLocalVariables();
448  }
449  return code.str();
450 }
451 
452 Input::Input(Index idx, Option<Range> range, int id) : _idx(idx), _range(range), _id(id) {}
453 
454 string Input::print() const
455 {
456  stringstream buffer;
457  Macros m;
458  string block = "";
459  if (_range) {
460  buffer << _range.get();
461  block += TAB;
462  }
463  buffer << block << "modelData->IT[" << m.usage(token(), _range, _id) << "] = " << _idx << ";" << endl;
464  if (_range) {
465  buffer << _range->end();
466  }
467  return buffer.str();
468 }
469 
470 string Input::token() const
471 {
472  stringstream buffer;
473  buffer << "_input_" << _id;
474  return buffer.str();
475 }
476 
477 string Input::macro() const
478 {
479  Macros m;
480  return m.indexMacro(token(), _range, _id);
481 }
482 
483 ostream& operator<<(std::ostream& out, const Input& i)
484 {
485  out << i.print();
486  return out;
487 }
488 
489 } // namespace IR
490 } // namespace MicroModelica
MicroModelica::IR::Expression::indexes
list< Expression > indexes() const
Definition: expression.cpp:145
ModelTable< std::string, std::string >
MicroModelica::IR::CompiledFunction
Definition: helpers.hpp:87
MicroModelica::IR::Expression::usage
std::string usage() const
Definition: expression.cpp:101
MicroModelica::IR::CompiledFunction::_name
std::string _name
Definition: helpers.hpp:104
ModelTable::begin
iterator begin()
Definition: table.hpp:68
MicroModelica::IR::Input::_range
Option< Range > _range
Definition: helpers.hpp:191
MicroModelica::IR::operator<<
std::ostream & operator<<(std::ostream &out, const Equation &e)
Definition: equation.cpp:185
MicroModelica::IR::CompiledPackage::libraryDirectories
Util::SymbolTable libraryDirectories()
Definition: helpers.cpp:168
MicroModelica::IR::Input::macro
std::string macro() const
Definition: helpers.cpp:494
usage
void usage()
Definition: main.cpp:48
MicroModelica::IR::Expression::reference
Option< Util::Variable > reference() const
Definition: expression.cpp:94
MicroModelica::IR::CompiledFunction::_arguments
AST_ExpressionList _arguments
Definition: helpers.hpp:113
MicroModelica::Util::ImportTable
ModelTable< std::string, std::string > ImportTable
Definition: util.hpp:66
MicroModelica::IR::FunctionPrinter::getIndexes
std::string getIndexes(string var, Option< Range > range, int offset, bool modelica_index) const
Definition: helpers.cpp:303
MicroModelica::IR::RangeDefinition::begin
int begin() const
Definition: index.hpp:142
expression.hpp
macros.hpp
MicroModelica::IR::FunctionPrinter::endExpression
std::string endExpression(Option< Range > range, FUNCTION_PRINTER::ReturnStatementType ret=FUNCTION_PRINTER::ReturnStatementType::Return) const
Definition: helpers.cpp:232
MicroModelica::IR::FunctionPrinter::endSwitch
std::string endSwitch()
Definition: helpers.cpp:217
MicroModelica::IR::Expression::expression
AST_Expression expression() const
Definition: expression.hpp:87
MicroModelica::IR::FunctionPrinter::algebraic
std::string algebraic(Equation alg, bool reduction)
Definition: helpers.cpp:288
MicroModelica::IR::operator<<
ostream & operator<<(std::ostream &out, const Input &i)
Definition: helpers.cpp:500
ModelTable::key
Key key(iterator &it)
Definition: table.hpp:94
MicroModelica::IR::CompiledPackage::prefix
string prefix()
Definition: helpers.cpp:150
helpers.hpp
Option
Definition: util_types.hpp:32
MicroModelica::Generator::Macros::indexMacro
std::string indexMacro(std::string token, Option< IR::Range > range, int id) const
Definition: macros.cpp:208
MicroModelica::IR::FunctionPrinter::jacMacrosAccess
std::string jacMacrosAccess(Equation eq, std::string index="row", std::string tab=TAB) const
Definition: helpers.cpp:455
MicroModelica::IR::FunctionPrinter::loop
std::string loop(int end)
Definition: helpers.cpp:196
MicroModelica::IR::FunctionPrinter::endDimGuards
std::string endDimGuards(Option< Range > range) const
Definition: helpers.cpp:256
model_config.hpp
MicroModelica::Util::ModelConfig::setCompiledFunctionVar
void setCompiledFunctionVar(bool compiled_function_var)
Definition: model_config.hpp:147
MicroModelica::IR::Input::_id
int _id
Definition: helpers.hpp:192
MicroModelica::IR::FUNCTION_PRINTER::Return
@ Return
Definition: helpers.hpp:144
MicroModelica::IR::CompiledPackage::includeDirectories
Util::SymbolTable includeDirectories()
Definition: helpers.cpp:181
MicroModelica::Util::SymbolTable
ModelTable< std::string, std::string > SymbolTable
Definition: equation.hpp:62
MicroModelica::IR::Expression
Definition: expression.hpp:64
MicroModelica::IR::CompiledFunction::_output_arguments
AST_ExpressionList _output_arguments
Definition: helpers.hpp:114
MicroModelica::IR::Expression::generate
static Expression generate(std::string var_name, std::vector< std::string > indices)
Definition: expression.cpp:162
MicroModelica::IR::ExternalFunction::ExternalFunction
ExternalFunction()
Definition: helpers.hpp:91
ModelTable::end
iterator end()
Definition: table.hpp:70
MicroModelica::IR::FunctionPrinter::printAlgebraicGuards
std::string printAlgebraicGuards(Equation alg, Index usage)
Definition: helpers.cpp:357
MicroModelica::IR::CompiledFunction::print
std::string print() const
Definition: helpers.cpp:100
MicroModelica::IR::Equation
Definition: equation.hpp:67
MicroModelica::IR::Input::Input
Input()
Definition: helpers.hpp:181
MicroModelica::IR::CompiledPackage::definitions
CompiledFunctionTable definitions()
Definition: helpers.cpp:152
equation.hpp
MicroModelica::IR::Equation::range
Option< Range > range() const
Definition: equation.hpp:86
MicroModelica::IR::CompiledPackage::objects
Util::ImportTable objects()
Definition: helpers.cpp:154
MicroModelica::IR::FUNCTION_PRINTER::Break
@ Break
Definition: helpers.hpp:144
MicroModelica::IR::CompiledFunction::CompiledFunction
CompiledFunction()
Definition: helpers.cpp:87
MicroModelica::IR::FunctionPrinter::parseIndexes
std::map< std::string, std::string > parseIndexes(string var, Option< Range > range, int offset, bool modelica_index=true) const
Definition: helpers.cpp:330
MicroModelica::IR::CompiledFunctionTable
ModelTable< std::string, CompiledFunction > CompiledFunctionTable
Definition: helpers.hpp:117
TAB
#define TAB
Definition: util.hpp:79
ModelTable< std::string, CompiledFunction >::iterator
std::map< std::string, CompiledFunction >::iterator iterator
Definition: table.hpp:61
MicroModelica::Util::ModelConfig::instance
static ModelConfig & instance()
Definition: model_config.hpp:87
MicroModelica::IR::Input
Definition: helpers.hpp:179
MicroModelica::IR::FunctionPrinter::div
std::string div(std::string var, int dim, Option< Range > range) const
Definition: helpers.cpp:394
MicroModelica::Generator::Macros
Definition: macros.hpp:71
MicroModelica::IR::Expression::dimVariables
std::string dimVariables(bool range_idxs=false) const
Definition: expression.cpp:114
MicroModelica::IR::CompiledPackage::name
string name()
Definition: helpers.cpp:148
MicroModelica::IR::FunctionPrinter::beginSwitch
std::string beginSwitch()
Definition: helpers.cpp:210
MicroModelica::IR::Index
Definition: index.hpp:92
MicroModelica::Generator::MODEL_INSTANCE::Component::Deps
@ Deps
MicroModelica::IR::FunctionPrinter::outputVariableName
std::string outputVariableName(Expression exp, Option< Range > range)
Definition: helpers.cpp:401
MicroModelica::IR::RangeDefinitionTable
ModelTable< std::string, RangeDefinition > RangeDefinitionTable
Definition: index.hpp:162
block
int block
Definition: ast_builder.cpp:41
MicroModelica::IR::Input::print
std::string print() const
Definition: helpers.cpp:471
MicroModelica
Definition: files.cpp:45
MicroModelica::IR::Input::token
std::string token() const
Definition: helpers.cpp:487
MicroModelica::IR::FunctionPrinter::parseConstants
std::map< int, std::string > parseConstants(Expression ref) const
Definition: helpers.cpp:315
built_in_functions.hpp
MicroModelica::Generator::Macros::usage
std::string usage(std::string token, Option< IR::Range > range, int id) const
Definition: macros.cpp:198
ModelTable::insert
void insert(Key k, Value v)
Definition: table.hpp:48
MicroModelica::IR::Input::_idx
Index _idx
Definition: helpers.hpp:190
MicroModelica::IR::FunctionPrinter::beginDimGuards
std::string beginDimGuards(std::string token, string args, Option< Range > range, std::multimap< std::string, int > used_variables) const
Definition: helpers.cpp:266
MicroModelica::IR::FunctionPrinter::beginExpression
std::string beginExpression(std::string token, Option< Range > range) const
Definition: helpers.cpp:219
MicroModelica::IR::CompiledPackage::CompiledPackage
CompiledPackage()
Definition: helpers.cpp:142
MicroModelica::IR::Expression::isReference
bool isReference() const
Definition: expression.cpp:86
MicroModelica::IR::CompiledPackage::_name
std::string _name
Definition: helpers.hpp:133
ModelTable::size
const int size() const
Definition: table.hpp:109
MicroModelica::IR::CompiledPackage::_objects
Util::ImportTable _objects
Definition: helpers.hpp:138
MicroModelica::IR::FunctionPrinter::equationVariableMacros
std::string equationVariableMacros(Option< Range > range, Expression lhs, std::string id) const
Definition: helpers.cpp:421
MicroModelica::IR::CompiledFunction::_prefix
std::string _prefix
Definition: helpers.hpp:108
MicroModelica::IR::FUNCTION_PRINTER::Continue
@ Continue
Definition: helpers.hpp:144
MicroModelica::IR::FunctionPrinter::mod
std::string mod(std::string var, int dim, Option< Range > range) const
Definition: helpers.cpp:384
MicroModelica::IR::FunctionPrinter::endLoop
std::string endLoop()
Definition: helpers.cpp:203
MicroModelica::IR::CompiledPackage::_cft
CompiledFunctionTable _cft
Definition: helpers.hpp:137
MicroModelica::IR::RangeDefinition
Definition: index.hpp:136
current_element
#define current_element(it)
Definition: ast_types.hpp:34
util.hpp
ModelTable::merge
void merge(ModelTable< Key, Value > other)
Definition: table.hpp:95
MicroModelica::IR::CompiledPackage::linkLibraries
Util::SymbolTable linkLibraries()
Definition: helpers.cpp:156
MicroModelica::IR::FunctionPrinter::accessMacros
std::string accessMacros(std::string token, int offset, Option< Range > range, bool modelica_index=true) const
TODO: Review modelica_index parameter usage.
Definition: helpers.cpp:371
error.hpp
ModelTable::next
Value next(iterator &it)
Definition: table.hpp:78
MicroModelica::IR::FUNCTION_PRINTER::ReturnStatementType
ReturnStatementType
Definition: helpers.hpp:144