Sunteți pe pagina 1din 2

CST 229 Introduction to Grammars

CST 229 Introduction to Grammars Program Assignment #2 Regular Language Recognizer Deterministic Finite Automata Simulation Write a program to simulate a machine known as the deterministic finite automata (dfa). Your program reads a description of a machine M (from an input file) which includes:

A list of states A set of alphabet letters A set of transition functions A start state A set of final states

It then reads in a set of input strings (interactively) and determines whether or not a particular string is acceptable by the machine. Test Data: Test your simulator by designing 3 machines:

A machines that accepts an even number of 0s. {00, 0000, 000000, .} A machine that accepts any integer. {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, } A machine that accepts any legal C variable name. {index, xyz, name1, dept_2, .}

First test each machine individually, then combine all three into one machine and test your program with all three together. Your program must be generic enough to accept any other machine. Misc. Information

You can design the format of your input file. Please include in the ReadMe file what the format is. Your program must be general enough to simulate ANY finite automata (not limiting to the three test cases). Your program must check for error conditions and invalid inputs. Your program will be graded on completeness and correctness. The program must be properly documented according the Code Style guide posted on my webpage.

Assignment Submission Guidelines


http://www.cset.oit.edu/~yangs/CST229/Lab/Prog2.htm (1 of 2) [1/1/2002 12:41:14 AM]

CST 229 Introduction to Grammars

NO LATE ASSIGNMENTS WILL BE ACCEPTED without prior approval from the instructor. The instructor will send out an email upon receiving your assignment. If you do not receive an email within 24 hours of submitting the assignment, it is YOUR responsibility to contact the instructor by email or phone. If you do not contact the instructor within 48 hours after the due date, the assignment is considered late or unacceptable. Late assignments must be submitted within one week of the due date. There will be a 20% penalty for late assignments. All handed-in assignment must be sent in the following format: 1. Zip up all files required to build the assignment. 2. In the archive, also include a readme file that lists all files included in the archive with a brief description of each file. The readme file should also contain installation instructions and instructions for running the program. 3. The archive will be attached to an email with subject line: CST229 Assignment #2 first name last name 4. Email the archive to sherry.yang@oit.edu & yang.dexter@gmail.com Failure to do this will result in the assignment being discarded.

Instructor: Dr. Sherry Yang Oregon Institute of Technology

http://www.cset.oit.edu/~yangs/CST229/Lab/Prog2.htm (2 of 2) [1/1/2002 12:41:14 AM]

S-ar putea să vă placă și