diff -r 60608e227478 -r fa98dbaeb384 slides/slides01.tex --- a/slides/slides01.tex Wed Sep 25 23:56:36 2019 +0100 +++ b/slides/slides01.tex Thu Sep 26 10:59:52 2019 +0100 @@ -428,7 +428,50 @@ \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c] +\frametitle{Remember BF***?} +\begin{center} +\begin{tabular}{lcl} +\bl{\texttt{>}} & $\Rightarrow$ & move one cell right\\ +\bl{\texttt{<}} & $\Rightarrow$ & move one cell left\\ +\bl{\texttt{+}} & $\Rightarrow$ & increase cell by one\\ +\bl{\texttt{-}} & $\Rightarrow$ & decrease cell by one\\ +\bl{\texttt{.}} & $\Rightarrow$ & print current cell\\ +\bl{\texttt{,}} & $\Rightarrow$ & input current cell\\ +\bl{\texttt{[}} & $\Rightarrow$ & loop begin\\ +\bl{\texttt{]}} & $\Rightarrow$ & loop end\medskip\\ + & $\Rightarrow$ & everything else is a comment\\ +\end{tabular} +\end{center} + +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c] + \frametitle{A Compiler for BF***} + + \begin{center} + \begin{tabular}{lcl} + \bl{\texttt{>}} & $\Rightarrow$ & \texttt{ptr++}\\ + \bl{\texttt{<}} & $\Rightarrow$ & \texttt{ptr--}\\ + \bl{\texttt{+}} & $\Rightarrow$ & \texttt{(*ptr)++}\\ + \bl{\texttt{-}} & $\Rightarrow$ & \texttt{(*ptr)--}\\ + \bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\ + \bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\ + \bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\ + \bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\ + & $\Rightarrow$ & ignore everything else\\ + \end{tabular} + \end{center}\bigskip + + \texttt{char field[30000]\\ char *ptr = &field[15000]} + +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] @@ -628,26 +671,26 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{frame}[c] -\frametitle{Finding Operations in Scala} - -{\bf\code{rexp.findAllIn(string)}}\medskip - -returns a list of all (sub)strings that match the -regular expression -\bigskip\bigskip - - -{\bf\code{rexp.findFirstIn(string)}}\medskip - -returns either - -\begin{itemize} -\item \code{None} if no (sub)string matches or -\item \code{Some(s)} with the first (sub)string -\end{itemize} - -\end{frame} +%\begin{frame}[c] +%\frametitle{Finding Operations in Scala} +% +%{\bf\code{rexp.findAllIn(string)}}\medskip +% +%returns a list of all (sub)strings that match the +%regular expression +%\bigskip\bigskip +% +% +%{\bf\code{rexp.findFirstIn(string)}}\medskip +% +%returns either +% +%\begin{itemize} +%\item \code{None} if no (sub)string matches or +%\item \code{Some(s)} with the first (sub)string +%\end{itemize} +% +%\end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%