equal
deleted
inserted
replaced
74 tabsize=2, |
74 tabsize=2, |
75 showspaces=false, |
75 showspaces=false, |
76 showstringspaces=false} |
76 showstringspaces=false} |
77 |
77 |
78 % beamer stuff |
78 % beamer stuff |
79 \renewcommand{\slidecaption}{AFL 01, King's College London, 26.~September 2012} |
79 \renewcommand{\slidecaption}{AFL 01, King's College London, 25.~September 2013} |
80 |
80 |
81 |
81 |
82 \begin{document} |
82 \begin{document} |
83 |
83 |
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
199 \mode<presentation>{ |
199 \mode<presentation>{ |
200 \begin{frame}[c] |
200 \begin{frame}[c] |
201 \frametitle{\begin{tabular}{c}This Course\end{tabular}} |
201 \frametitle{\begin{tabular}{c}This Course\end{tabular}} |
202 |
202 |
203 \begin{itemize} |
203 \begin{itemize} |
204 \item the ultimate goal is to implement a small compiler (really small one)\bigskip |
204 \item the ultimate goal is to implement a small compiler (a really small one for the JVM)\bigskip |
205 \end{itemize} |
205 \end{itemize} |
206 |
206 |
207 Let's start with: |
207 Let's start with: |
208 |
208 |
209 \begin{itemize} |
209 \begin{itemize} |
255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
256 \mode<presentation>{ |
256 \mode<presentation>{ |
257 \begin{frame}[c] |
257 \begin{frame}[c] |
258 \frametitle{\begin{tabular}{c}Scala\end{tabular}} |
258 \frametitle{\begin{tabular}{c}Scala\end{tabular}} |
259 |
259 |
260 \footnotesize a simple Scala function for reading webpages\\[-3mm] |
260 \small a simple Scala function for reading webpages\\[-3mm] |
261 |
261 |
262 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
262 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app0.scala}}}\pause |
263 \texttt{\lstinputlisting{../progs/app0.scala}}}\pause |
263 {\lstset{language=Scala}\texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip |
264 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
264 |
265 \texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip |
265 |
266 |
266 \small slightly more complicated for handling errors properly:\\[-3mm] |
267 |
267 |
268 \footnotesize slightly more complicated for handling errors properly:\\[-3mm] |
268 \small |
269 |
269 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app1.scala}}} |
270 \footnotesize |
|
271 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
|
272 \texttt{\lstinputlisting{../progs/app1.scala}}} |
|
273 |
270 |
274 |
271 |
275 \end{frame}} |
272 \end{frame}} |
276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
277 |
274 |
320 |
317 |
321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
322 \mode<presentation>{ |
319 \mode<presentation>{ |
323 \begin{frame}[c] |
320 \begin{frame}[c] |
324 |
321 |
325 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
322 \small |
326 \texttt{\lstinputlisting{../progs/app2.scala}}}\medskip |
323 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app2.scala}}}\medskip |
327 |
324 |
328 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
325 {\lstset{language=Scala}\texttt{crawl(some\_start\_URL, 2)}}\ |
329 \texttt{crawl(some\_start\_URL, 2)}}\ |
|
330 |
326 |
331 \end{frame}} |
327 \end{frame}} |
332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
333 |
329 |
334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
336 \begin{frame}[c] |
332 \begin{frame}[c] |
337 |
333 |
338 \footnotesize |
334 \footnotesize |
339 a version that only ``crawls'' links in my domain: |
335 a version that only ``crawls'' links in my domain: |
340 |
336 |
341 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
337 \small |
342 \texttt{\lstinputlisting{../progs/app3.scala}}} |
338 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app3.scala}}} |
343 |
339 |
344 |
340 |
345 \end{frame}} |
341 \end{frame}} |
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
342 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
347 |
343 |
350 \begin{frame}[c] |
346 \begin{frame}[c] |
351 |
347 |
352 \footnotesize |
348 \footnotesize |
353 a little email ``harvester'': |
349 a little email ``harvester'': |
354 |
350 |
355 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
351 \small |
356 \texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip |
352 {\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip |
357 |
353 |
358 \tiny |
354 \tiny |
359 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}} |
355 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}} |
360 |
356 |
361 \end{frame}} |
357 \end{frame}} |
449 |
445 |
450 We will have a look at: |
446 We will have a look at: |
451 |
447 |
452 \begin{itemize} |
448 \begin{itemize} |
453 \item regular expressions / regular expression matching |
449 \item regular expressions / regular expression matching |
|
450 \item derivatives |
454 \item automata |
451 \item automata |
455 \item the Myhill-Nerode theorem |
|
456 \item parsing |
452 \item parsing |
457 \item grammars |
453 \item grammars |
458 \item a small interpreter / web browser |
454 \item a small interpreter / compiler |
459 \end{itemize} |
455 \end{itemize} |
460 |
456 |
461 \end{frame}} |
457 \end{frame}} |
462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
463 |
459 |