The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+10 votes
996 views

Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:

Indicate all the true statements from the following:

  1. Recursive descent parsing cannot be used for grammar with left recursion.
  2. The intermediate form for representing expressions which is best suited for code optimization is the postfix form.
  3. A programming language not supporting either recursion or pointer type does not need the support of dynamic memory allocation.
  4. Although C does not support call-by-name parameter passing, the effect can be correctly simulated in C
  5. No feature of Pascal typing violates strong typing in Pascal.

 

asked in Compiler Design by Veteran (68.8k points)
edited by | 996 views
A B C are correct. am i wrong?
B has to be true ....since postfix form enables the scanner read the expression in single pass. am I right?

2 Answers

+14 votes
Best answer
  1. is TRUE. Left recursive grammars if used directly in recursive descent parsing causes an infinite loop. So, left recursion must be removed before giving to a recursive descent parser.
     
  2. is a strong statement- but I do not have any proof or reference for this- so for now I consider this FALSE.
     
  3. is false. The language can have dynamic datatypes which requires dynamically growing memory when data type size increases.
     
  4. is true and using macro we can do this.
     
  5. out of syllabus now,
answered by Veteran (332k points)
edited by
@Arjun @Kapil is B true ??
arjun sir plz explain call by name??
@Arjun sir , i didnt get ur 3rd point ,what really a dynamic datatype is??
@arjun sir any example of dynamic datatypes?
+3 votes
A for sure, not sure about E
answered by Boss (7k points)
why not d?
transferring an expression to the function for lazy evaluation cannot be simulated directly in C. Off course it can be done by sending expression as string, but for that matter anything that can be implemented in C, as it is an LBA
We can use a macro and then include the function body rt?
I guess I need to go through macro details to say anything.
ok :)
what about option b & c ?? They both are also true right ??
I know about call by name , but can you explain statement d ? please.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,470 questions
39,199 answers
108,999 comments
36,575 users