Parsing Mathematical operations

R.Aspin@lancaster.ac.uk (Rob Aspin)
22 Aug 1996 11:51:12 -0400

          From comp.compilers

Related articles
Parsing Mathematical operations R.Aspin@lancaster.ac.uk (1996-08-22)
Re: Parsing Mathematical operations kor@spectrospin.ch (Reto Koradi) (1996-08-24)
| List of all articles for this month |
From: R.Aspin@lancaster.ac.uk (Rob Aspin)
Newsgroups: comp.compilers,comp.graphics.algorithms
Date: 22 Aug 1996 11:51:12 -0400
Organization: Lancaster University
Keywords: parse, question, comment

I am tring to write an application which requires the parsing of a user
defined mathematical operation, writen in standard mathematical
notation, for both vector and scalar values, into a line of code.




eg
--vectors a b c
--scalars e f g


--input--->ans = (f*(a.b)+e*g)*c


should be transformed to a string such that:


--output--->ans = VecScalarMult(c,(f*(VecScalarProduct(a,b)+eg))


Where VecScalarMult and VecScalarProduct are functions


Does anyone have experience of this type of parsing, or do you have any
suggestions for where I could find info?




Many thanks
Rob Aspin
http://www.comp.lancs.ac.uk/computing/staff/aspinr.html
[Unless there's something I'm missing here, this looks like a straightforward
infix to prefix conversion, covered in any intro compilers text. -John]
--


Post a followup to this message

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