GATE Computer ScienceModerateGATE CS (PYQ pattern)
Which of the following about run-time environments is/are true? I. An access (static) link points to the frame of the lexically enclosing procedure. II. A control (dynamic) link points to the caller's frame. III. Languages without nested procedures need access links for every call. IV. A display gives constant-time access to non-local variables of any nesting depth.
- A. I and II only
- B. I, II and IV only
- C. I, II and III only
- D. II, III and IV only
Correct answer: B. I, II and IV only
Languages without nested procedure declarations (like C) need no access links, so III is false; a display array stores the frame pointer for each nesting depth, which makes access to a non-local constant-time.
More Compiler Design questions
- For S′ → S; S → S ( S ) | ε, LALR(1) merges canonical LR(1) states with equal cores. The LALR state whose only item is S → S ( S ) · is…
- In 1: i = 0; 2: L1: if i >= n goto L3; 3: i = i + 1; 4: if i > k goto L1; 5: j = j + i; 6: goto L1; 7: L3: return j, how many back edges…
- An SLR(1) shift-reduce parser for E → T E'; E' → + T E' | ε; T → F T'; T' → F T' | ε; F → ( E ) | id parses "id + id id". Each shift and…
- Backpatching scheme (each relation gives 'if r goto ' and 'goto ', no fall-through optimisation, instruction numbers from 100). How many…
- A basic block compiles to six three-address statements: t1 = a + b; t2 = c d; t3 = a + b; t4 = t1 t2; t5 = t3 − t4; x = t5. Value…
- After applying left factoring repeatedly (each time extracting the longest common prefix of alternatives that share a first symbol…