Reg. No.
ANNA UNIVERSITY REGIONAL CAMPUS MADURAI
                          KEELAKUILKUDI, MADURAI – 625019
                            INTERNAL ASSESSMENT TEST I
                               (REGULATION – 2021 CBCS)
                    B.E. – Computer Science and Engineering
                             (YEAR / SEMESTER : III / V)
CS3501 -Compiler Design
Date of Exam: 08.10.24            Time: 1 hr.         Total Marks : 50
R - Remembering ::U - Understanding :: AP - Applying (R,U,AP:60% of Total Marks)
AN - Analyzing :: E - Evaluating     :: C – Creating (AN,E,C:40% of Total Marks)
                              Answer ALL Questions
BTL &
                             PART A – (5  2 = 10 Marks)                      Marks
 CO
U, CO1      1.     Define compiler.                                             2
R, CO1      2.     Depict output of semantic analyser for the expression
                                                                                2
                   a=b+c*60
  AP,
            3.     What are the goals of error handler in parser?               2
 CO2
E, CO2      4.     S->iEtS|iEtSES|a and E->b Eliminate left factoring.          2
 AN,
            5.     Draw an annotated parse tree for the expression 3*5          2
 CO3
                       PART B – (2  16 = 32 Marks) &(1  8 = 8 Marks)
R, CO1     11a.    Consider the fragment of C code i=i*70+j+2. Write the
                                                                               16
                   output of all phases of the compiler for above code.
                                           OR
                   Design a Finite Automata from a RegEx
R, CO1    11.b.    10+(0+11)0*1
                   1(1*01*01*)*
                                                                               16
                   0*1+10
                   Construct predictive parser for the following grammar
U, CO2    12. a.   and parse the string (a)$
                   S->(L)|a     L->L,S|S                                       16
                                            OR
                   Parse the string id=id$ constructing LALR parser for the
U, CO2    12. b.   grammar
                                                                               16
                   S->L=R|R       L->*R|id          R->L
E, CO2    13. a)   Explain the process of Backpatching in Compiler Design.      8
                                           OR
E, CO2    13. b)   Illustrate intermediate code for switch statement.           8
                                            1
                                                                                      -------
Faculty In charge       HoD
                    2
                              -------