I need someone to write a program in C (using Lex and Yacc) that takes a regular expression as input and creates a C source file. The source file contain a virtual automaton that accepts input that satisfies the regular expression. The source file must produce a valid C program that will compile free of errors or warnings under Linux's gcc compiler using such options as -Wall, -ansi, -pedantic and electric fence. No linked libraries or #includes other than stdio.h.
The regular expression will be provided on the command line enclosed in quotation marks (e.g. "(ab + cd)"). The regular expressions will follow these rules:
- + means union (or)
- * means Kleene (zero or more)
- Letters together means concatenation (e.g. ab)
- Brackets can be used.
- Any or all of the 26 lowercase alphabetical letters can be used.
Just like in math, brackets take precendence, then catecatenation, then union. Lex and Yacc must be used to interprete the inputed regular expression and create the output source file.
If you need any further info, please contact me.
## Deliverables
Complete complete source code of all work done.
The source code delivered must compile and run on my linux system (RedHat 7.1) free of errors using the -Wall, -ansi and -pedantic options. The source file produced by the program must also compile on my linux system using the above options. The program must be able to handle ANY regular expression I can think of entering as input and create another program that accepts a specific example of that regular expression.
## Deadline information
The entire program must be completed by Wednesday, October 17, 2001.