Skip to content

Commit

Permalink
- Implemented filtering of duplicate extended components in SCodeInst…
Browse files Browse the repository at this point in the history
…. Needs

  more work, just assumes all elements are equal right now.
- Fixed handling of conditional components that contain other conditional
  components.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11250 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Mar 1, 2012
1 parent 5a7544b commit 1dc0ec2
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 130 deletions.
49 changes: 15 additions & 34 deletions Compiler/FrontEnd/SCodeCheck.mo
Expand Up @@ -41,6 +41,7 @@ encapsulated package SCodeCheck
public import Absyn;
public import SCode;
public import SCodeEnv;
public import SCodeInst;

protected import Config;
protected import Dump;
Expand Down Expand Up @@ -117,40 +118,6 @@ algorithm
end matchcontinue;
end checkRecursiveShortDefinition;

public function checkDuplicateElements
input list<SCode.Element> inElements;
algorithm
_ := matchcontinue(inElements)
local
SCode.Element e;
list<SCode.Element> rest;

case ({}) then ();

case (e::rest)
equation
then
();
end matchcontinue;
end checkDuplicateElements;

public function checkDuplicateEnums
input list<SCode.Enum> inEnumLst;
algorithm
_ := matchcontinue(inEnumLst)
local
SCode.Enum e;
list<SCode.Enum> rest;

case ({}) then ();

case (e::rest)
equation
then
();
end matchcontinue;
end checkDuplicateEnums;

protected function isSelfReference
input String inTypeName;
input Absyn.Path inTypePath;
Expand Down Expand Up @@ -623,4 +590,18 @@ algorithm
end matchcontinue;
end checkIdentNotEqTypeName;

public function checkComponentsEqual
input SCodeInst.Component inComponent1;
input SCodeInst.Component inComponent2;
algorithm
_ := match(inComponent1, inComponent2)
case (_, _)
equation
print("Found duplicate component\n");
then
();

end match;
end checkComponentsEqual;

end SCodeCheck;
4 changes: 0 additions & 4 deletions Compiler/FrontEnd/SCodeExpand.mo
Expand Up @@ -379,10 +379,6 @@ algorithm
SCodeInst.PREFIXES(variability = DAE.CONST())), _, _)
then inAccumEl;

case (SCodeInst.TYPED_COMPONENT(prefixes =
SCodeInst.PREFIXES(variability = DAE.PARAM())), _, _)
then inAccumEl;

case (SCodeInst.TYPED_COMPONENT(name, ty, prefs, binding, _), subs, _)
equation
bind_exp = expandBinding(binding, subs);
Expand Down

0 comments on commit 1dc0ec2

Please sign in to comment.