Which of the following are true?
1. A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation.
2. Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being implemented has nesting of procedures/ function.
3. Recursion in programming languages cannot be implemented with dynamic storage allocation.
4. Nesting of procedures/functions and recursion require a dynamic heap allocation scheme
5. Programming languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records.
Consider the following procedure declaration:
procedure p ;
x : integer;
procedure q;
begin x = x + 1 end;
procedure r;
x : integer;
begin x := 1; q ; write(x) end;
begin
x = 2;
r;
end;
The output produced by calling P in a language with static scope will be
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Consider the following procedure declaration:
procedure p ;
x : integer;
procedure q;
begin x = x + 1 end;
procedure r;
x : integer;
begin x := 1; q ; write(x) end;
begin
x = 2;
r;
end;
The output produced by calling Pin a language with dynamic scope will be
Choose the false statements:
1. Control stack keeps track of live procedure activations.
2. Activation records can be managed with the help of stack.
3. Dangling reference is a reference to a storage that has been deallocated
Consider the following translation scheme:
Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input ‘2 * 3 + 4 ’ , this translation scheme prints
Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b }.
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
What is printed by the print statements in the program P1 assuming call by reference parameter passing?
Program P1 ()
{i
x = 10;
y= 3;
func (y, x , x);
print x;
print y;
}
func1 (x, y, z)
y = y + 4;
z = x + y + z;
Consider the following statements:
S1 Static allocation bindings do not change at runtime.
S2: Heap allocation allocates and de-allocates storage at run time.
Which of the above statements is/are true
63 videos|7 docs|165 tests
|
63 videos|7 docs|165 tests
|