CSC 7000-002 Algorithms & Programming
Fall 1999, Mendel 115
Dr. David Matuszek
The idea of this assignment is to prepare a C program so that it looks good on the Web. The purpose of this assignment is to give you practice with strings and file I/O.
Documents for the Web are written in HTML (HyperText Markup Language). HTML uses
tags, enclosed in angle brackets, to tell your browser how to format things. For
example, <b>enclosed text</b> causes the enclosed text to be made
bold. The entire document should be enclosed in assorted other tags, as follows:
<html>(your name goes here)
<head>
<title>Syntax coloring assignment by</title>Your document (C program) goes here.
</head>
<body>
<pre>
</pre>
</body>
</html>
Many modern program editors use syntax coloring: keywords, strings, and comments are set off by putting them in different colors. Your job is to write a program to do very simple syntax "coloring":
<b> ... </b> tags to
make all the keywords bold..c in the file name
with .html; e.g. if your input file is sample.c, your output
file should be sample.html.Since HTML uses the characters < (less than), >
(greater than), and & (ampersand) for its own purposes, you will have to
replace these in the C program you are processing with < >
and & respectively.
#define commands for your tags, so that you can change tags easily.For extra credit, use <i> ... </i> (italic) tags
around quoted strings, and do not embolden any keywords that might occur in those
strings, e.g. "Not for sale."
When you have your program running, apply it to itself. Print the result out
(from Netscape or Internet Explorer) and hand it in.