Edit this page Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 10. Context-Free Languages & Lexers ====== ===== 10.1. Context-Free Grammar to PDA conversion ===== For each context-free grammar G: \\ - describe L(G) \\ - algoritmically construct a PDA that accepts the same language \\ - is the grammar ambiguous? If yes, write a non ambiguous grammar that generates the same language \\ - $ S \leftarrow aS | aSb | \epsilon $ \\ \\ - $ S \leftarrow aAA \\ A → aS | bS | a $ \\ - $ S \leftarrow ABC \\ A \leftarrow aA | \epsilon \\ B \leftarrow bbB | b \\ C \leftarrow cC | c$ ===== 10.2. Lexer Spec ===== Given the following specs, construct the lexer DFA as presented in lecture 14 [1]: * PAIRS: $ (10 | 01)* $ * ZERO_ONES: $ 01+ $ * NO_CONSEC_ONE: $ (1 | \epsilon)(01 | 0)* $ Separate the following input strings into lexemes: * ===== 10.3. Useful materials ===== [1] https://curs.upb.ro/2022/pluginfile.php/420515/mod_resource/content/0/L14-lexers.pdf