MicroModelicaCCompiler
4.5.3
|
#include <helpers.hpp>
Public Member Functions | |
~FunctionPrinter ()=default | |
std::string | loop (int end) |
std::string | endLoop () |
std::string | beginSwitch () |
std::string | endSwitch () |
std::string | beginExpression (std::string token, Option< Range > range) const |
std::string | endExpression (Option< Range > range, FUNCTION_PRINTER::ReturnStatementType ret=FUNCTION_PRINTER::ReturnStatementType::Return) const |
std::string | jacobianTerms (list< Equation > eqs) |
std::string | getIndexes (string var, Option< Range > range, int offset, bool modelica_index) const |
std::map< std::string, std::string > | parseIndexes (string var, Option< Range > range, int offset, bool modelica_index=true) const |
std::map< int, std::string > | parseConstants (Expression ref) const |
std::string | beginDimGuards (std::string token, string args, Option< Range > range, std::multimap< std::string, int > used_variables) const |
std::string | endDimGuards (Option< Range > range) const |
std::string | printAlgebraicGuards (Equation alg, Index usage) |
std::string | accessMacros (std::string token, int offset, Option< Range > range, bool modelica_index=true) const |
TODO: Review modelica_index parameter usage. More... | |
std::string | equationVariableMacros (Option< Range > range, Expression lhs, std::string id) const |
std::string | jacMacrosAccess (Equation eq, std::string index="row", std::string tab=TAB) const |
std::string | outputVariableName (Expression exp, Option< Range > range) |
std::string | algebraic (Equation alg, bool reduction) |
Protected Attributes | |
map< std::string, std::string > | _alg_dict |
Private Member Functions | |
std::string | mod (std::string var, int dim, Option< Range > range) const |
std::string | div (std::string var, int dim, Option< Range > range) const |
Definition at line 147 of file helpers.hpp.
|
default |
string MicroModelica::IR::FunctionPrinter::accessMacros | ( | std::string | token, |
int | offset, | ||
Option< Range > | range, | ||
bool | modelica_index = true |
||
) | const |
TODO: Review modelica_index parameter usage.
Definition at line 371 of file helpers.cpp.
Referenced by MicroModelica::Generator::Macros::initialize().
string MicroModelica::IR::FunctionPrinter::algebraic | ( | Equation | alg, |
bool | reduction | ||
) |
Definition at line 288 of file helpers.cpp.
References parseIndexes(), and TAB.
string MicroModelica::IR::FunctionPrinter::beginDimGuards | ( | std::string | token, |
string | args, | ||
Option< Range > | range, | ||
std::multimap< std::string, int > | used_variables | ||
) | const |
Definition at line 266 of file helpers.cpp.
string MicroModelica::IR::FunctionPrinter::beginExpression | ( | std::string | token, |
Option< Range > | range | ||
) | const |
Definition at line 219 of file helpers.cpp.
string MicroModelica::IR::FunctionPrinter::beginSwitch | ( | ) |
Definition at line 210 of file helpers.cpp.
|
private |
Definition at line 394 of file helpers.cpp.
References MicroModelica::IR::Expression::usage().
Definition at line 256 of file helpers.cpp.
string MicroModelica::IR::FunctionPrinter::endExpression | ( | Option< Range > | range, |
FUNCTION_PRINTER::ReturnStatementType | ret = FUNCTION_PRINTER::ReturnStatementType::Return |
||
) | const |
Definition at line 232 of file helpers.cpp.
References TAB.
string MicroModelica::IR::FunctionPrinter::endLoop | ( | ) |
Definition at line 203 of file helpers.cpp.
References TAB.
string MicroModelica::IR::FunctionPrinter::endSwitch | ( | ) |
Definition at line 217 of file helpers.cpp.
string MicroModelica::IR::FunctionPrinter::equationVariableMacros | ( | Option< Range > | range, |
Expression | lhs, | ||
std::string | id | ||
) | const |
Definition at line 421 of file helpers.cpp.
string MicroModelica::IR::FunctionPrinter::getIndexes | ( | string | var, |
Option< Range > | range, | ||
int | offset, | ||
bool | modelica_index | ||
) | const |
Definition at line 303 of file helpers.cpp.
Referenced by printAlgebraicGuards().
string MicroModelica::IR::FunctionPrinter::jacMacrosAccess | ( | Equation | eq, |
std::string | index = "row" , |
||
std::string | tab = TAB |
||
) | const |
Definition at line 455 of file helpers.cpp.
References MicroModelica::IR::Input::_id, MicroModelica::IR::Input::_idx, MicroModelica::IR::Input::_range, block, TAB, MicroModelica::IR::Input::token(), and MicroModelica::Generator::Macros::usage().
Referenced by MicroModelica::IR::JacGenerator::guard(), and MicroModelica::IR::JacGenerator::postProcess().
std::string MicroModelica::IR::FunctionPrinter::jacobianTerms | ( | list< Equation > | eqs | ) |
string MicroModelica::IR::FunctionPrinter::loop | ( | int | end | ) |
Definition at line 196 of file helpers.cpp.
|
private |
Definition at line 384 of file helpers.cpp.
References MicroModelica::IR::Expression::isReference(), and MicroModelica::IR::Expression::reference().
string MicroModelica::IR::FunctionPrinter::outputVariableName | ( | Expression | exp, |
Option< Range > | range | ||
) |
Definition at line 401 of file helpers.cpp.
map< int, string > MicroModelica::IR::FunctionPrinter::parseConstants | ( | Expression | ref | ) | const |
Definition at line 315 of file helpers.cpp.
References ModelTable< Key, Value >::begin(), ModelTable< Key, Value >::end(), ModelTable< Key, Value >::next(), and ModelTable< Key, Value >::size().
map< string, string > MicroModelica::IR::FunctionPrinter::parseIndexes | ( | string | var, |
Option< Range > | range, | ||
int | offset, | ||
bool | modelica_index = true |
||
) | const |
Definition at line 330 of file helpers.cpp.
Referenced by algebraic().
Definition at line 357 of file helpers.cpp.
References getIndexes(), and TAB.
|
protected |
Definition at line 172 of file helpers.hpp.