added break draft
authorChristian Urban <christian.urban@kcl.ac.uk>
Fri, 02 Jun 2023 15:58:57 +0100
changeset 910 926d73d76989
parent 909 a29d74fb8697
child 911 81aec858dca4
added break
cws/cw04.pdf
cws/cw04.tex
Binary file cws/cw04.pdf has changed
--- a/cws/cw04.tex	Tue May 30 16:58:06 2023 +0100
+++ b/cws/cw04.tex	Fri Jun 02 15:58:57 2023 +0100
@@ -233,6 +233,17 @@
 Explain your decision and indicate what this program would
 print out.
 
+\subsection*{Question 4 (Advanced)}
+
+Extend the lexer and parser in order to add a \texttt{break} keyword.
+Modify the compiler such that when a \texttt{break} is encountered the
+code should jump out of the ``enclosing'' while loop, or in case it
+is not inside a while loop to the end of the
+program.
+
+\bigskip\noindent
+\textcolor{red}{ADD EXAMPLE PROGRAMS}
+
 \subsection*{Further Information}
 
 The Java infrastructure unfortunately does not contain an