CS127: Data Structures, Fall 2000

Project 2: Web Page Navigation with Stacks

Overview

This project will be your chance to write a new web browser to take the market by storm! You'll write Minibrowse, a small part of a web browser. Specifically, you will write the navigation piece, which handles the "back" and "forward" buttons as well as keeps track of which web pages the user is viewing. Furthermore, this will be a Multi-Document Interface (MDI): the user can have up to five browser windows open simultaneously, and switch back and forth between them.

Using text commands to navigate in Minibrowse

All input to the browser will be via standard input. If a user enters minibrowse at a UNIX prompt, then the user should be able to enter commands at the keyboard. Alternatively, the user can have the commands already present in a flat file, and enter minibrowse < filename at the UNIX prompt to process all the commands at once. All output should be directed to standard output.

Minibrowse can accept the following commands. After every command, it should display the full URL for the web page which would be showing in the browser window if we had implemented a full-fledged browser.

Commands:
 
Command: Description Output
Web page location (i.e. http://www.mathcs.carleton.edu) Navigate to the indicated web page Display the new web page URL.
back Navigate back one page Display the appropriate URL. If none available, indicate accordingly.
forward Navigate forward one page Display the appropriate URL. If none available, indicate accordingly.
integer from 1 through 5 Switch to window with ID number as indicated Display the current URL in the new window.

Programming Details

This project is intended to help you get some practice with stacks! As such, please adhere to the following restrictions:

Submission details

You should submit the following files, using the hsp program:

Sample session with Minibrowse

Here is a sample session with Minibrowse. I've indicated the user input in bold, and the response in italics.

http://www.mathcs.carleton.edu
http://www.mathcs.carleton.edu
http://www.yahoo.com
http://www.yahoo.com
http://www.lycos.com
http://www.lycos.com
back
http://www.yahoo.com
back
http://www.mathcs.carleton.edu
forward
http://www.yahoo.com
forward
http://www.lycos.com
forward
No page found.
2
New window.
http://www.palmgear.com/support
http://www.palmgear.com/support
http://www.hotbot.com
http://www.hotbot.com
http://www.deja.com
http://www.deja.com
back
http://www.hotbot.com
1
http://www.lycos.com
back
http://www.yahoo.com
http://www.slashdot.com
http://www.slashdot.com
forward
No page found.
back
http://www.yahoo.com
back
http://www.mathcs.carleton.edu
back
No page found.