7 \definecolor{pansypurple}{rgb}{0.47, 0.09, 0.29} |
7 \definecolor{pansypurple}{rgb}{0.47, 0.09, 0.29} |
8 |
8 |
9 \begin{document} |
9 \begin{document} |
10 |
10 |
11 |
11 |
12 \color{pansypurple} |
12 %\color{pansypurple} |
13 \section*{RESIT / REPLACEMENT} |
13 %\section*{RESIT / REPLACEMENT} |
14 |
14 |
15 {\bf |
15 %{\bf |
16 The resit / replacement task is essentially CW5 (listed below) with |
16 %The resit / replacement task is essentially CW5 (listed below) with |
17 the exception that the lexer and parser is already provided. The |
17 %the exception that the lexer and parser is already provided. The |
18 parser will generate an AST (see file \texttt{fun\_llvm.sc}). Your task |
18 %parser will generate an AST (see file \texttt{fun\_llvm.sc}). Your task |
19 is to generate an AST for the K-intermediate language and supply |
19 %is to generate an AST for the K-intermediate language and supply |
20 sufficient type annotations such that you can generate valid code for |
20 %sufficient type annotations such that you can generate valid code for |
21 the LLVM-IR. The submission deadline is 4th August at 16:00. At the |
21 %the LLVM-IR. The submission deadline is 4th August at 16:00. At the |
22 deadline, please send me an email containing a zip-file with your |
22 %deadline, please send me an email containing a zip-file with your |
23 files. |
23 %files. |
24 Feel free to reuse the files I have uploaded on KEATS (especially |
24 %Feel free to reuse the files I have uploaded on KEATS (especially |
25 the files generating simple LLVM-IR code). Of help might also be the |
25 %the files generating simple LLVM-IR code). Of help might also be the |
26 videos of Week~10.\bigskip |
26 %videos of Week~10.\bigskip |
27 |
27 % |
28 \noindent |
28 %\noindent |
29 Good Luck!}\smallskip\\ |
29 %Good Luck!}\smallskip\\ |
30 \noindent |
30 %\noindent |
31 Christian |
31 %Christian |
32 \color{black} |
32 %\color{black} |
33 |
33 |
34 |
34 |
35 \section*{Coursework 5} |
35 \section*{Coursework 5} |
36 |
36 |
37 |
37 |
38 |
38 |
39 \noindent This coursework is worth 25\% and is due on \cwFIVE{} at |
39 \noindent This coursework is worth 25\% and is due on \cwFIVE{} at |
40 16:00. You are asked to implement a compiler targeting the LLVM-IR. |
40 16:00. You are asked to implement a compiler targeting the LLVM-IR. |
41 Be careful that this CW needs some material about the LLVM-IR |
41 Be careful that this CW needs some material about the LLVM-IR |
42 that has not been shown in the lectures and your own experiments |
42 that has not been shown in the lectures and your own experiments |
43 might be required. You can find information about the LLVM-IR at |
43 and research might be required. You can find information about the LLVM-IR at |
44 |
44 |
45 \begin{itemize} |
45 \begin{itemize} |
46 \item \url{https://bit.ly/3rheZYr} |
46 \item \url{https://bit.ly/3rheZYr} |
47 \item \url{https://llvm.org/docs/LangRef.html} |
47 \item \url{https://llvm.org/docs/LangRef.html} |
48 \end{itemize} |
48 \end{itemize} |
54 awarded. You are asked to submit the code of your compiler, but also |
54 awarded. You are asked to submit the code of your compiler, but also |
55 the generated \texttt{.ll} files. No PDF is needed for this |
55 the generated \texttt{.ll} files. No PDF is needed for this |
56 coursework. You should use the lexer and parser from the previous |
56 coursework. You should use the lexer and parser from the previous |
57 courseworks, but you need to make some modifications to them for the |
57 courseworks, but you need to make some modifications to them for the |
58 `typed' version of the Fun-language. I will award up to 5\% if a lexer |
58 `typed' version of the Fun-language. I will award up to 5\% if a lexer |
59 and a parser are correctly implemented. At the end, please package |
59 and a parser are correctly implemented. |
60 everything(!) in a zip-file that creates a directory with the name |
60 |
61 |
61 %At the end, please package |
62 \begin{center} |
62 %everything(!) in a zip-file that creates a directory with the name |
63 \texttt{YournameYourFamilyname} |
63 % |
64 \end{center} |
64 %\begin{center} |
65 |
65 %\texttt{YournameYourFamilyname} |
66 \noindent |
66 %\end{center} |
67 on my end. You will be marked according to the input files |
67 % |
|
68 %\noindent |
|
69 %on my end. |
|
70 You will be marked according to the input files |
68 |
71 |
69 \begin{itemize} |
72 \begin{itemize} |
70 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/sqr.fun}{sqr.fun} |
73 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/sqr.fun}{sqr.fun} |
71 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/fact.fun}{fact.fun} |
74 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/fact.fun}{fact.fun} |
72 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand.fun}{mand.fun} |
75 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand.fun}{mand.fun} |
73 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand2.fun}{mand2.fun} |
76 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand2.fun}{mand2.fun} |
74 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/hanoi.fun}{hanoi.fun} |
77 \item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/hanoi.fun}{hanoi.fun} |
75 \end{itemize} |
78 \end{itemize} |
76 |
79 |
77 \noindent |
80 \noindent |
78 which are uploaded to KEATS. |
81 which are uploaded to KEATS and Github. |
79 |
82 |
80 \subsection*{Disclaimer\alert} |
83 \subsection*{Disclaimer\alert} |
81 |
84 |
82 It should be understood that the work you submit represents your own |
85 It should be understood that the work you submit represents your own |
83 effort. You have not copied from anyone else. An exception is the |
86 effort. You have not copied from anyone else. An exception is the |