The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+12 votes
1.3k 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 (59.6k points)
edited by | 1.3k views
0
A B C are correct. am i wrong?
+1
B has to be true ....since postfix form enables the scanner read the expression in single pass. am I right?
0
difficult tag should be made as normal

2 Answers

+15 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 (359k points)
edited by
0
@Arjun @Kapil is B true ??
0
arjun sir plz explain call by name??
0
@Arjun sir , i didnt get ur 3rd point ,what really a dynamic datatype is??
0
@arjun sir any example of dynamic datatypes?
+3 votes
A for sure, not sure about E
answered by Loyal (6.9k points)
0
why not d?
0
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
0
We can use a macro and then include the function body rt?
0
I guess I need to go through macro details to say anything.
0
ok :)
0
what about option b & c ?? They both are also true right ??
0
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

40,871 questions
47,532 answers
146,046 comments
62,298 users