CSCI-250 Assignment One
Due Date
13 February 1996, 2pm
Possible points will be reduced by 25% of full credit each day beyond the due date.
Turn In
You will turn in a soft-copy of your program source, including a Makefile.
I will compile and test your program on a Hewlett Packard 700-series workstation under HP-UX. For further information on Makefiles, see the
Lex and Yacc Examples Handout.
You may either turn in your program on floppy disk or through e-mail. Each
method has specific requirements:
Floppy
Floppy disks should be MS-DOS formatted.
E-Mail
If you e-mail your project, use a PKZIP-compliant archiver to compress your
files. (For example, the "zip" command on the CSCI HP systems.) Then
uuencode and mail the result.
Test Your Submission
Two points will be deducted for each submission that
is either unreadable or in the wrong format.
Description
Using Lex, you will produce a program which will extract links from
HTML input to create an HTML output.
Input
HTML links are composed as follows:
|
< | A HREF | = | [referenced location] | >
| [explanatory text] | < | /A>
|
You may assume:
- Reserved words such as "A" and "HREF" will be in capital letters.
- No line breaks will occur during the reference.
Output
You will produce HTML source containing only the links from the input.
This output will be directed to stdout (standard destination for a
printf). Specifically, your output should contain the following:
- The "Begin HTML" and "End HTML" marks as the first and last lines of
the file respectively. They are constructed as:
| < | HTML | > | , and
|
| < | /HTML | > | , respectively.
|
- Line breaks between each link in your HTML source (Use "\n" in your
printf's.)
- Paragraph breaks between links when your HTML source is displayed
using an HTML viewer. The HTML directive to cause this is constructed as:
You will allow no extraneous output.