# GATE1989-10b

268 views

Consider the following grammar for variable declarations:

• <vardecl> $\rightarrow$ <vardecl><idlist> : <type>;
• <vardecl> $\rightarrow \in$
• <idlist> $\rightarrow$ <idlist>, id
• <idlist> $\rightarrow$ id
• <type> $\rightarrow$ integer
• <type> $\rightarrow$ real

Write a syntax - directed translation scheme to install the identifiers into the symbol table. You must also issue appropriate error messages wherever necessary. Make suitable assumptions regarding procedures operating on the symbol table; you need not elaborate upon these procedures.

edited

## Related questions

1
164 views
Provide short answers to the following questions: Consider the definition of macro B, nested within the definition of a macro A. Can a call to macro B also appear within macro A? If not, why not? If yes, explain if there are any restrictions.
A certain computer system was designed with cache memory of size $1$ Kbytes and main memory size of $256$ Kbytes. The cache implementation was fully associative cache with $4$ bytes per block. The CPU memory data path was $16$ ... Answer the following questions: What is the hit ratio? Suggest a change in the program size of model to improve the hit ratio significantly.
It is required to implement a stack using bidirectional shift registers providing stack under flow and overflow detection capability. How many shift registers are needed for a stack capacity of $n$ $k-$bit words? Show the schematic diagram of the implementation, clearly indicating all the data and control lines.