You are writing your first website and seem to be making your fair share of simple HTML syntax errors. You have decided to write an HTML parser to help you determine if your HTML code is syntactically correct based on the following condensed HTML definition:
HTML CODE | <HTML>BODY</HTML> |
BODY | <BODY>TEXT</BODY> |
TEXT | STRING |STRING TEXT |TAG |TAG TEXT |
STRING | possibly empty string of printable characters other than '<' and '>') |
TAG | BOLD |ITALICS |LINK |
BOLD | <B>TEXT</B> |
ITALICS | <I>TEXT</I> |
LINK | <A HREF=URL>TEXT</A> |
URL | http://STRING.com |