author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Sat, 23 Nov 2013 11:16:35 +0000 | |
changeset 203 | f1335c171d50 |
parent 202 | 180cbfc1520a |
child 204 | fec99c437965 |
permissions | -rw-r--r-- |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass{article} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
\usepackage{charter} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage{hyperref} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage{amssymb} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
\usepackage{amsmath} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usepackage{listings} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
\usepackage{xcolor} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
\begin{document} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
\definecolor{javared}{rgb}{0.6,0,0} % for strings |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\lstdefinelanguage{scala}{ |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
morekeywords={abstract,case,catch,class,def,% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
do,else,extends,false,final,finally,% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
21 |
for,if,implicit,import,match,mixin,% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
22 |
new,null,object,override,package,% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
private,protected,requires,return,sealed,% |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
24 |
super,this,throw,trait,true,try, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
type,val,var,while,with,yield}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
26 |
otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
27 |
sensitive=true, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
28 |
morecomment=[l]{//}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
29 |
morecomment=[n]{/*}{*/}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
30 |
morestring=[b]", |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
31 |
morestring=[b]', |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
32 |
morestring=[b]""" |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
33 |
} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
34 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
35 |
\lstdefinelanguage{while}{ |
203
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
36 |
morekeywords={while, if, then. else, read, write, for, upto, do}, |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
37 |
otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
38 |
sensitive=true, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
39 |
morecomment=[l]{//}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
40 |
morecomment=[n]{/*}{*/}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
41 |
morestring=[b]", |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
42 |
morestring=[b]', |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
morestring=[b]""" |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
\lstset{language=Scala, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
basicstyle=\ttfamily, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
keywordstyle=\color{javapurple}\bfseries, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
stringstyle=\color{javagreen}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
commentstyle=\color{javagreen}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
52 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
numbers=left, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
numberstyle=\tiny\color{black}, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
stepnumber=1, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
numbersep=10pt, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
tabsize=2, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
showspaces=false, |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
59 |
showstringspaces=false} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
61 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
\section*{Coursework 3} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
\noindent |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
This coursework is worth 4\% and is due on 13 December at 16:00. You are asked to |
201
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
67 |
implement a compiler for the WHILE language which targets the |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
68 |
assembler language provided by the Jasmin. This assembler |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
69 |
is available from |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
70 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
71 |
\begin{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
72 |
\url{http://jasmin.sourceforge.net} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
73 |
\end{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
74 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
75 |
\noindent |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
76 |
There is a user guide for Jasmin |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
77 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
78 |
\begin{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
79 |
\url{http://jasmin.sourceforge.net/guide.html} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
80 |
\end{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
81 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
82 |
\noindent |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
83 |
and also a description of some of the instructions that the JVM understands |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
84 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
85 |
\begin{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
86 |
\url{http://jasmin.sourceforge.net/instructions.html} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
87 |
\end{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
88 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
89 |
\noindent |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
90 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
91 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
92 |
\noindent |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
93 |
You need to submit a document containing the answers for the questions |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
94 |
below. You can do the implementation in any programming language you like, but you need |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
95 |
to submit the source code with which you answered the questions. However, the coursework |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
96 |
will \emph{only} be judged according to the answers. You can submit your answers |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
97 |
in a txt-file or as pdf.\bigskip |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
98 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
99 |
|
202
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
100 |
\subsection*{Question 1 (marked with 2\%)} |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
101 |
|
201
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
102 |
You need to lex and parse WHILE programs and submit the assembler |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
103 |
instructions for the Fibonacci program and for the program you submitted |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
104 |
in Coursework 2 in Question 3. The latter should be so modified that |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
105 |
a user can input the upper bound on the console (in the original question |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
106 |
it was fixed to 100). |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
107 |
|
201
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
108 |
\subsection*{Question 2 (marked with 2\%)} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
109 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
110 |
Extend the syntax of you language so that it contains also \texttt{for}-loops, like |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
111 |
|
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
112 |
\begin{center} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
113 |
\texttt{for} \;\textit{Id} \texttt{:=} \textit{AExp}\; \texttt{upto} \;\textit{AExp}\; \texttt{do} \textit{Block} |
c813506e0ee8
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
200
diff
changeset
|
114 |
\end{center} |
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
115 |
|
202
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
116 |
\noindent |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
117 |
The intended meaning is to first assign the variable \textit{Id} the value of the first arithmetic |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
118 |
expression, then go through the loop, at the end increase the value of the variable by 1, |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
119 |
and finally test wether the value is not less or equal anymore to the value of the second |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
120 |
arithmetic expression. For example the following instance of a \texttt{for}-loop |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
121 |
is supposed to print out the numbers \texttt{2}, \texttt{3}, \texttt{4}. |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
122 |
|
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
123 |
|
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
124 |
\begin{center} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
125 |
\begin{minipage}{6cm} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
126 |
\begin{lstlisting}[language=While,basicstyle=\ttfamily, numbers=none] |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
127 |
for i := 2 upto 4 do { |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
128 |
write i |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
129 |
} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
130 |
\end{lstlisting} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
131 |
\end{minipage} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
132 |
\end{center} |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
133 |
|
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
134 |
\noindent |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
135 |
There are two ways how this can be implemented: one is to adapt the code generation |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
136 |
part of the compiler and generate specific code for \texttt{for}-loops; the other is to |
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
137 |
translate the abstract syntax tree of \texttt{for}-loops into an abstract syntax tree using |
203
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
138 |
existing language constructs. For example the loop above could be translated |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
139 |
to the following \texttt{while}-loop: |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
140 |
|
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
141 |
\begin{center} |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
142 |
\begin{minipage}{6cm} |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
143 |
\begin{lstlisting}[language=While,basicstyle=\ttfamily, numbers=none] |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
144 |
i := 2; |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
145 |
while (i <= 4) do { |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
146 |
write i; |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
147 |
i := i + 1; |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
148 |
} |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
149 |
\end{lstlisting} |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
150 |
\end{minipage} |
f1335c171d50
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
151 |
\end{center} |
202
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
152 |
|
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
153 |
|
180cbfc1520a
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
201
diff
changeset
|
154 |
|
200
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
155 |
\end{document} |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
156 |
|
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
157 |
%%% Local Variables: |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
158 |
%%% mode: latex |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
159 |
%%% TeX-master: t |
7415871b1ef5
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
160 |
%%% End: |