Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » libsbml-development » Wishlist for infix parser?
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
myers


Posts: 140
Location:
University of Utah
Registered:
May 2008
Re: Wishlist for infix parser? 05 Oct '11 15:26 Go to previous messageGo to previous message

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.

Chris

Sent from my iPhone

On Oct 5, 2011, at 12:42 PM, Lucian Smith <lpsmith@spod-central.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:
>
> y*sin(x)
>
> 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?
>
> -Lucian
> ____________________________________________________________
> To manage your libsbml-development list subscription, visit
> https://utils.its.caltech.edu/mailman/listinfo/libsbml-development
>
> For a web interface to the libsbml-development mailing list, visit
> http://sbml.org/Forums/
>
> For questions or feedback about the libsbml-development list,
> contact sbml-team@caltech.edu
____________________________________________________________
To manage your libsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/libsbml-development

For a web interface to the libsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the libsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   Wishlist for infix parser? Lucian Smith05 Oct '11 11:42
Read Message   Re: Wishlist for infix parser?  myers05 Oct '11 15:26
Read Message   Re: Wishlist for infix parser? Lucian Smith05 Oct '11 15:47
Read Message   Re: Wishlist for infix parser? myers05 Oct '11 20:25
Previous Topic:Release of libSBML-5.2.0
Next Topic:Release of libSBML-5.1.0-b0
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.