You are on page 1of 3

Radha Govind Engineering College, Meerut Set A

Odd Semester Practical Examination, 2008-2009


B.Tech. (CS) V Semester (A & B)
Compiler Design Lab (TCS-552)
Time: 15 minutes

Student Name: Roll S


No:

Signature Signature Marks Obtained:


(External Examiner) (Internal Examiner) Max Marks: 10

Attempt all questions. Each question carries equal marks.


6) "= =" and "!="
1) LEX input consists of X declarations  Are not at the same precedence
of pattern level.
 X %% as a separator  Are on a lower precedence level
 $$ as a separator than %.
 // as a separator  Are on a higher precedence
level than %.
2) Compiler Construction concerns
about: 7) Fill up the blanks in the transition
 Design of programming languages diagram shown in the right to
 Design of translator systems for recognize LE, NE, LT, EQ, GE, GT
language return (relop, ___)
 Building converter for programs

return (relop, ___)


3) LL1 languages:
 are good for top down parsing
return (relop, ___)
 needs more than one token look
ahead
return (relop, ___)
 work good with left recursion

4) Buffer pairs are used return (relop,___)


 For code optimization.
 With a "lexemBegin" and a return (relop,___)
"forward" pointer.
 For optimize print operations.
8) The attribute of a number token
5) If the input does not match any contains
allowed pattern, the scanner Its type
 Replaces it by the Its value
corresponding input. Its variable
 Stops.
 Read successive input chars 9) <num, 31>
 is a token without attribute.
until it matches something.
 is a token with one
attribute.
 is a token with two The Kleene closure without Null Char.
attributes.  A variable named L, which
10) L+ is is added to somewhat.

Radha Govind Engineering


******************************* College, Meerut
End ********************************
Set B
Odd Semester Practical Examination, 2008-2009
B.Tech. (CS) V Semester (A & B)
Compiler Design Lab (TCS-552)
Time: 15 minutes

Student Name: Roll S


No:

Signature Signature Marks Obtained:


(External Examiner) (Internal Examiner) Max Marks: 10

Attempt all questions. Each question carries equal marks.

1) Scanner input buffer is used for  Operations with tree addresses


efficiency reasons. as parameter.
True  Operations with tree values as
False parameter
 Operations with tree values as
2) If a parser gets white space parameter referenced by
It get confused addresses.
It works with it as defined in the
grammar 7) <id, “count"> is a
It ignores it  Reserved word.
 A token.
3) Ambiguity  Variable name.
Allows more than one meaning of one
expression 8) If a programmer writes "fi"
Is well suited together with predicted instead of "if"
parsing  The scanner recognizes it and
It should not be avoided reports an error.
 The parser treads "fi" as a "id"
4) Assignment: token.
 Is right associative  The parser generates code
 Is left associative which assigns the variable "fi" a
 Is are no associative at all value.
5) 741 + 28 * 59 is converted to 9) Is the following grammar AB,
 8 token
Ba, Bb
 5 token
 12 token  Can be used for predicted
parsing.
6) Three-address-code contains of  Cannot be used for predicted
parsing.
 Cannot be modified in order to be 10) A cross compiler is a compiler
used for predicted parsing. that runs on one machine and
produce code for another machine.
 True
 False

******************************* End ********************************

You might also like