MicroModelicaCCompiler
4.5.3
|
Go to the documentation of this file.
38 class ExternalFunction {
41 ExternalFunction(std::string lvalue, std::string name, AST_ExpressionList args);
48 AST_ExpressionList
_args;
53 class CompiledFunction {
57 std::string prefix =
"__");
65 inline std::string
name()
const {
return _name; };
68 std::string
print()
const;
109 namespace FUNCTION_PRINTER {
116 std::string
loop(
int end);
125 std::map<std::string, std::string>
parseIndexes(
string var,
Option<Range> range,
int offset,
bool modelica_index =
true)
const;
127 std::string
beginDimGuards(std::string token,
string args,
Option<Range> range, std::multimap<std::string, int> used_variables)
const;
150 std::string
print()
const;
151 std::string
macro()
const;
155 std::string
token()
const;
~ExternalFunction()=default
void setOutputArguments(AST_ExpressionList output_arguments)
Util::SymbolTable libraryDirectories()
AST_ExpressionList _arguments
ModelTable< int, Input > InputTable
std::string _includeDirectory
ModelTable< std::string, CompiledPackage > CompiledPackageTable
std::string getIndexes(string var, Option< Range > range, int offset, bool modelica_index) const
void setDefinitions(CompiledFunctionTable &cft)
std::string endExpression(Option< Range > range, FUNCTION_PRINTER::ReturnStatementType ret=FUNCTION_PRINTER::ReturnStatementType::Return) const
bool hasLibraryDirectory() const
Util::SymbolTable libraries()
std::string prototype() const
std::string algebraic(Equation alg, bool reduction)
~CompiledFunction()=default
Util::SymbolTable _libraries
bool hasIncludeDirectory() const
std::string jacMacrosAccess(Equation eq, std::string index="row", std::string tab=TAB) const
std::string loop(int end)
std::string endDimGuards(Option< Range > range) const
~FunctionPrinter()=default
std::string includeDirectory() const
void setObjects(Util::ImportTable &objects)
Util::SymbolTable includeDirectories()
ModelTable< std::string, std::string > SymbolTable
AST_ExpressionList _output_arguments
ModelTable< int, ExternalFunction > ExternalFunctionTable
std::string printAlgebraicGuards(Equation alg, Index usage)
std::string print() const
CompiledFunctionTable definitions()
Util::ImportTable objects()
std::map< std::string, std::string > parseIndexes(string var, Option< Range > range, int offset, bool modelica_index=true) const
ModelTable< std::string, CompiledFunction > CompiledFunctionTable
map< std::string, std::string > _alg_dict
std::string div(std::string var, int dim, Option< Range > range) const
std::string beginSwitch()
friend std::ostream & operator<<(std::ostream &out, const ExternalFunction &e)
bool hasLibraries() const
std::string _libraryDirectory
std::string outputVariableName(Expression exp, Option< Range > range)
std::map< int, std::string > parseConstants(Expression ref) const
friend std::ostream & operator<<(std::ostream &out, const CompiledFunction &cf)
std::string libraryDirectory() const
std::string beginDimGuards(std::string token, string args, Option< Range > range, std::multimap< std::string, int > used_variables) const
std::string beginExpression(std::string token, Option< Range > range) const
Util::ImportTable _objects
std::string equationVariableMacros(Option< Range > range, Expression lhs, std::string id) const
std::string mod(std::string var, int dim, Option< Range > range) const
void setArguments(AST_ExpressionList arguments)
CompiledFunctionTable _cft
Util::SymbolTable linkLibraries()
std::string accessMacros(std::string token, int offset, Option< Range > range, bool modelica_index=true) const
TODO: Review modelica_index parameter usage.
std::string jacobianTerms(list< Equation > eqs)