|Parsing Mathematical operations R.Aspin@lancaster.ac.uk (1996-08-22)|
|Re: Parsing Mathematical operations firstname.lastname@example.org (Reto Koradi) (1996-08-24)|
|From:||R.Aspin@lancaster.ac.uk (Rob Aspin)|
|Date:||22 Aug 1996 11:51:12 -0400|
|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?
[Unless there's something I'm missing here, this looks like a straightforward
infix to prefix conversion, covered in any intro compilers text. -John]
Return to the
Search the comp.compilers archives again.