diff -r 2849c305b12d -r 95af9beb4b7f slides/slides04.tex --- a/slides/slides04.tex Tue Oct 17 13:49:45 2017 +0100 +++ b/slides/slides04.tex Wed Oct 18 08:36:44 2017 +0100 @@ -338,7 +338,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] -\frametitle{Lexing} +\frametitle{Lexing: Test Case} \mbox{\lstinputlisting[language=While]{../progs/fib.while}} @@ -347,7 +347,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] -\frametitle{??} +\frametitle{?? Test Case} \mbox{\lstinputlisting[language=While]{../progs/collatz.while}} @@ -368,12 +368,12 @@ \hspace{5mm}{if}, {then}, {else},\\ WHITESPACE:\\ \hspace{5mm}{" "}, {$\backslash$n},\\ -IDENT:\\ +IDENTIFIER:\\ \hspace{5mm}LETTER $\cdot$ (LETTER + DIGIT + {\_})$^*$\\ NUM:\\ \hspace{5mm}(NONZERODIGIT $\cdot$ DIGIT$^*$) + {0}\\ OP:\\ -\hspace{5mm}{+}\\ +\hspace{5mm}+, -, *, \%, <, <=\\ COMMENT:\\ \hspace{5mm}{$\slash$*} $\cdot$ $\sim$(ALL$^*$ $\cdot$ (*$\slash$) $\cdot$ ALL$^*$) $\cdot$ {*$\slash$} \end{tabular} @@ -510,7 +510,7 @@ \draw[->,line width=1mm] (r2) -- (r3) node[above,midway] {\bl{$der\,b$}};\pause \node (r4) [right=of r3] {\bl{$r_4$}}; \draw[->,line width=1mm] (r3) -- (r4) node[above,midway] {\bl{$der\,c$}};\pause -\draw (r4) node[anchor=west] {\;\raisebox{3mm}{\bl{$nullable$}}};\pause +\draw (r4) node[anchor=west] {\;\raisebox{3mm}{\bl{$nullable?$}}};\pause \node (v4) [below=of r4] {\bl{$v_4$}}; \draw[->,line width=1mm] (r4) -- (v4);\pause \node (v3) [left=of v4] {\bl{$v_3$}}; @@ -586,12 +586,12 @@ \begin{center} \begin{tabular}{lcl} - \bl{$mkeps\,\ONE$} & \bl{$\dn$} & \bl{$Empty$}\\ - \bl{$mkeps\,r_1 + r_2$} & \bl{$\dn$} & \bl{if $nullable(r_1)$} \\ + \bl{$mkeps\,(\ONE)$} & \bl{$\dn$} & \bl{$Empty$}\\ + \bl{$mkeps\,(r_1 + r_2)$} & \bl{$\dn$} & \bl{if $nullable(r_1)$} \\ & & \bl{then $Left(mkeps(r_1))$}\\ & & \bl{else $Right(mkeps(r_2))$}\\ - \bl{$mkeps\,r_1 \cdot r_2$} & \bl{$\dn$} & \bl{$Seq(mkeps(r_1),mkeps(r_2))$}\\ - \bl{$mkeps\,r^*$} & \bl{$\dn$} & \bl{$[]$} \\ + \bl{$mkeps\,(r_1 \cdot r_2)$} & \bl{$\dn$} & \bl{$Seq(mkeps(r_1),mkeps(r_2))$}\\ + \bl{$mkeps\,(r^*)$} & \bl{$\dn$} & \bl{$[]$} \\ \end{tabular} \end{center} @@ -602,10 +602,10 @@ \begin{frame}[c] \frametitle{Inject} -Injecting (``Adding'') a character to a value\\ +Injecting (``Adding'') a character to a value\\[-12mm]\mbox{} \begin{center} -\begin{tabular}{l@{\hspace{1mm}}c@{\hspace{1mm}}l} +\begin{tabular}{@{}l@{\hspace{1mm}}c@{\hspace{1mm}}l@{}} \bl{$inj\,(c)\,c\,Empty$} & \bl{$\dn$} & \bl{$Char\,c$}\\ \bl{$inj\,(r_1 + r_2)\,c\,Left(v)$} & \bl{$\dn$} & \bl{$Left(inj\,r_1\,c\,v)$}\\ \bl{$inj\,(r_1 + r_2)\,c\,Right(v)$} & \bl{$\dn$} & \bl{$Right(inj\,r_2\,c\,v)$}\\ @@ -1253,7 +1253,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] -\frametitle{Two Rules} +\frametitle{Lexer: Two Rules} \begin{itemize} \item Longest match rule (``maximal munch rule''): The