Explain different stages of compiler with a suitable example. What is token, Patterns and Lexeme?
12 October, 2024What is Basic Block? List out the basic blocks and draw the flow graph for the following code:
1. |
location= -1 |
2. |
i=0 |
3. |
i<100 goto 5 |
4. |
goto 13 |
5. |
t1=4*i |
6. |
t2=A[t1] |
7. |
if t2=x goto 9 |
8. |
goto 10 |
9. |
location=i |
10. |
t3=i+1 |
11. |
i=t3 |
12. |
goto 3 |
13. |
… |
What do you mean by a Handle? Give example. When a grammar is called ambiguous? Is there any technique to remove ambiguity? Explain with an example. What is the reduce-reduce conflict in LR parser? What are various data structures used for symbol table construction?
12 October, 2024Describe various actions of a shift reduce parsers.
12 October, 2024What do you mean by input buffering? How is input buffering implemented? What problem can arise implementing input buffering? Give suitable example. What is sentinel? What is its use?
12 October, 2024For the input expression (4*7+1)*2, construct an annotated parse tree.
12 October, 2024