Skip to content

Commit

Permalink
- replace list<Env.Frame> with Env.Env
Browse files Browse the repository at this point in the history
- FFrontEnd:
  * add names for edges
  * resolve component types after constrainedby and class extends

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20217 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Apr 22, 2014
1 parent 6bcf8a5 commit 3bb32eb
Show file tree
Hide file tree
Showing 24 changed files with 396 additions and 394 deletions.
6 changes: 3 additions & 3 deletions Compiler/BackEnd/SimCodeMain.mo
Expand Up @@ -213,7 +213,7 @@ algorithm
local
String FMUVersion,filenameprefix,file_dir,resstr;
DAE.DAElist dae;
list<Env.Frame> env;
Env.Env env;
BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow_1;
list<String> libs;
GlobalScript.SymbolTable st;
Expand Down Expand Up @@ -288,7 +288,7 @@ algorithm
local
String filenameprefix,file_dir,resstr,description;
DAE.DAElist dae;
list<Env.Frame> env;
Env.Env env;
BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow_1;
list<String> libs;
GlobalScript.SymbolTable st;
Expand Down Expand Up @@ -570,7 +570,7 @@ algorithm
local
String filenameprefix, file_dir, resstr, description;
DAE.DAElist dae;
list<Env.Frame> env;
Env.Env env;
BackendDAE.BackendDAE dlow, dlow_1, indexed_dlow_1;
list<String> libs;
GlobalScript.SymbolTable st;
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/Uncertainties.mo
Expand Up @@ -102,7 +102,7 @@ algorithm

DAE.DAElist dae;
Env.Cache cache;
list<Env.Frame> env;
Env.Env env;
Absyn.Program p;

BackendDAE.BackendDAE dlow,dlow_1;
Expand Down Expand Up @@ -638,14 +638,14 @@ protected function flattenModel
input Env.Cache icache;
output DAE.DAElist daeOut;
output Env.Cache cacheOut;
output list<Env.Frame> envOut;
output Env.Env envOut;
algorithm
(daeOut,cacheOut,envOut):=matchcontinue(className,p,icache)
local
list<SCode.Element> p_1;
Absyn.Program ptot;
DAE.DAElist dae;
list<Env.Frame> env;
Env.Env env;
Real timeFrontend;
String resstr;
Env.Cache cache;
Expand Down
14 changes: 7 additions & 7 deletions Compiler/FFrontEnd/FExpand.mo
Expand Up @@ -126,13 +126,6 @@ algorithm
lst = List.consr(lst, System.getTimerIntervalTime());
print("Derived: " +& realString(List.first(lst)) +& "\n");

System.startTimer();
// resolve type paths
g = FResolve.ty(FGraph.top(g), g);
System.stopTimer();
lst = List.consr(lst, System.getTimerIntervalTime());
print("ComponentTypes: " +& realString(List.first(lst)) +& "\n");

System.startTimer();
// resolve type paths for constrain classes
g = FResolve.cc(FGraph.top(g), g);
Expand All @@ -147,6 +140,13 @@ algorithm
lst = List.consr(lst, System.getTimerIntervalTime());
print("ClassExtends: " +& realString(List.first(lst)) +& "\n");

System.startTimer();
// resolve type paths
g = FResolve.ty(FGraph.top(g), g);
System.stopTimer();
lst = List.consr(lst, System.getTimerIntervalTime());
print("ComponentTypes: " +& realString(List.first(lst)) +& "\n");

System.startTimer();
// resolve all component references
g = FResolve.cr(FGraph.top(g), g);
Expand Down
5 changes: 2 additions & 3 deletions Compiler/FFrontEnd/FGraphBuild.mo
Expand Up @@ -1283,12 +1283,11 @@ algorithm
// ignore basic types and builtins
true = not FNode.isRefBasicType(inTargetRef) and
not FNode.isRefBuiltin(inTargetRef);


/*
// if target is a reference found on the way
// to the top from parent ref do not clone!
true = listMember(inTargetRef, FNode.originalScope(inParentRef));

/*
// if the first non implicit scope of target
// and parent are the same do not clone
true = referenceEq(
Expand Down
7 changes: 5 additions & 2 deletions Compiler/FFrontEnd/FGraphStream.mo
Expand Up @@ -139,12 +139,13 @@ algorithm
end node;
public function edge
input Name name;
input Node source;
input Node target;
algorithm
_ := matchcontinue(source, target)
_ := matchcontinue(name, source, target)
case (_, _)
case (_, _, _)
equation
true = Flags.isSet(Flags.GRAPH_INST_SHOW_GRAPH);
Expand All @@ -165,7 +166,9 @@ algorithm
false = FNode.isIn(target, FNode.isRefSection);
false = FNode.isIn(target, FNode.isRefMod);
false = FNode.isIn(target, FNode.isRefDims);
GraphStream.addEdge("default", "omc", -1, intString(FNode.id(source)), intString(FNode.id(target)), false);
GraphStream.addEdgeAttribute("default", "omc", -1, intString(FNode.id(source)), intString(FNode.id(target)), "ui.label", Values.STRING(name));
then
();
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FFrontEnd/FNode.mo
Expand Up @@ -288,7 +288,7 @@ algorithm
FCore.N(n, i, p, c, d) := fromRef(inParentRef);
c := avlTreeAdd(c, inName, inChildRef);
parent := updateRef(inParentRef, FCore.N(n, i, p, c, d));
FGraphStream.edge(fromRef(parent), fromRef(inChildRef));
FGraphStream.edge(inName, fromRef(parent), fromRef(inChildRef));
end addChildRef;

public function addImportToRef
Expand Down
8 changes: 4 additions & 4 deletions Compiler/FrontEnd/Builtin.mo
Expand Up @@ -565,7 +565,7 @@ public function initialEnv
others."
input Env.Cache inCache;
output Env.Cache outCache;
output list<Env.Frame> env;
output Env.Env env;
protected
Env.Cache cache;
algorithm
Expand Down Expand Up @@ -678,12 +678,12 @@ algorithm
end initialEnv;

protected function initialEnvMetaModelica
input list<Env.Frame> inEnv;
output list<Env.Frame> outEnv;
input Env.Env inEnv;
output Env.Env outEnv;
algorithm
outEnv := matchcontinue(inEnv)
local
list<Env.Frame> env;
Env.Env env;
case (env)
equation
true = Config.acceptMetaModelicaGrammar();
Expand Down

0 comments on commit 3bb32eb

Please sign in to comment.