Skip to content

Commit

Permalink
- Add class comments in Susan-generated code
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8580 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 11, 2011
1 parent 52d2d1b commit b0d15c4
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Compiler/FrontEnd/MMath.mo
@@ -1,8 +1,11 @@
encapsulated package MMath "copyright MathCore Engineering AB 2008-2009
author Peter Aronsson (peter.aronsson@mathcore.com)
author Peter Aronsson (peter.aronsson@mathcore.com)
file: MMath.mo
package: MMath
description: Rational numbers and operations
This package contains a datatype for rational numbers and operations on rational numbers
$Id$
"
public
uniontype Rational
Expand Down
11 changes: 10 additions & 1 deletion Compiler/FrontEnd/UnitParserExt.mo
@@ -1,4 +1,13 @@
encapsulated package UnitParserExt "external package interface for UnitParser. Copyright MathCore engineering AB 2008-2009"
encapsulated package UnitParserExt "
Copyright MathCore engineering AB 2008-2009
file: UnitParserExt.mo
package: UnitParserExt
description: Physical unit checking.

RCS: $Id$
"


public import UnitAbsyn;

Expand Down
24 changes: 24 additions & 0 deletions Compiler/Template/TplCodegen.mo
@@ -1,4 +1,11 @@
encapsulated package TplCodegen
"
file: TplCodegen.mo
package: TplCodegen
description: Generated by Susan.

$Id$
"

public import Tpl;

Expand Down Expand Up @@ -56,7 +63,24 @@ algorithm
txt = Tpl.writeTok(txt, Tpl.ST_STRING("encapsulated package "));
txt = pathIdent(txt, i_name);
txt = Tpl.softNewLine(txt);
txt = Tpl.writeTok(txt, Tpl.ST_LINE("\"\n"));
txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
txt = Tpl.writeTok(txt, Tpl.ST_STRING("file: "));
txt = pathIdent(txt, i_name);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
".mo\n",
"package: "
}, false));
txt = pathIdent(txt, i_name);
txt = Tpl.softNewLine(txt);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
"description: Generated by Susan.\n",
"\n",
"$Id$\n"
}, true));
txt = Tpl.popBlock(txt);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
"\"\n",
"\n",
"public import Tpl;\n",
"\n"
Expand Down
7 changes: 7 additions & 0 deletions Compiler/Template/Unparsing.mo
@@ -1,4 +1,11 @@
encapsulated package Unparsing
"
file: Unparsing.mo
package: Unparsing
description: Generated by Susan.
$Id$
"

public import Tpl;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/susan_codegen/SimCode/Makefile
Expand Up @@ -31,7 +31,7 @@ Unparsing.mo : Unparsing.tpl SimCodeTV.mo
cp -pf $@ ../../Template/
@echo " "

SimCodeDump.mo : SimCodeDump.tpl SimCodeDump.mo
SimCodeDump.mo : SimCodeDump.tpl SimCodeTV.mo
@echo " ** SimCodeDump template compilation ** "
$(OMC) $< > $@.log || (cat $@.log && false)
cp -pf $@ ../../Template/
Expand Down
24 changes: 24 additions & 0 deletions Compiler/susan_codegen/TplCodegen.mo
@@ -1,4 +1,11 @@
encapsulated package TplCodegen
"
file: TplCodegen.mo
package: TplCodegen
description: Generated by Susan.

$Id$
"

public import Tpl;

Expand Down Expand Up @@ -56,7 +63,24 @@ algorithm
txt = Tpl.writeTok(txt, Tpl.ST_STRING("encapsulated package "));
txt = pathIdent(txt, i_name);
txt = Tpl.softNewLine(txt);
txt = Tpl.writeTok(txt, Tpl.ST_LINE("\"\n"));
txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
txt = Tpl.writeTok(txt, Tpl.ST_STRING("file: "));
txt = pathIdent(txt, i_name);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
".mo\n",
"package: "
}, false));
txt = pathIdent(txt, i_name);
txt = Tpl.softNewLine(txt);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
"description: Generated by Susan.\n",
"\n",
"$Id$\n"
}, true));
txt = Tpl.popBlock(txt);
txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
"\"\n",
"\n",
"public import Tpl;\n",
"\n"
Expand Down
7 changes: 7 additions & 0 deletions Compiler/susan_codegen/TplCodegen.tpl
Expand Up @@ -8,6 +8,13 @@ template mmPackage(MMPackage it) ::=
case MM_PACKAGE(__) then
<<
encapsulated package <%pathIdent(name)%>
"
file: <%pathIdent(name)%>.mo
package: <%pathIdent(name)%>
description: Generated by Susan.

$Id$
"

public import Tpl;

Expand Down

0 comments on commit b0d15c4

Please sign in to comment.