Binary file handouts/ho04.pdf has changed
--- a/handouts/ho04.tex Mon Oct 26 10:27:01 2020 +0000
+++ b/handouts/ho04.tex Tue Oct 27 13:46:01 2020 +0000
@@ -864,7 +864,7 @@
\[
(name: [a\mbox{-}z0\mbox{-}9\_\!\_\,.-]^+)\cdot @\cdot
-(domain: [a\mbox{-}z0\mbox{-}9\,.-]^+)\cdot .\cdot
+(domain: [a\mbox{-}z0\mbox{-}9\,-]^+)\cdot .\cdot
(top\_level: [a\mbox{-}z\,.]^{\{2,6\}})
\]
--- a/progs/lexer/lexer.sc Mon Oct 26 10:27:01 2020 +0000
+++ b/progs/lexer/lexer.sc Tue Oct 27 13:46:01 2020 +0000
@@ -303,4 +303,22 @@
@doc("All tests.")
@main
-def all() = { small(); fib() ; loops() }
\ No newline at end of file
+def all() = { small(); fib() ; loops() }
+
+
+val SYM1 = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz_.-")
+val NAME = RECD("name", PLUS(SYM1))
+
+val SYM2 = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-")
+val DOMAIN = RECD("domain", PLUS(SYM2))
+
+val RE = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz.")
+val TOPLEVEL = RECD("tl", (RE ~ RE) |
+ (RE ~ RE ~ RE) |
+ (RE ~ RE ~ RE ~ RE) |
+ (RE ~ RE ~ RE ~ RE ~ RE) |
+ (RE ~ RE ~ RE ~ RE ~ RE ~ RE))
+
+val EMAIL = NAME ~ "@" ~ DOMAIN ~ "." ~ TOPLEVEL
+
+println(lexing_simp(EMAIL, "christian.urban@kcl.ac.uk"))
Binary file slides/slides04.pdf has changed
--- a/slides/slides04.tex Mon Oct 26 10:27:01 2020 +0000
+++ b/slides/slides04.tex Tue Oct 27 13:46:01 2020 +0000
@@ -862,7 +862,7 @@
\end{tikzpicture}
\end{center}
-\small
+\small\pause
\hspace{4.5cm}\bl{$(\ZERO \cdot (b \cdot c)) + ((\ZERO \cdot c) + \ONE)$}
$\mapsto$
\bl{$\ONE$}
--- a/slides/slides05.tex Mon Oct 26 10:27:01 2020 +0000
+++ b/slides/slides05.tex Tue Oct 27 13:46:01 2020 +0000
@@ -179,7 +179,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[c]
-\frametitle{CF Grammars}
+\frametitle{CFGs}
A \alert{\bf context-free grammar} \bl{$G$} consists of