Skip to content

Commit

Permalink
- removed Compiler/FrontEnd/SCodeTransform.mo replaced by Compiler/Fr…
Browse files Browse the repository at this point in the history
…ontEnd/SCodeInstShortcut.mo

- added +d=scodeInstShortcut,showSCode flags to call the new SCodeInstShortcut package.
- we might even get rid of passing class names around in SCodeInst as is not needed anymore.
- first version of new Compiler/FrontEnd/SCodeInstShortcut.mo package works rather fine for some 
  models and has issues with others. More context of qualified types is needed to fully make it work.
- fix scodeinst tests.
- allow input RealInput and output RealOutput in InstUtil.mergeDirection as this is used in 
  MSL 3.2.1: Modelica.Blocks.Math.Add3 (maybe we should fix MSL?)
- more flags in testsuite/openmodelica/bootstrapping/LinkMain.makefile.mingw to get rid of warnings.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13707 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Oct 30, 2012
1 parent eb69785 commit a580724
Show file tree
Hide file tree
Showing 9 changed files with 999 additions and 784 deletions.
4 changes: 4 additions & 0 deletions Compiler/FrontEnd/InstUtil.mo
Expand Up @@ -1101,6 +1101,10 @@ algorithm
// If either prefix is unset, return the other.
case (_, (Absyn.BIDIR(), _), _, _) then inOuterDirection;
case ((Absyn.BIDIR(), _), _, _, _) then inInnerDirection;

// we need this for now, see i.e. Modelica.Blocks.Math.Add3
case ((Absyn.INPUT(), _), (Absyn.INPUT(), _), _, _) then inInnerDirection;
case ((Absyn.OUTPUT(), _), (Absyn.OUTPUT(), _), _, _) then inInnerDirection;

// Otherwise we have an error, since it's not allowed to overwrite
// input/output prefixes.
Expand Down
14 changes: 14 additions & 0 deletions Compiler/FrontEnd/SCode.mo
Expand Up @@ -3283,6 +3283,20 @@ algorithm
outPrefixes := PREFIXES(v, inRedeclare, f, io, rp);
end prefixesSetRedeclare;

public function prefixesSetReplaceable
input Prefixes inPrefixes;
input Replaceable inReplaceable;
output Prefixes outPrefixes;
protected
Visibility v;
Final f;
Absyn.InnerOuter io;
Redeclare rd;
algorithm
PREFIXES(v, rd, f, io, _) := inPrefixes;
outPrefixes := PREFIXES(v, rd, f, io, inReplaceable);
end prefixesSetReplaceable;

public function redeclareBool
input Redeclare inRedeclare;
output Boolean bRedeclare;
Expand Down
7 changes: 0 additions & 7 deletions Compiler/FrontEnd/SCodeInst.mo
Expand Up @@ -77,7 +77,6 @@ protected import Types;
protected import Typing;
protected import TypeCheck;
protected import Util;
protected import SCodeTransform;

public type Binding = InstTypes.Binding;
public type Class = InstTypes.Class;
Expand Down Expand Up @@ -144,9 +143,6 @@ algorithm
InstTypes.NO_PREFIXES(), env, InstTypes.EMPTY_PREFIX(SOME(path)), INST_ALL(), functions);
// Instantiate global constants (package constants).
(const_el, functions) = instGlobalConstants(inGlobalConstants, inClassPath, inEnv, functions);

//sc = SCodeTransform.instClassToSCodeElement(cls, inClassPath, functions);
//print(SCodeDump.unparseElementStr(sc));

//print(InstDump.modelStr(name, cls)); print("\n");

Expand Down Expand Up @@ -196,9 +192,6 @@ algorithm

//print("\nEXPANDED FORM:\n\n");
//print(DAEDump.dumpStr(dae, func_tree) +& "\n");
//*/
//dae = DAE.DAE({});
//func_tree = DAE.AVLTREENODE(NONE(), 0, NONE(), NONE());
then
(dae, func_tree);

Expand Down

0 comments on commit a580724

Please sign in to comment.