Stacks, classes, HTML tags, and parsing.
Well, let me describe the assignment:
You are given a basic HTML file and must create a program that will parse the file and check for:
Proper tag nesting
A class for the stack and html tags must be used. The interface and implementation for the stack and html tag classes must be in different files (for a total of 5 files, a main.cpp, stack.cpp, stack.h, htmltag.cpp, htmltag.h).
Included in the post is my uncompleted code as I get wierd errors and am probably doing something wrong in general. I also need to figure out to make it work fully and support more tags.
Any help you can provide would be appreciated as I need to have the assignment in by 10:10 AM tomorrow morning.
Thanks to everyone who helps ^_^
uhm, you did read the FAQ right, no giving answers for homework is one of the rules.
I don't want a direct answer containing code, just conceptual suggestions. Obviously I am missing something, and just need a little push in the right direction.
This place was so helpful when I did my first assignment, but now it's like "don't help, he won't learn anything." I realize that I need to do this myself, but since I don't have anyone else from my class around to help me figure out what to do, I thought I could ask here. And I do learn from other code, but I haven't found anything that will help me.
Members don't like non-specific questions like you've posted. If you're having a problem, post a specific question and the code involved. You're unlikely to get many responses from "Please look over all of my code from several different files and fix it all for me."
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
Sorry, don't have time to look at your code. I would ask, is your Stack class working with a simple sample? How about your reading and writing of files? Have you figured out how to read in the next HTML token? Have you figured out how to verify that a token is valid? Each of these seem to be logical steps to me, so maybe you can shed light on which one you are having trouble with.
My stack class works perfectly on simple examples.
I'll take those questions into consideration when I re-write my main.cpp and see what happens.