Re: Parsing BNF for chemical equations

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Wed, 29 Aug 2007 02:16:39 +0200

          From comp.compilers

Related articles
Parsing BNF for chemical equations psaffrey@googlemail.com (psaffrey@googlemail.com) (2007-08-28)
Re: Parsing BNF for chemical equations DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-08-29)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Wed, 29 Aug 2007 02:16:39 +0200
Organization: Compilers Central
References: 07-08-085
Keywords: parse, debug
Posted-Date: 29 Aug 2007 15:55:29 EDT

psaffrey@googlemail.com wrote:


> I'm trying to build a parser for chemical equations such as
>
> A + B -> C
>
> and
>
> A + B <-> C + D
>
> I'm using the Python lex/yacc tool ply and at the moment I seem to be
> struggling a little. I have done this before, but it was ages ago and
> I'm rusty :(


If you have problems, try to use existing grammars for equivalent
languages. In your case a calculator or expression example might be
helpful, where you can substitute multiplication and division by your
reaction symbols.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.