Info. needed on parsing expressions

System Hacker jayneus at reliant.Berkeley.EDU
Sun Mar 26 11:59:39 AEST 1989


I need to parse a file which contains a set of arithmetic expressions
in normal format and build up an expression tree for use in my C program.
The tree need not be balanced.
For example, given the following expression in a file:-

x = a*b + c*(d + e);

The resulting tree would be:-
		 +
		/ \
               /   \
	      *     *
	    /  \    /\
           a    b  c  \
                       +
                       /\
                      d  e

Is there some utility package for doing this ?
Any information/help shall be greatly appreciated.

Thanks,
Arvind
EMAIL: sarvind at janus.Berkeley.EDU
--
----------------------------------------------------------------------------
"There is a certain power in mirth that only the jokers know"
EMAIL: jayneus at reliant.Berkeley.EDU
----------------------------------------------------------------------------



More information about the Comp.lang.c mailing list