Skip to content

Commit

Permalink
- Removed unused record NFInstTypes.PACKAGE.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18421 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Dec 5, 2013
1 parent 706fc41 commit ade2ad3
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 83 deletions.
14 changes: 0 additions & 14 deletions Compiler/FrontEnd/NFInstFlatten.mo
Expand Up @@ -310,11 +310,6 @@ algorithm
then
(accum_el, st);

case (NFInstTypes.ELEMENT(component = NFInstTypes.PACKAGE(name = _)),
st, _, _, accum_el)
then
(inElement :: accum_el, st);

case (el, st, _, _, accum_el)
equation
comp = NFInstUtil.getElementComponent(el);
Expand Down Expand Up @@ -387,15 +382,6 @@ algorithm
SymbolTable st;
Boolean add_el;

case ((el as NFInstTypes.ELEMENT(component = NFInstTypes.PACKAGE(name = _))) :: rest_el,
_, _, _, st, accum_el)
equation
accum_el = el :: accum_el;
(accum_el, st) = flattenExtendedElements(rest_el, inNames,
inExtendPath, inClassPath, st, accum_el);
then
(accum_el, st);

// Extended elements should not contain nested extended elements, since they
// should have been flattened in instElementList. So we can assume that we
// only have normal elements here.
Expand Down
6 changes: 0 additions & 6 deletions Compiler/FrontEnd/NFInstSymbolTable.mo
Expand Up @@ -343,12 +343,6 @@ algorithm
Absyn.Path name;
SymbolTable st;

// PACKAGE isn't really a component, so we don't add it. But its class
// should be added, so return true anyway.
case (NFInstTypes.PACKAGE(name = _), st)
then st;

// For any other type of component, try to add it.
case (_, st)
equation
name = NFInstUtil.getComponentName(inComponent);
Expand Down
5 changes: 0 additions & 5 deletions Compiler/FrontEnd/NFInstTypes.mo
Expand Up @@ -181,11 +181,6 @@ public uniontype Component
Option<Absyn.Path> innerName;
end OUTER_COMPONENT;

record PACKAGE
Absyn.Path name;
Option<Component> parent; //NO_COMPONENT?
end PACKAGE;

record COMPONENT_ALIAS
Absyn.Path componentName;
end COMPONENT_ALIAS;
Expand Down
28 changes: 5 additions & 23 deletions Compiler/FrontEnd/NFInstUtil.mo
Expand Up @@ -119,9 +119,6 @@ algorithm
list<DAE.Var> vars;
DAE.Var var;

case (NFInstTypes.ELEMENT(component = NFInstTypes.PACKAGE(name = _)), vars)
then vars;

case (NFInstTypes.ELEMENT(component = comp, cls = cls), vars)
equation
var = componentToDaeVar(comp);
Expand Down Expand Up @@ -190,11 +187,6 @@ algorithm
then
fail();

case NFInstTypes.PACKAGE(name = _)
equation
print("PACKAGE\n");
then
fail();
end match;
end componentToDaeVar;

Expand Down Expand Up @@ -390,7 +382,6 @@ algorithm
case NFInstTypes.CONDITIONAL_COMPONENT(name = name) then name;
case NFInstTypes.DELETED_COMPONENT(name = name) then name;
case NFInstTypes.OUTER_COMPONENT(name = name) then name;
case NFInstTypes.PACKAGE(name = name) then name;

end match;
end getComponentName;
Expand Down Expand Up @@ -432,9 +423,6 @@ algorithm
case (NFInstTypes.OUTER_COMPONENT(_, inner_name), _)
then NFInstTypes.OUTER_COMPONENT(inName, inner_name);

case (NFInstTypes.PACKAGE(_,p), _)
then NFInstTypes.PACKAGE(inName,p);

end match;
end setComponentName;

Expand Down Expand Up @@ -1731,7 +1719,6 @@ algorithm
Option<Component> parent;

case NFInstTypes.TYPED_COMPONENT(parent = parent) then parent;
case NFInstTypes.PACKAGE(parent = parent) then parent;
else NONE();

end match;
Expand All @@ -1742,25 +1729,20 @@ public function setComponentParent
input Option<Component> inParent;
output Component outComponent;
algorithm
outComponent := matchcontinue(inComponent, inParent)
outComponent := match(inComponent, inParent)
local
Absyn.Path name;
DAE.Type ty;
DaePrefixes pref;
Binding binding;
Absyn.Info info;

case (_, NONE()) then inComponent;
case (NFInstTypes.TYPED_COMPONENT(name, ty, _, pref, binding, info), SOME(_))
then NFInstTypes.TYPED_COMPONENT(name, ty, inParent, pref, binding, info);

case (NFInstTypes.TYPED_COMPONENT(name, ty, _, pref, binding, info), _)
then NFInstTypes.TYPED_COMPONENT(name, ty, inParent, pref, binding, info);

case (NFInstTypes.PACKAGE(name, _), _)
then NFInstTypes.PACKAGE(name, inParent);

case (_, _) then inComponent;
else inComponent;

end matchcontinue;
end match;
end setComponentParent;

public function makeTypedComponentCref
Expand Down
12 changes: 1 addition & 11 deletions Compiler/FrontEnd/NFTypeCheck.mo
Expand Up @@ -217,12 +217,6 @@ algorithm
case (NFInstTypes.DELETED_COMPONENT(name = name), _, _, st)
then (inComponent, st);

case (NFInstTypes.PACKAGE(name = name), _, _, st)
equation
comp = NFInstUtil.setComponentParent(inComponent, inParent);
then
(comp, st);

end match;
end checkComponent;

Expand Down Expand Up @@ -307,11 +301,7 @@ algorithm
DAE.Dimensions dims;

case (NONE(), _) then inDimensionsAcc;
case (SOME(c as NFInstTypes.PACKAGE(parent = _)), _)
equation
dims = getParentDimensions(NFInstUtil.getComponentParent(c), inDimensionsAcc);
then
dims;

case (SOME(c), _)
equation
dims = NFInstUtil.getComponentTypeDimensions(c);
Expand Down
8 changes: 0 additions & 8 deletions Compiler/FrontEnd/NFTyping.mo
Expand Up @@ -215,14 +215,6 @@ algorithm

case (NFInstTypes.TYPED_COMPONENT(name = _), _, _, st, _) then (inComponent, st);

case (NFInstTypes.PACKAGE(parent = NONE()), SOME(_), _, st, _)
equation
comp = NFInstUtil.setComponentParent(inComponent, inParent);
then
(comp, st);

case (NFInstTypes.PACKAGE(name = _), _, _, st, _) then (inComponent, st);

case (NFInstTypes.OUTER_COMPONENT(innerName = SOME(name)), _, _, st, _)
equation
comp = NFInstSymbolTable.lookupName(name, st);
Expand Down
4 changes: 0 additions & 4 deletions Compiler/Template/NFInstDumpTV.mo
Expand Up @@ -218,10 +218,6 @@ package NFInstTypes
Absyn.Path name;
Option<Absyn.Path> innerName;
end OUTER_COMPONENT;

record PACKAGE
Absyn.Path name;
end PACKAGE;
end Component;

uniontype Condition
Expand Down
9 changes: 0 additions & 9 deletions Compiler/Template/NFInstDumpTpl.mo
Expand Up @@ -126,15 +126,6 @@ algorithm
txt = Tpl.writeTok(txt, Tpl.ST_STRING(";"));
then txt;

case ( txt,
NFInstTypes.PACKAGE(name = i_name) )
equation
l_name__str = AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_name);
txt = Tpl.writeTok(txt, Tpl.ST_STRING("package "));
txt = Tpl.writeText(txt, l_name__str);
txt = Tpl.writeTok(txt, Tpl.ST_STRING(";"));
then txt;

case ( txt,
_ )
then txt;
Expand Down
3 changes: 0 additions & 3 deletions Compiler/Template/NFInstDumpTpl.tpl
Expand Up @@ -40,9 +40,6 @@ match component
case OUTER_COMPONENT(__) then
let outer_str = AbsynDumpTpl.dumpPath(name)
'outer <%outer_str%>;'
case PACKAGE(__) then
let name_str = AbsynDumpTpl.dumpPath(name)
'package <%name_str%>;'
end dumpComponent;

template dumpElement(Element element)
Expand Down

0 comments on commit ade2ad3

Please sign in to comment.