

3. Consider the following grammar: expr term term tail term-tail-) add-op term term-ail 1 ε term ...
Consider the following grammar expr- term term_tail term_tail -add_op term term_tail | term - factor factor_tail factor_tail-mult_op factor factor _tail | factor -(expr) |id|literal add_op -+|- mult_op-*|/ Draw syntax tree for parsing each of cdf+(a25+84),(a25+84)*cdf,84*cdf+a25,a25+84*cdf,a25*84*cdf.Note that a25 and cdf are identifiers and 84 is a literal.You are not asked to do the tedious parsing process with stack snapshots.Instead you only need to draw sysntax trees,but you do need to do lexical analysis N.B: I need only lexical analysis for this...
Question 3: Given the following grammar: assign → id := expr expr → expr + term \ term term -term *factor lfactor factor-(expr) id Using the above grammar, show a leftmost derivation (first five steps) for the following assignment statement: A ((A B)+ C) a. [3 marks] b. Using the above grammar, show a rightmost derivation (first five steps) for the following assignment statement: A:-A+B+C)+A [3 marks] Draw the abstract syntax tree for each of the above statements [4 marks]...