Skip to content

Commit

Permalink
- search for annotations also in the algorithm section.
Browse files Browse the repository at this point in the history
  this is needed as Modelica 3.2 requires annotations to be present at the end of the class.
- now annotations (Inline, etc) present in the algorithm section at the end of the class are detected correctly.

- remove Xpowers.mo from testsuite/mofiles/drmodelica/Makefile as is not present anymore.

- do not delete build/bin/omc*, delete specific omc, omcp, etc. in Makefile.common

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5468 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 7, 2010
1 parent ad5352e commit 4c25a04
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
54 changes: 52 additions & 2 deletions Compiler/SCodeUtil.mo
Expand Up @@ -477,6 +477,7 @@ algorithm
list<Absyn.ElementItem> eilst;
list<Absyn.ClassPart> cdr;
list<Absyn.EquationItem> eqilst;
list<Absyn.AlgorithmItem> algilst;

case({}) then {};
case(Absyn.PUBLIC(eilst) :: cdr)
Expand Down Expand Up @@ -507,6 +508,20 @@ algorithm
anns2 = listAppend(anns,anns1);
then
anns2;
case(Absyn.ALGORITHMS(algilst) :: cdr)
equation
anns = translateAnnotationsAlg(algilst);
anns1 = translateClassdefAnnotations(cdr);
anns2 = listAppend(anns,anns1);
then
anns2;
case(Absyn.INITIALALGORITHMS(algilst) :: cdr)
equation
anns = translateAnnotationsAlg(algilst);
anns1 = translateClassdefAnnotations(cdr);
anns2 = listAppend(anns,anns1);
then
anns2;
case(_ :: cdr)
equation
anns = translateClassdefAnnotations(cdr);
Expand Down Expand Up @@ -740,9 +755,9 @@ algorithm
end matchcontinue;
end translateAnnotations;

// stefan
protected function translateAnnotationsEq
"function: translateAnnotations
"@author: stefan
function: translateAnnotationsEq
turns a list of Absyn.EquationItem into a list of Annotations"
input list<Absyn.EquationItem> inEquationItemList;
output list<SCode.Annotation> outAnnotationList;
Expand Down Expand Up @@ -774,6 +789,41 @@ algorithm
end matchcontinue;
end translateAnnotationsEq;


protected function translateAnnotationsAlg
"@author: adrpo
function: translateAnnotationsAlg
turns a list of Absyn.AlgorithmItem into a list of Annotations"
input list<Absyn.AlgorithmItem> inAlgorithmItemList;
output list<SCode.Annotation> outAnnotationList;
algorithm
outAnnotationList := matchcontinue(inAlgorithmItemList)
local
list<Absyn.AlgorithmItem> cdr;
Absyn.Annotation ann;
SCode.Annotation res;
list<SCode.Annotation> anns,anns_1;
case({}) then {};
case(Absyn.ALGORITHMITEMANN(ann) :: cdr)
equation
res = translateAnnotation(ann);
anns = translateAnnotationsAlg(cdr);
anns_1 = res :: anns;
then
anns_1;
case(_ :: cdr)
equation
anns = translateAnnotationsAlg(cdr);
then
anns;
case(_)
equation
Debug.fprintln("failtrace","SCode.translateAnnotationsAlg failed");
then
fail();
end matchcontinue;
end translateAnnotationsAlg;

// stefan
protected function translateAnnotation
"function: translateAnnotation
Expand Down
3 changes: 2 additions & 1 deletion Makefile.common
Expand Up @@ -103,7 +103,8 @@ clean: qtclean
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd flat_modelica_parser/src && $(MAKE) -f $(defaultMakefileTarget) clean)
rm -rf build/share build/lib build/include build/bin/omc* build/bin/OMPlotWindow* build/bin/OMShell* build/bin/OMNotebook*
rm -rf build/share build/lib build/include build/bin/OMPlotWindow* build/bin/OMShell* build/bin/OMNotebook* \
build/bin/omc build/bin/omc.exe build/bin/omcp build/bin/omcp.exe

install-dirs:
mkdir -p ${INSTALL_BINDIR}
Expand Down

0 comments on commit 4c25a04

Please sign in to comment.