I’m working on a Computer Science exercise and need support.
S → E$
F → id
E → T E’
The attribute grammar we discussed in class calculated the value of a given expression. In this question, you are to solve the same problem, but you should take a different approach: • Instead of directly computing the value of the expression, you are to generate C code that computes the value of the expression at runtime. Specifically, if you run the parser generated from the grammar annotated with your action routines, the parser should print C code to evaluate the parsed expression to stdout. • You are to use action routines written in C to generate this C code. The code you generate has access to….