equal
deleted
inserted
replaced
170 |
170 |
171 Extend your lexer from Q2 to also simplify regular expressions |
171 Extend your lexer from Q2 to also simplify regular expressions |
172 after each derivation step and rectify the computed values after each |
172 after each derivation step and rectify the computed values after each |
173 injection. Use this lexer to tokenize the programs in |
173 injection. Use this lexer to tokenize the programs in |
174 Figure~\ref{fib} and \ref{loop}. Give the tokens of these |
174 Figure~\ref{fib} and \ref{loop}. Give the tokens of these |
175 programs where whitespaces are filtered out. |
175 programs where whitespaces are filtered out.\bigskip |
176 |
176 |
177 |
177 |
178 \begin{figure}[p] |
178 \begin{figure}[h] |
179 \mbox{\lstinputlisting[language=while]{../progs/fib.while}} |
179 \mbox{\lstinputlisting[language=While,xleftmargin=10mm]{../progs/fib.while}} |
180 \caption{Fibonacci program in the WHILE language.\label{fib}} |
180 \caption{Fibonacci program in the WHILE language.\label{fib}} |
181 \end{figure} |
181 \end{figure} |
182 |
182 |
183 \begin{figure}[p] |
183 \begin{figure}[h] |
184 \mbox{\lstinputlisting[language=while]{../progs/loops.while}} |
184 \mbox{\lstinputlisting[language=While,xleftmargin=10mm]{../progs/loops.while}} |
185 \caption{The three-nested-loops program in the WHILE language. |
185 \caption{The three-nested-loops program in the WHILE language. |
186 Usually used for timing measurements.\label{loop}} |
186 (Usually used for timing measurements.)\label{loop}} |
187 \end{figure} |
187 \end{figure} |
188 |
188 |
189 \end{document} |
189 \end{document} |
190 |
190 |
191 %%% Local Variables: |
191 %%% Local Variables: |