(a) (i) What is a Regular Expression? List and explain the rules that…

Previous year question for Compiler Design.

Question

(a) (i) What is a Regular Expression? List and explain the rules that define a regular expression.

(ii) Design a DFA over an alphabet $\Sigma = \{a, b\}$ that accepts all the strings ending with 'ab'. Process a string 'aabab' in this finite automata.

(b) Consider the grammar

$S \rightarrow iCtSS' \mid a$

$S' \rightarrow eS \mid \varepsilon$

$C \rightarrow b$

(i) Compute FIRST and FOLLOW for the above grammar.

(ii) Construct the predictive parsing table for the above grammar and check whether the grammar is LL (1) or not.

Related pages

Open on CachedInfo