• You may assume that you will only see the following HTML tags:
    singletons:
       <br>
       <li>
       <!-->
       <hr>
    
    opener/closer pairs:
       <html> ... </html>
       <head> ... </head>
       <title> ... </title>
       <body> ... </body>
       <center> ... </center>
       <h1> ... </h1>
       <h2> ... </h2>
       <h3> ... </h3>
       <h4> ... </h4>
       <b> ... </b>
       <i> ... </i>
       <pre> ... </pre>
       <code> ... </code>
       <sup> ... </sup>
       <sub> ... </sub>
       <p> ... </p>
       <a ... "filename"> ... </a>
       <ul> ... </ul>
       <ol> ... </ol>
       <dl> ... </dl>
       <dd> ... </dd>
       <dt> ... </dt>
       <table> ... </table>
       <tr> ... </tr>
       <td> ... </td>
       <th> ... </th>
    

  • Those of you familiar with HTML may think of the <p> tag as being a singleton. Although it is often used this way, it does have a closer form as well, and all examples provided to the class will have the opener and closer.

  • You should assume that each tag may have additional arguments that come after the name of the tag (given above) but before the closing >. These can be ignored for every tag other than the anchor (<a href = "filename">) tag, from which you need to extract the filename.

  • You may assume that all tags are well-formed. For example, there will never be a tag with < and no >; anchor tags will always have a filename in double quotes; etc. The only error that may occur is that tags are not properly nested.

  • For simplicity, you may use fixed-sized arrays to store things, just make sure to pick a size that seems like it will be large enough for common cases. For example, if you are using an array implementation of a List, Stack, or Queue, you may use a non-resizing implementation if you like -- just be sure to use a size that's big enough (you'll have to decide what "big enough" is for each one you use). You may also assume that all filenames and tags are a fixed size in order to avoid dynamically allocating character arrays.