Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Removed set/getClassNamesForSimulation from Interactive.mo
- Moved strictRMLCheck() API call to CevalScript from Interactive


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7767 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 25, 2011
1 parent 3ff6217 commit b1a9432
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 44 deletions.
18 changes: 18 additions & 0 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -618,5 +618,23 @@ function getClassesInModelicaPath
external "builtin";
end getClassesInModelicaPath;

function strictRMLCheck
output String message "empty if there was no problem";
external "builtin";
end strictRMLCheck;

/* These don't influence anything...
function getClassNamesForSimulation
output String classNamesForSimulation;
external "builtin";
end getClassNamesForSimulation;
function setClassNamesForSimulation
input String classNamesForSimulation;
output Boolean success;
external "builtin";
end setClassNamesForSimulation;
*/

end Scripting;
end OpenModelica;
35 changes: 22 additions & 13 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -82,6 +82,7 @@ protected import ExpressionDump;
protected import Inst;
protected import InnerOuter;
protected import Lookup;
protected import MetaUtil;
protected import ModUtil;
protected import OptManager;
protected import Prefix;
Expand Down Expand Up @@ -898,6 +899,19 @@ algorithm
then
(cache,Values.BOOL(true),st);

case (cache,env,
DAE.CALL(path = Absyn.IDENT(name = "getTempDirectoryPath"),expLst = {}),
(st as Interactive.SYMBOLTABLE(
ast = p,
explodedAst = sp,
instClsLst = ic,
lstVarVal = iv,
compiledFunctions = cf)),msg)
equation
res = Settings.getTempDirectoryPath();
then
(cache,Values.STRING(res),st);

case (cache,env,
DAE.CALL(
path = Absyn.IDENT(name = "setInstallationDirectoryPath"),
Expand All @@ -914,19 +928,6 @@ algorithm
then
(cache,Values.BOOL(true),st);

case (cache,env,
DAE.CALL(path = Absyn.IDENT(name = "getTempDirectoryPath"),expLst = {}),
(st as Interactive.SYMBOLTABLE(
ast = p,
explodedAst = sp,
instClsLst = ic,
lstVarVal = iv,
compiledFunctions = cf)),msg)
equation
res = Settings.getTempDirectoryPath();
then
(cache,Values.STRING(res),st);

case (cache,env,
DAE.CALL(path = Absyn.IDENT(name = "getInstallationDirectoryPath"),expLst = {}),
(st as Interactive.SYMBOLTABLE(
Expand Down Expand Up @@ -2419,6 +2420,14 @@ algorithm
setEcho(bval);
then
(cache,v,st);
case (cache,env,DAE.CALL(path = Absyn.IDENT("strictRMLCheck"),expLst = {}),st as Interactive.SYMBOLTABLE(ast = p),msg)
equation
_ = Util.listMap1r(Util.listMap(Interactive.getFunctionsInProgram(p), SCodeUtil.translateClass), MetaUtil.strictRMLCheck, true);
str = Error.printMessagesStr();
v = Values.STRING(str);
then
(cache,v,st);

case (cache,env,(exp as
DAE.CALL(
path = Absyn.IDENT(name = "dumpXMLDAE"),
Expand Down
32 changes: 1 addition & 31 deletions Compiler/Script/Interactive.mo
Expand Up @@ -1952,20 +1952,6 @@ algorithm
then
("error",st);

case (istmts, st as SYMBOLTABLE(ast = p))
equation
// Check all functions for some stuff RML doesn't
// In an API call so we easily can test it
matchApiFunction(istmts, "strictRMLCheck");
{} = getApiFunctionArgs(istmts);
aclasses = getFunctionsInProgram(p);
_ = Util.listMap1r(Util.listMap(aclasses, SCodeUtil.translateClass), MetaUtil.strictRMLCheck, true);
resstr = Error.printMessagesStr();
resstr = stringAppend("\"", resstr);
resstr = stringAppend(resstr, "\"");
then
(resstr,st);

case (istmts, st as SYMBOLTABLE(ast = p))
equation
matchApiFunction(istmts, "deleteClass");
Expand Down Expand Up @@ -2416,22 +2402,6 @@ algorithm
matchApiFunction(istmts, "getClassNames");
then ("{}",st);

case (istmts, st)
equation
matchApiFunction(istmts, "getClassNamesForSimulation");
{} = getApiFunctionArgs(istmts);
resstr = System.getClassnamesForSimulation();
then
(resstr,st);

case (istmts, st)
equation
matchApiFunction(istmts, "setClassNamesForSimulation");
{Absyn.STRING(value = str)} = getApiFunctionArgs(istmts);
System.setClassnamesForSimulation(str);
then
("true",st);

case (istmts, st as SYMBOLTABLE(ast = p))
equation
matchApiFunction(istmts, "getClassInformation");
Expand Down Expand Up @@ -19190,7 +19160,7 @@ algorithm
end match;
end getSymbolTableAST;

protected function getFunctionsInProgram
public function getFunctionsInProgram
input Absyn.Program prog;
output list<Absyn.Class> funcs;
list<Absyn.Class> classes;
Expand Down

0 comments on commit b1a9432

Please sign in to comment.