- From: r.britten at auckland.ac.nz (Randall Britten)
- Subject: [cellml-dev] Code generation for a variety of languages.
- Date: Thu, 21 Feb 2008 17:59:03 +1300
I mailed Andre, and he agreed that it would fit in well with the CellML api,
perhaps as examples/recipes as you suggest. I do see your point that there
are a range of possible templates for any given language, but that fits well
with the idea of the ones we provide being examples/recipes.
>
-----Original Message-----
>
From: cellml-tools-developers-bounces at cellml.org [mailto:cellml-tools-
>
developers-bounces at cellml.org] On Behalf Of Andrew Miller
>
Sent: Thursday, 21 February 2008 11:42 a.m.
>
To: A list for the developers of CellML tools
>
Subject: Re: [cellml-dev] r2112 - in pce/trunk/chrome/content: .
>
controls ui util
>
>
Randall Britten wrote:
>
> Hi Andrew
>
>
>
> I managed to decode the other variable abbreviations, but what is
>
"mnl" in
>
> "listFlaggedEquations"?
>
>
>
It stands for "MathML Node List" - but I'm not entirely sure that the
>
name is very important to understand the code - just about anything
>
that
>
is not too long to remember or too short to get confused with other
>
variable names would do, I hope (I certainly wouldn't recommend
>
renaming
>
it to mathmlNodeList in this particular case, because it is probably a
>
bit like calling a loop index signedInteger or something), and calling
>
it something shorter like 'l' might also not help readability.
>
> Also, perhaps the specifications of the variety of languages that can
>
be
>
> generated should be distributed with the CellML-API, under an
>
associated
>
> "utilities" directory?
>
>
>
I think we do need to be careful about what is data, and what is code.
>
CCGS does, as it stands, have a reasonable abstraction in that we have
>
separated out a lot of the data involved in code generation (at least
>
the parts that differ between languages) from the code that does the
>
generation. It might still make sense to provide a less generic
>
interface that makes it easier to generate particular languages,
>
although maybe language specifications might better be distributed as
>
'recipes' for use of the API for specific purposes - it does mean that
>
every user duplicates the MAL data and the like, but this might be
>
justified because the exact form depends not only on the language
>
itself, but on the simulation environment for which generated code is
>
to
>
run.
>
>
Best regards,
>
Andrew
>
>
> Regads,
>
> Randall
>
>
>
>
>
>> -----Original Message-----
>
>> From: automated-notifications-bounces at cellml.org [mailto:automated-
>
>> notifications-bounces at cellml.org] On Behalf Of CellML Automated
>
>> Notifications
>
>> Sent: Wednesday, 20 February 2008 4:25 p.m.
>
>> To: automated-notifications at cellml.org
>
>> Subject: r2112 - in pce/trunk/chrome/content: . controls ui util
>
>>
>
>> Author: amil082
>
>> Date: 2008-02-20 16:25:19 +1300 (Wed, 20 Feb 2008)
>
>> New Revision: 2112
>
>>
>
>> Added:
>
>> pce/trunk/chrome/content/exportProcedural.xul
>
>> pce/trunk/chrome/content/ui/ExportProcedural.js
>
>> pce/trunk/chrome/content/util/CodeGeneration.js
>
>> Modified:
>
>> pce/trunk/chrome/content/controls/integrationsettings.xml
>
>> pce/trunk/chrome/content/controls/model.xml
>
>> pce/trunk/chrome/content/pcenv.xul
>
>> Log:
>
>> Added support for an "Export to C" function.
>
>>
>
>> This also involved a minor refactoring of how the
>
integrationsettings
>
>> control
>
>> reports errors so that some of the functions involved are shared
>
with
>
>> the
>
>> procedural code export.
>
>>
>
>> Fixes tracker item 110.
>
>>
>
>>
>
>
>
> ...
>
>
>
>
>
>> +function listFlaggedEquations(cci)
>
>> +{
>
>> + mnl = cci.flaggedEquations;
>
>> + var str = "";
>
>> +
>
>> + var i, l = mnl.length;
>
>> + for (i = 0; i < l; i++)
>
>> + {
>
>> + var apply = mnl.item(i);
>
>> + var math = apply.parentNode.QueryInterface
>
>> + (Components.interfaces.domIElement);
>
>> + str += " * Equation";
>
>> + apply = apply.QueryInterface
>
>> + (Components.interfaces.domIElement);
>
>> + var applyId = apply.getAttribute("id");
>
>> + var mathId = math.getAttribute("id");
>
>> + if (applyId != "")
>
>> + str += " in apply element with id " + applyId;
>
>> + if (mathId != "")
>
>> + str += " in math element with id " + mathId;
>
>> + if (mathId == "" && applyId == "")
>
>> + str += " with no id on the apply or math element";
>
>> + str += ".\n";
>
>> + }
>
>> +
>
>> + return str;
>
>> +}
>
>>
>
>>
>
>
>
> _______________________________________________
>
> cellml-tools-developers mailing list
>
> cellml-tools-developers at cellml.org
>
> http://www.cellml.org/mailman/listinfo/cellml-tools-developers
>
>
>
>
_______________________________________________
>
cellml-tools-developers mailing list
>
cellml-tools-developers at cellml.org
>
http://www.cellml.org/mailman/listinfo/cellml-tools-developers
Archive powered by MHonArc 2.6.18.