# HG changeset patch # User Christian Urban # Date 1761973163 0 # Node ID 5990e03b2ba82dfa43021b5de791e4792f24d799 # Parent 36799f7b9702a21800549d93f1570236580363cd updated diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho01.pdf Binary file handouts/ho01.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho02.pdf Binary file handouts/ho02.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho03.pdf Binary file handouts/ho03.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho04.pdf Binary file handouts/ho04.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho04.tex --- a/handouts/ho04.tex Fri Oct 31 19:26:11 2025 +0000 +++ b/handouts/ho04.tex Sat Nov 01 04:59:23 2025 +0000 @@ -6,7 +6,7 @@ \usepackage{skull} \begin{document} -\fnote{\copyright{} Christian Urban, King's College London, 2014, 2015, 2016, 2017, 2019} +\fnote{\copyright{} Christian Urban, King's College London, 2014, 2015, 2016, 2017, 2019, 2025} \section*{Handout 4 (Sulzmann \& Lu Algorithm)} diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho05.pdf Binary file handouts/ho05.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 handouts/ho05.tex --- a/handouts/ho05.tex Fri Oct 31 19:26:11 2025 +0000 +++ b/handouts/ho05.tex Sat Nov 01 04:59:23 2025 +0000 @@ -22,6 +22,7 @@ % https://www.oilshell.org/blog/2017/03/31.html \begin{document} +\fnote{\copyright{} Christian Urban, King's College London, 2023, 2025} \section*{Handout 5 (Grammars \& Parser)} diff -r 36799f7b9702 -r 5990e03b2ba8 slides/slides06.pdf Binary file slides/slides06.pdf has changed diff -r 36799f7b9702 -r 5990e03b2ba8 slides/slides06.tex --- a/slides/slides06.tex Fri Oct 31 19:26:11 2025 +0000 +++ b/slides/slides06.tex Sat Nov 01 04:59:23 2025 +0000 @@ -61,28 +61,61 @@ \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{frame}[t,fragile] -\begin{mybox3}{} - In CW2, be careful with the order of defining regular expressions: +\begin{minipage}{1.1\textwidth} + \begin{mybox3}{} + Why the hell did we bother for 4 long weeks with a worse-than-cubic + lexing algorithm for regular expressions, given the CYK-algorithm + can decide in cubic time whether a string is matched by a context + free grammar? Is the lecturer insane? + \end{mybox3} +\end{minipage}\bigskip -\begin{verbatim} -val COMMENT : Rexp = ... ~ EOL -val EOL : Rexp = "\r\n" | "\n" -\end{verbatim} -\end{mybox3} +\begin{itemize} +\item Yes, if we are only after string matching. But we are after lexing where + we need POSIX matching + and calculate POSIX values. You cannot do this with any of the CFG-algorithms. +\item Also it is not so easy to include extended regular expressions like $\sim{}r$ +and $r^{\{n\}}$. +\end{itemize} +\end{frame} + +\begin{frame}[t,fragile] +\begin{minipage}{1.1\textwidth} + \begin{mybox3}{} + Why the hell did we bother for 4 long weeks with a lexing algorithm + generating tokens, given the lecturer explains the parsing algorithm using + strings as input? Has the lecturer gone insane? + \end{mybox3} +\end{minipage}\bigskip + \end{frame} -\begin{frame}[t,fragile] -\begin{mybox3}{} - In CW2, what is the derivative of RECD? - -\begin{center} -\bl{$der\;c\;RECD(l, r) \;\;\dn\;\; ???$} -\end{center} -\end{mybox3} -\end{frame} - +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\begin{frame}[t,fragile] +%\begin{mybox3}{} +% In CW2, be careful with the order of defining regular expressions: +% +%\begin{verbatim} +%val COMMENT : Rexp = ... ~ EOL +%val EOL : Rexp = "\r\n" | "\n" +%\end{verbatim} +%\end{mybox3} +%\end{frame} +% +% +%\begin{frame}[t,fragile] +%\begin{mybox3}{} +% In CW2, what is the derivative of RECD? +% +%\begin{center} +%\bl{$der\;c\;RECD(l, r) \;\;\dn\;\; ???$} +%\end{center} +%\end{mybox3} +%\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%