Individual homework
#1 - #4 should be done and
turned in individually, not as a group.
- Define a comprehensive regular expression for Java-style or C-style floating point constants.
The following are valid numbers (just examples, not an exhaustive collection):
56
+234.775
.45
-76.
345E+5
3.5e-2
Use symbols, otherwise things will turn out pretty ugly pretty soon
(even though in the beginning they look pretty pretty). Good decomposition works
everywhere, and regular exceptions are no expression. Or vice versa.
Click here to see a solution.
- Define a regular expression for calendaristic dates. Choose some reasonable format, and try to reject erroneus dates. Specify what "loopholes" your system has
(what invalid dates pass through).
- ASU 3.16cd
- ASU 3.17 (for 3.16cd only) Be sure to use Algorithm 3.2.
Project
If you have formed a group, the following may be done by your group;
turn in only one solution per group.
To form a group, send email to our TA, stavan at cs, giving the
names and unix login of each group member. Two persons per group are strongly recommended.
- First, copy and build the base pl/0 compiler,
using the directions
here.
Test it on the sample program
here.
-
Write, compile, and run a PL/0 program that gets integers separated with spaces, then last of which
is zero, then outputs them in reverse order.
-
Read the compiler code and turn in a textual description of its design. Imagine you need to explain
the program to a colleague to bring him or her up to speed with extending the compiler.
The description should include the principal types and hierarchies, how objects work together, what
important conventions are used throughout.
|
 |
Department of Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA 98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to
cse401-webmaster at cs.washington.edu]
|