Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add half-implemented API call generateScriptingAPI
- Handle variables with dimension false and true in SimCode git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23500 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Showing
9 changed files
with
143 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package GenerateAPIFunctionsTpl | ||
|
||
import interface SimCodeTV; | ||
|
||
template getCevalScriptInterface(list<DAE.Type> tys) | ||
::= | ||
let funcs = tys |> ty as T_FUNCTION(source=path::_) => '<%getCevalScriptInterfaceFunc(pathLastIdent(path), ty.funcArg, ty.funcResultType)%><%\n%>' | ||
<< | ||
import Absyn; | ||
import CevalScript; | ||
import GlobalScript; | ||
import Parser; | ||
|
||
protected | ||
|
||
constant Absyn.Msg dummyMsg = Absyn.MSG(SOURCEINFO("<interactive>",false,1,1,1,1,0.0)); | ||
|
||
public | ||
|
||
<%funcs%> | ||
>> | ||
end getCevalScriptInterface; | ||
|
||
template getCevalScriptInterfaceFunc(String name, list<DAE.FuncArg> args, DAE.Type res) | ||
::= | ||
<< | ||
function <%name%> | ||
input GlobalScript.SymbolTable st; | ||
input ...; | ||
output GlobalScript.SymbolTable outSymTab; | ||
output ...; | ||
algorithm | ||
(_,...,outSymTab) := CevalScript.cevalInteractiveFunctions2(FCore.emptyCache(), FGraph.empty(), "<%name%>", {...}, st, dummyMsg); | ||
end <%name%>; | ||
>> | ||
end getCevalScriptInterfaceFunc; | ||
|
||
annotation(__OpenModelica_Interface="backend"); | ||
end GenerateAPIFunctionsTpl; | ||
|
||
// vim: filetype=susan sw=2 sts=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters