updated draft
authorChristian Urban <christian.urban@kcl.ac.uk>
Wed, 21 Dec 2022 14:33:05 +0000
changeset 905 d8f870aad77d
parent 904 3faf015b7e24
child 906 e7e7fe274f5c
updated
cws/cw04.pdf
cws/cw04.tex
cws/cw05.pdf
cws/cw05.tex
handouts/ho01.pdf
handouts/ho01.tex
progs/fun/fun_llvm.sc
Binary file cws/cw04.pdf has changed
--- a/cws/cw04.tex	Fri Dec 09 13:18:10 2022 +0000
+++ b/cws/cw04.tex	Wed Dec 21 14:33:05 2022 +0000
@@ -91,7 +91,7 @@
 \noindent and
 
 \begin{center}
-  \small\url{http://www.csc.villanova.edu/~tway/courses/csc4181/s2021/labs/lab4/JVM.pdf}
+  \small\url{http://www.csc.villanova.edu/~tway/courses/csc4181/s2022/labs/finalproject/JVM.pdf}
 \end{center}
 
 \subsection*{Krakatau Assembler}
@@ -204,7 +204,7 @@
 i := 2;
 while (i <= 4) do {
     write i;
-    i := i + 1;
+    i := i + 1
 }
 \end{lstlisting}
 \end{minipage}
Binary file cws/cw05.pdf has changed
--- a/cws/cw05.tex	Fri Dec 09 13:18:10 2022 +0000
+++ b/cws/cw05.tex	Wed Dec 21 14:33:05 2022 +0000
@@ -65,11 +65,11 @@
 on my end. You will be marked according to the input files
 
 \begin{itemize}
-\item\href{https://talisker.nms.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/cwtests/cw05/sqr.fun}{sqr.fun}  
-\item\href{https://talisker.nms.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/cwtests/cw05/fact.fun}{fact.fun}
-\item\href{https://talisker.nms.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/cwtests/cw05/mand.fun}{mand.fun}
-\item\href{https://talisker.nms.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/cwtests/cw05/mand2.fun}{mand2.fun}
-\item\href{https://talisker.nms.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/cwtests/cw05/hanoi.fun}{hanoi.fun}    
+\item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/sqr.fun}{sqr.fun}  
+\item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/fact.fun}{fact.fun}
+\item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand.fun}{mand.fun}
+\item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/mand2.fun}{mand2.fun}
+\item\href{https://nms.kcl.ac.uk/christian.urban/cfl/progs/hanoi.fun}{hanoi.fun}    
 \end{itemize}  
 
 \noindent
Binary file handouts/ho01.pdf has changed
--- a/handouts/ho01.tex	Fri Dec 09 13:18:10 2022 +0000
+++ b/handouts/ho01.tex	Wed Dec 21 14:33:05 2022 +0000
@@ -46,8 +46,6 @@
 
 \section*{Handout 1}
 
-$\neq$
-
 The purpose of a compiler is to transform a program a human can read and
 write into code machines can run as fast as possible. Developing a
 compiler is an old craft going back to 1952 with the first compiler
--- a/progs/fun/fun_llvm.sc	Fri Dec 09 13:18:10 2022 +0000
+++ b/progs/fun/fun_llvm.sc	Wed Dec 21 14:33:05 2022 +0000
@@ -113,6 +113,14 @@
 def CPSi(e: Exp) = CPS(e)(KReturn)
 
 //some testcases:
+// (1 + 2) * 3
+println(CPSi(Aop("*", Aop("+", Num(1), Num(2)), Num(3))).toString)
+
+// 3 * (1 + 2)
+println(CPSi(Aop("*", Num(3), Aop("+", Num(1), Num(2)))).toString)
+
+//some testcases:
+
 // numbers and vars   
 println(CPSi(Num(1)).toString)
 println(CPSi(Var("z")).toString)