Parsing Mathematical operations (Rob Aspin)
22 Aug 1996 11:51:12 -0400

          From comp.compilers

Related articles
Parsing Mathematical operations (1996-08-22)
Re: Parsing Mathematical operations (Reto Koradi) (1996-08-24)
| List of all articles for this month |

From: (Rob Aspin)
Newsgroups: comp.compilers,
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.

--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
[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.