This would be great!
Couple questions. I don't allow sin to be redefined. Is this actually legal? The current parseFormula function has no knowledge of the document so I assume your now would need to. Perhaps, you should have a version with no document and assume sin is sin.
Also, how do you plan to handle time? I assume t or time in a string should be translated to the time csymbol.
Sent from my iPhone
On Oct 5, 2011, at 12:42 PM, Lucian Smith <firstname.lastname@example.org> wrote:
> So, as part of beginning to add units to Antimony, I would like to write a
> new infix parser that is able to assign units to free numbers (as you can
> now do in SBML L3). And if I'm going to do that, I might as well add in
> all the other things that the libsbml infix-to-ASTNode parser was never
> designed to do, but people would like for it to handle. I think it makes
> the most sense for this to be standalone, and if I do that, I might as
> well contribute the code to libsbml at the same time. So! What's on
> your wishlist? Here's mine:
> * Ability to assign units to numbers
> * Parse boolean expressions from boolean symbols:
> * >, <, <=, >=, ==, !=
> * &&, ||, !
> * Automatic handling of SBML pre-defined csymbols (time, avogadro, delay)
> * Automatic handling of those pre-defined MathML functions allowed in
> SBML (sin, cos, etc.)
> * A way to translate symbols either as pre-defined elements or as
> SBML-defined elements (pi=3.14159 vs. pi=inorganic phosphate).
> I'm not entirely sure how to solve that last one, but I think it's worth
> investigating, at least.
> As far as the syntax, I was imagining that 'NUMBER STRING' would be parsed
> as assigning the STRING as the units of NUMBER, as having a string after a
> number is otherwise an illegal formation.
> The other bits would compare a list of reserved words vs. (possibly) a
> provided list of SIds, with the SIds taking precedence if appropriate and
> present. In other words:
> would use the built-in 'sine' function from MathML, unless you told it you
> had a FunctionDefinition with the SId 'sin'.
> The only other syntax issue I can think of is the log vs. natural log
> issue that crops up in the current infix parser. It might be nice to fix
> it to how some expect, but then again, if we're all used to doing it this
> way, 'what people expect' has now changed and we should do it the old way
> to be consistent. I think I'm leaning towards the latter.
> Any opinions? Other things you want?
> To manage your libsbml-development list subscription, visit
> For a web interface to the libsbml-development mailing list, visit
> For questions or feedback about the libsbml-development list,
> contact email@example.com
To manage your libsbml-development list subscription, visit
For a web interface to the libsbml-development mailing list, visit
For questions or feedback about the libsbml-development list,