Professional Documents
Culture Documents
Knowledge Level K1: Remembering K2: Understanding K3: Applying K4: Analyzing K5: Evaluating K6: Creating
C302.1 Analyze the different phases of compiler.
Course
Outcomes
C302.2 Design a lexical analyzer for a sample language.
C302.3 Analyze the intermediate code.
(Or)
12 b. Outline a transition diagrams. Explain briefly how the keywords and identifiers are 13 K2/C302.1
recognized using a running example.
(ii) Prepare the following grammar is LL(1) but not SLR(1). S→AaAb | BbBa A→€
7+6 K3/C302.2
B→€
(Or)
13 b. Select the grammar S → ABD, A → a | Db | ε, B → gD |dA | ε , D → e | f i) Construct
FIRST and FOLLOW for each nonterminal of the above grammar. ii) Construct the
predictive parsing table for the grammar. iii) Show the parsing action on a valid string 13 K3/C302.2
and on an invalid string iv) Check whether the grammar is LL (1). Give justification.
14 a. Assume the following CFG E→E or T|T T→T and F|F F→not F|(E)|true |false Write
the semantic rules and explain the processes converting “not (true or false)” to
13 K4/C302.2
intermediate form using Parser tree method.
(Or)
14 b. Assume the following grammar and construct SLR parser. E → E + T/T, T → T * F|F,
F → (E) |id. 13 K4/C302.2
(i)Inherited Atrributes and Synthesized attributes. (ii) Evaluate SDD of a parse tree.
13 K5/C302.3
(Or)
15 b. (i).Explain the common three address instruction forms.
(ii). Explain the two ways of assigning labels to the following three address statements 7+6 K5/C302.3
Do i=i+1; While (a[i]<v);
Recommended Distribution
UG 50% - 60% 30% - 50% 10% - 15%
of Marks (%)
Checklist of Mark Distribution:
Date: Signature