CSCI-250 Assignment Two
Due Date
19 March 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.
Use e-mail to submit 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 and YACC, you will produce a program which will extract links from
HTML input to create an HTML output in tabular form.
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.
Output
You will produce HTML source containing a table. Each line in the
table will correspond to one link from the input, and its left and right
cells will display the link's text and its address, respectively.
Both of these cells will themselves be links to the location they describe.
The attached
example input and
example output show specifically how
the output will be formatted. By viewing their source, you should see
exactly how your application might transform input HTML into the output.
Direct your output 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 within the output HTML source between each column and
row in your table(Use "\n" in your printf's.)
You will allow no extraneous output.