5.lab prog2(dfa simulation)

Upload: md-saiful-islam

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 5.Lab Prog2(DFA Simulation)

    1/2

    CST 229 Introduction to Grammars

    CST 229 Introduction to Grammars

    Program Assignment #2

    Regular Language Recognizer

    eterministic Finite Automata Simulation

    rite a program to simulate a machine known as the deterministic finite automata (dfa). Your progra

    ads 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

    then reads in a set of input strings (interactively) and determines whether or not a particular string

    ceptable by the machine.

    est Data:

    est 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,

    .}

    rst test each machine individually, then combine all three into one machine and test your program w

    l three together. Your program must be generic enough to accept any other machine.

    isc. Information

    You can design the format of your input file. Please include in the ReadMe file what the form

    is.

    Your program must be general enough to simulate ANY finite automata (not limiting to the thtest 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.

    ssignment Submission Guidelines

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

  • 7/28/2019 5.Lab Prog2(DFA Simulation)

    2/2

    CST 229 Introduction to Grammars

    NO LATE ASSIGNMENTS WILL BE ACCEPTED without prior approval from the instruct

    The instructor will send out an email upon receiving your assignment. If you do not receive a

    email within 24 hours of submitting the assignment, it is YOURresponsibility to contact the

    instructor by email or phone. If you do not contact the instructor within 48 hours after the du

    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 [email protected] & [email protected]

    Failure to do this will result in the assignment being discarded.

    Instructor: Dr. Sherry YangOregon Institute of Technology

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

    mailto:[email protected]:[email protected]:[email protected]:[email protected]