GATE / CS ARCHIVE

GATE CSE 1994 / QUESTION 3.5

Matching compiler formalisms

Compiler Design · Compiler Phases, Linking & Loading · Full GATE CSE 1994 paper

GATE 1994, Q3.5 Other
Report issue

Compiler Phases, Linking & Loading

Question 3.5, GATE 1994: Match BNF, lexical analysis, YACC and recursive-descent parsing with general CFGs, regular expressions, LALR(1), LL(1).
Question 3.5, GATE 1994: Match BNF, lexical analysis, YACC and recursive-descent parsing with general CFGs, regular expressions, LALR(1), LL(1).
Tap to enlarge
Answer & solution

Answer: i–d,ii–a,iii–b,iv–c (no official key was published)

Backus–Naur form is a notation for context-free grammar productions. Lexical token patterns are commonly specified by regular expressions and recognized by finite automata. Traditional YACC constructs an LALR(1) parser. A predictive recursive-descent parser uses LL(1) choices, with one-token lookahead selecting a production. Thus the requested mapping is d,a,b,c. General recursive descent can also use backtracking or more lookahead, so the LL(1) match refers to its standard nonbacktracking predictive form.

Original paper, page 4