\begin{frame}{Parser Tables} \begin{block}{} The \emph{parser table} for a context-free grammar is a table with \begin{itemize}\setlength{\itemsep}{0pt} \item columns indexed by terminals $T \cup \{\$\}$, \item rows indexed by variables $V$, \end{itemize} At place $[a \in T \cup \{\$\},B \in V]$ it contains rules $B \to u$ for which \begin{itemize}\setlength{\itemsep}{0pt} \item $a \in \first{u}$, or \hfill\textcolor{black!50}{(never the case for $a = \$$)} \item $\lambda \in \first{u}$ and $a \in \follow{B}$. \end{itemize} \end{block} \pause \begin{exampleblock}{} \begin{malign} S \to aSb\mid\lambda \end{malign} We have \begin{itemize}\setlength{\itemsep}{0pt} \item $\first{aSb} = \{a\}$, $\first{\lambda} = \{\lambda\}$, $\first{S} = \{\lambda, a\}$ \item $\follow{S} = \{b,\$\}$, \end{itemize} Thus the parser table is: \begin{talign} \begin{array}{l|ccc} & a & b & \$ \\ \hline S & \mpause[1]{~S \to aSb~} & \mpause{~S \to \lambda~} & \mpause{~S \to \lambda} \end{array} \end{talign}\vspace{-1ex} \end{exampleblock} \end{frame}