Computer Science EngineeringHardISRO SC
Nested procedures use static (access) links. A procedure at nesting depth 4 references a local variable declared in an enclosing procedure at nesting depth 1. How many static links must be followed to reach that variable's activation record?
- A. 4
- B. 3
- C. 2
- D. 1
Correct answer: B. 3
The number of static-link hops is (use depth) - (declaration depth) = 4 - 1 = 3.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- Nested procedures use static (access) links. A procedure at nesting depth 3 references a local variable declared in an enclosing procedure…
- Global int g = 2; procedure P(a, b) { a = a + 5; b = b + a; print(a + b + g); } is called as P(g, g). The value printed under call by…
- How many of the following operations are guaranteed to produce a context-free language when applied to context-free languages L1, L2 and a…
- A shift/reduce conflict in a Yacc-style generator that is not resolved by precedence declarations is, by default, resolved by
- The complement of a context-sensitive language is
- A deterministic PDA with acceptance by empty stack (not final state) can accept only languages that are