<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
diff -r 1446bc47a294 -r b56d5e4468c0 slides/slides04.tex
--- a/slides/slides04.tex	Sun Oct 12 19:39:55 2014 +0100
+++ b/slides/slides04.tex	Sun Oct 12 21:54:04 2014 +0100
@@ -571,12 +571,149 @@
 \draw[-&gt;,line width=0.5mm]  (r3) -- (v3);
 \draw[-&gt;,line width=0.5mm]  (r2) -- (v2);
 \draw[-&gt;,line width=0.5mm]  (r1) -- (v1);
+\draw (r4) node[anchor=north west] {\;\raisebox{-8mm}{\bl{$mkeps$}}};
 \end{tikzpicture}
 \end{center}
 
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Regexes and Values}
+
+Regular expressions and their corresponding values:
+
+\begin{center}
+\begin{columns}
+\begin{column}{3cm}
+\begin{tabular}{@{}rrl@{}}
+  \bl{$r$} &amp; \bl{$::=$}  &amp; \bl{$\varnothing$}\\
+           &amp; \bl{$\mid$} &amp; \bl{$\epsilon$}   \\
+           &amp; \bl{$\mid$} &amp; \bl{$c$}          \\
+           &amp; \bl{$\mid$} &amp; \bl{$r_1 \cdot r_2$}\\
+           &amp; \bl{$\mid$} &amp; \bl{$r_1 + r_2$}   \\
+  \\
+           &amp; \bl{$\mid$} &amp; \bl{$r^*$}         \\
+  \\
+  \end{tabular}
+\end{column}
+\begin{column}{3cm}
+\begin{tabular}{@{\hspace{-7mm}}rrl@{}}
+  \bl{$v$} &amp; \bl{$::=$}  &amp; \\
+           &amp;             &amp; \bl{$Empty$}   \\
+           &amp; \bl{$\mid$} &amp; \bl{$Char(c)$}          \\
+           &amp; \bl{$\mid$} &amp; \bl{$Seq(v_1\,v_2)$}\\
+           &amp; \bl{$\mid$} &amp; \bl{$Left(v)$}   \\
+           &amp; \bl{$\mid$} &amp; \bl{$Right(v)$}  \\
+           &amp; \bl{$\mid$} &amp; \bl{$[]$}      \\
+           &amp; \bl{$\mid$} &amp; \bl{$[v_1,\ldots\,v_n]$} \\
+  \end{tabular}
+\end{column}
+\end{columns}
+\end{center}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Mkeps}
+
+Finding a (posix) value for recognising the empty string
+
+\begin{center}
+\begin{tabular}{lcl}
+  \bl{$mkeps\,\epsilon$}  &amp; \bl{$\dn$}  &amp; \bl{$Empty$}\\
+  \bl{$mkeps\,r_1 + r_2$} &amp; \bl{$\dn$}  &amp; \bl{if $nullable(r_1)$}  \\
+                          &amp;             &amp; \bl{then $Left(mkeps(r_1))$}\\
+                          &amp;             &amp; \bl{else $Right(mkeps(r_2))$}\\
+  \bl{$mkeps\,r_1 \cdot r_2$}  &amp; \bl{$\dn$} &amp; \bl{$Seq(mkeps(r_1),mkeps(r_2))$}\\
+  \bl{$mkeps\,r^*$}      &amp; \bl{$\dn$} &amp; \bl{$[]$}  \\
+\end{tabular}
+\end{center}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Inject}
+
+Injecting (``Adding'') a character to a value\\
+
+\begin{center}
+\begin{tabular}{l@{\hspace{1mm}}c@{\hspace{1mm}}l}
+  \bl{$inj\,(c)\,c\,Empty$} &amp; \bl{$\dn$}  &amp; \bl{$Char\,c$}\\
+  \bl{$inj\,(r_1 + r_2)\,c\,Left(v)$} &amp; \bl{$\dn$}  &amp; \bl{$Left(inj\,r_1\,c\,v)$}\\
+  \bl{$inj\,(r_1 + r_2)\,c\,Right(v)$} &amp; \bl{$\dn$}  &amp; \bl{$Right(inj\,r_2\,c\,v)$}\\
+  \bl{$inj\,(r_1 \cdot r_2)\,c\,Seq(v_1,v_2)$} &amp; \bl{$\dn$}  &amp; \bl{$Seq(inj\,r_1\,c\,v_1,v_2)$}\\
+  \bl{$inj\,(r_1 \cdot r_2)\,c\,Left(Seq(v_1,v_2))$} &amp; \bl{$\dn$}  &amp; \bl{$Seq(inj\,r_1\,c\,v_1,v_2)$}\\
+  \bl{$inj\,(r_1 \cdot r_2)\,c\,Right(v)$} &amp; \bl{$\dn$}  &amp; \bl{$Seq(mkeps(r_1),inj\,r_2\,c\,v)$}\\
+  \bl{$inj\,(r^*)\,c\,Sequ(v,vs)$} &amp; \bl{$\dn$}  &amp; \bl{$inj\,r\,c\,v\,::\,vs$}\\
+\end{tabular}
+\end{center}\bigskip
+
+\footnotesize
+\bl{$inj$}: 1st arg $\mapsto$ a rexp; 2nd arg $\mapsto$ a character; 3rd arg $\mapsto$ a value 
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Lexing}
+
+\begin{center}
+\begin{tabular}{l@{\hspace{1mm}}c@{\hspace{1mm}}l}
+  \bl{$lex\,r\,[]$} &amp; \bl{$\dn$}  &amp; \bl{if $nullable(r)$ then $mkeps(r)$ else $error$}\\
+  \bl{$lex\,r\,c::s$} &amp; \bl{$\dn$}  &amp; \bl{$inj\,r\,c\,lex(der(c,r), s)$}\\
+\end{tabular}
+\end{center}
+
+\footnotesize
+\bl{$lex$}: returns a value
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{Records}
+
+\begin{itemize}
+\item new regex: \bl{$(x:r)$}\hspace{7mm}new value: \bl{$Rec(x,v)$}\medskip\pause
+
+\item \bl{$nullable(x:r) \dn nullable(r)$}
+\item \bl{$der\,c\,(x:r) \dn (x:der\,c\,r)$}
+\item \bl{$mkeps(x:r) \dn Rec(x, mkeps(r))$}
+\item \bl{$inj\,(x:r)\,c\,v \dn Rec(x, inj\,r\,c\,v)$}
+\end{itemize}\bigskip\bigskip\pause
+
+\small
+for extracting subpatterns \bl{$(z: ((x:ab) + (y:ba))$}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[c]
+\frametitle{While Tokens}
+
+\begin{center}
+\begin{tabular}{rcl}
+\pcode{WHILE\_REGS} &amp; $\dn$ &amp; \raisebox{-1mm}{\large(}\pcode{("k" : KEYWORD)} +\\ 
+                  &amp;       &amp; \phantom{(}\pcode{("i" : ID)} +\\ 
+                  &amp;       &amp; \phantom{(}\pcode{("o" : OP)} + \\
+                  &amp;       &amp; \phantom{(}\pcode{("n" : NUM)} + \\
+                  &amp;       &amp; \phantom{(}\pcode{("s" : SEMI)} +\\ 
+                  &amp;       &amp; \phantom{(}\pcode{("p" : (LPAREN + RPAREN))} +\\ 
+                  &amp;       &amp; \phantom{(}\pcode{("b" : (BEGIN + END))} +\\ 
+                  &amp;       &amp; \phantom{(}\pcode{("w" : WHITESPACE)}\raisebox{-1mm}{\large)$^*$}
+\end{tabular}
+\end{center}
+
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
+
 \end{document}
 
 %%% Local Variables:  




</pre></body></html>