Project 6: grep

Get Regular Expression Pattern

Educational Objectives: After completing this assignment, the student should be able to accomplish the following:

Operational Objectives: Produce an implementation of the classic grep search facility. A small subset of special characters may be used, but it should include at least wild cards and enough syntax to make searches workable from the command line. An implementation of the classes GREP ("get regular expression pattern") and NFA ("non-deterministic finite automoton") is required.

You may have teams of 2 - 4 people. The team should compose a brief summary of work that explains the responsibilities and work products each member of the team accomplished. Also each team member should submit the project individually. Please make certain that the submissions for each member of a team are identical.

Change Log: This document is released for use and comment. Details may be changed or augmented based on commentary posted in the Project 6 Topics forum. Any substantive changes will be logged here.

Deliverables: Files:

nfa.h          # definition [and implementation] of class NFA
grep.h         # definition [and implementation] of class GREP
grepdriver.cpp # driver program (modelled on gnu grep)
makefile       # builds all executables in project, including tests
readme.txt     # overview of team & project

Procedural Requirements

  1. The official development | testing | assessment environment is g++47 -std=c++11 -Wall -Wextra on the linprog machines. Code should compile without error or warning.

  2. Each member of a team submits all team deliverables

  3. Deliverables submitted should be identical across all team members.

  4. The team makup is listed in the file header documentation of each submitted file (see C++ Style link for standards)

  5. File readme.txt explains how the software was developed, what responsibilities each team member had, how it was tested, and how it is expected to be operated.

  6. Copy the file LIB/proj6/submit.sh into your project directory and change its permissions to executable. Edit the file "deliverables.grep" to the specific files in your project. Submit the project by executing the script: submit.sh deliverables.grep.

    Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.

Code Requirements and Specifications

  1. Regular Expression notation: The metacharacters required for a simple implementation consist of concatenation, or ( | ), closure ( * ), parentheses ( ( , ) ), and wildcard ( ( . ) ).

  2. Regular expression "shorthand" characters may aso be implemented, and may make the project easier: [, ], {, }, +, ^.

  3. A small proof of concept that includes wildcards is required, but full implementation of grep is not required

  4. NFA should be as general as reasonable so that expansion to a full grep would be straightforward [if also a big expansion in scope].

  5. For simplicity, please put the implementation code for NFA below the definition of class NFA in the header file nfa.h and the implementation code for GREP below the definition of class GREP in the header file grep.h. It is preferable to separate the implementation below the class definition (rather than implement methods in the class definition).