This is an old revision of the document!


10. Context-Free Languages & Lexers

For each context-free grammar G:

  1. describe L(G)
  2. algoritmically construct a PDA that accepts the same language
  3. is the grammar ambiguous? If yes, write a non ambiguous grammar that generates the same language
    1. $ S \leftarrow aS | aSb | \epsilon $

    2. $ S \leftarrow aAA \\ A → aS | bS | a $
    3. $ S \leftarrow ABC \\ A \leftarrow aA | \epsilon \\ B \leftarrow bbB | b \\ C \leftarrow cC | c$

Given the following specs, construct the lexer DFA as presented in lecture 14 [1]:

Separate the following input strings into lexemes: