Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*To be written in C Language* Develop and test a utility program for examining the HTML tags in HTML files, called FindTags. The program inputs

*To be written in C Language*

Develop and test a utility program for examining the HTML tags in HTML files, called FindTags. The program inputs and analyses an HTML file(given below) and prints of the list of the HTML tags names together with the number of occurrences of each tag . Use the following simplified definition of the HTML tag names:

The tag name starts immediately after the < character, and consists of one or more non blanc characters other than / and is terminated by either the space character or by the > character. For example, in the sample excerpt of the html file:

CS 2263

Assignment 1

we find the body and div tags occurring only once, and the p, b and span tags occurring twice each. Note that /span, /b and /p are not counted as tags.

The utility program FindTags should read the HTML file specified as the command line parameter, for example to run your program on A3.htm(where A3.htm is the html file) use:

$ ./FindTags A3.htm

The program should read the entire HTML file into a character array, called here the input array. This input array is the only data structure for storing text, i.e. strings of characters, in your program. The implementation must not store the HTML tags directly in a separate data structure (array). Instead, FindTags program should use pointers stored in the index table, pointing to the first occurrence of each tag identified in the input array. A separate (parallel) array of integers should then be used to keep track of the number of occurrences of each identified tag type. Here are the requirements for the implementation of FindTags program :-

1) Read the file specified as the command line parameter and output the count for each HTML tag detected.

2) Your program must consist of at least TWO programming modules, with at least one of them compiled and tested separately.

3) The FindTags 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.

4) Only one char array, the input array, can be used to store the text from the entire input HTML file.

5) 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.

6) Assume the input file contains less than 100000 characters. (For example - char inputarray[100000];)

7) Assume there are less than 100 different tag types in the HTML file.

The above program should be developed in C language only.

Save and use this HTML file:

CS 2263

Assignment 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Understand employee mentoring

Answered: 1 week ago

Question

Appreciate the importance of new-employee orientation

Answered: 1 week ago