Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Question Bank for GATE Computer Science Engineering  >  Test: Syntax Directed Translation- 2 - Computer Science Engineering (CSE) MCQ

Test: Syntax Directed Translation- 2 - Computer Science Engineering (CSE) MCQ


Test Description

9 Questions MCQ Test Question Bank for GATE Computer Science Engineering - Test: Syntax Directed Translation- 2

Test: Syntax Directed Translation- 2 for Computer Science Engineering (CSE) 2024 is part of Question Bank for GATE Computer Science Engineering preparation. The Test: Syntax Directed Translation- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Syntax Directed Translation- 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Syntax Directed Translation- 2 below.
Solutions of Test: Syntax Directed Translation- 2 questions in English are available as part of our Question Bank for GATE Computer Science Engineering for Computer Science Engineering (CSE) & Test: Syntax Directed Translation- 2 solutions in Hindi for Question Bank for GATE Computer Science Engineering course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Syntax Directed Translation- 2 | 9 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study Question Bank for GATE Computer Science Engineering for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Syntax Directed Translation- 2 - Question 1

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.

Test: Syntax Directed Translation- 2 - Question 2

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

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 2

Since value output by program is the value of x which is declared in side DC function, so, output is 1 using static scoping.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Syntax Directed Translation- 2 - Question 3

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

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 3

Since value output by program is the value of x which is declared in side DC function, so, output is 1 using dynamic scoping.

Test: Syntax Directed Translation- 2 - Question 4

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

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 4
  • Control stack keeps tracks of live procedure. 
  • Activation records can be managed with.
  • Dangling reference is a reference to a storage that has been de-allocated.

All statement are true.

Test: Syntax Directed Translation- 2 - Question 5

 'Divide by Zero ’ is a

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 5

It is a semantic error (run-time error).

Test: Syntax Directed Translation- 2 - Question 6

 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

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 6

So an input 2 * 3 + 4, it prints from the above parse tree as 234 + *.

Test: Syntax Directed Translation- 2 - Question 7

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:

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 7

Input is ‘aab’
So tree for given input.

So output will be 2, 3 and 1 because printed order will be 1, 2, 3.
So output: 2 3 1

Test: Syntax Directed Translation- 2 - Question 8

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;
 

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 8

Actual output will be x = 31 and y = 3.

Test: Syntax Directed Translation- 2 - Question 9

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

Detailed Solution for Test: Syntax Directed Translation- 2 - Question 9
  • Static allocation binding do not change at runtime.
  • Heap allocation allocated and deallocate storage at run time
63 videos|7 docs|165 tests
Information about Test: Syntax Directed Translation- 2 Page
In this test you can find the Exam questions for Test: Syntax Directed Translation- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Syntax Directed Translation- 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)