search
Log In
0 votes
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.

in Compiler Design
edited by
268 views

Please log in or register to answer this question.

Related questions

0 votes
0 answers
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.
asked Nov 30, 2016 in Compiler Design makhdoom ghaya 164 views
0 votes
0 answers
2
159 views
In a certain computer system, there is special instruction implemented to call subroutines. The instruction is JSR Reg.Sub Microsequence: Temp ← Sub SP ← (SP)+2 (SP) ← (Reg) Reg ← (PC) PC ← (Temp) Where Temp is an internal CPU register Sub is calling ... you would implement co-routine using the JSR instruction. Show the control flow diagram and the contents of the stack before and after the call.
asked Dec 1, 2016 in CO and Architecture makhdoom ghaya 159 views
0 votes
0 answers
3
225 views
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.
asked Dec 1, 2016 in CO and Architecture makhdoom ghaya 225 views
5 votes
0 answers
4
249 views
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.
asked Dec 1, 2016 in Digital Logic makhdoom ghaya 249 views
...