Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you are to develop and test a utility program, htags that analyses an HTML file and prints of the list of the
In this assignment, you are to develop and test a utility program, htags that analyses an HTML file and prints of the list of the HTML tag names together with the number of occurrences of each tag.
Here is a simple html file:Elements of the file are enclosed with tags describing their purpose tag names There are three forms of tags:
Those that have opening and closing tags of the form tagname
Those that have content tag the form name
Those that have content tag and begin with tag.
Your program should read the file from the standard input the input redirection read the entire file read the entire file into a character array, called here the input array. This input array the only data structure for storing text strings characters your program. The new implementation must not store the tags directly a separate data structure Instead, htags should use pointers stored index table, pointing the first eccurrence each tag identified the input array. A separate array integers should then used keep track the number occurrences each identified tag type. Output from the program should list each tag name, followed the number occurrences, per line. The following would reported for the above:
$ htags hello.html
html
head
meta
title body
Your program must consist of at least TWO functions, with at least one of them compiled and tested separately ie separate source file
The program is to be implemented using pointers ONLY to access array elements. The square brackets and can be used to specify the array dimensions ONLY. In all other cases you must use pointers.
Only one char array, the "input" array, can be used to store the text from the entire input HTML file.
You are not allowed to store the detected tags in a char array: you must use the index table to store pointers to the tags detected in the input char array.
Assume the input file contains less than characters.
Assume there are less than different tag types in the HTML file.
Your program will be marked against a different input file.
The Report
In a few sentences describe the design of your program. Focus on what each of the data structures holds and how each of the functions acts on them.
Show the testing of one of the functions using a test program.
Show the output from running your program on the included HelloWorld.html file.
Show the output from running your program on the included Sample.html file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started