Skip to content

Commit

Permalink
- added isInner and isOuter functions
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4811 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jan 20, 2010
1 parent e3e23f7 commit 2811891
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions Compiler/Absyn.mo
Expand Up @@ -394,14 +394,10 @@ end ElementSpec;
public
uniontype InnerOuter "One of the keyword inner and outer CAN be given to reference an inner or
outer component. Thus there are three disjoint possibilities."
record INNER end INNER;

record OUTER end OUTER;

record INNEROUTER end INNEROUTER;

record UNSPECIFIED end UNSPECIFIED;

record INNER "an inner component" end INNER;
record OUTER "an outer component" end OUTER;
record INNEROUTER "an inner/outer component" end INNEROUTER;
record UNSPECIFIED "a component without inner/outer" end UNSPECIFIED;
end InnerOuter;

public
Expand Down Expand Up @@ -4109,5 +4105,33 @@ algorithm
case (INFO(fileName = fileName)) then fileName;
end matchcontinue;
end getFileNameFromInfo;


public function isOuter
"@author: adrpo
this function returns true if the given Absyn.InnerOuter
is one of Absyn.INNEROUTER() or Absyn.OUTER()"
input InnerOuter io;
output Boolean isItAnOuter;
algorithm
isItAnOuter := matchcontinue(io)
case (INNEROUTER()) then true;
case (OUTER()) then true;
case (_) then false;
end matchcontinue;
end isOuter;

public function isInner
"@author: adrpo
this function returns true if the given Absyn.InnerOuter
is one of Absyn.INNEROUTER() or Absyn.INNER()"
input InnerOuter io;
output Boolean isItAnInner;
algorithm
isItAnInner := matchcontinue(io)
case (INNEROUTER()) then true;
case (INNER()) then true;
case (_) then false;
end matchcontinue;
end isInner;

end Absyn;

0 comments on commit 2811891

Please sign in to comment.