This time our task is to write a program that imitates a simple desk calculator .Our calculator can accept an infix expression which includes (, ), +, -, *, /, % and ^(exp exponentiation operator, a^b= a b ).
implement a routine that takes an infix notation expression, converts it to postfix through an expression tree, and then evaluates the postfix notation.
编译原理龙书答案 完整性高 第二章 2.2 Exercises for Section 2.2 2.2.1 Consider the context-free grammar: S -> S S + | S S * | a Show how the string aa+a* can be generated by this grammar. Construct a parse tree for this string. What language does this grammar ge