Regular Expression... Evaluator?

I was assigned a project, looks pretty simple but I just don't know where to begin!

In a command window, enter a regular expression...
Then take that RE and change it to a NFA-e, then that NFA-e to NFA, then that NFA to DFA, then that DFA to MDFA... and that result, I should create a file wich I can open in AFER (don't know if you've heard of it...)

Anyways, I need someone to give me a very good push; code is, of course, quite welcome... keep in mind it is strictly c/c++.
Who is Participating?
CayceConnect With a Mentor Commented:
This links could give you some insight:

Guess you'll have to research in your school/local library for most of what you want to do.
There's tons of books that go thru the subjects you need ( Coding will be the easiest part, but you need to research about the concepts behing of what you are asking for. Don't expect EE experts to give you all the code you need.

I hope the papers and college courses I point you to will be of any help.
Kent OlsenData Warehouse Architect / DBACommented:

Hi gabriella_leveron,

This looks like a homework assignment, so I'll nudge a little and you can follow iwht more questions.  :)

The first thing that you're going to have to do is "tokenize" the items in the expression.  You can grab them "on the fly" from the input stream or build a list.  I'd suggest building a list.

TAN(1+SQRT(PI))       /*  A meaningless calculation, but a valid example  */

Token[0] = "TAN"
Token[1] = "("
Token[2] = "1"
Token[3] = "+"

Then convert this list of tokens into a tree structure that when perused, accesses the items in NFA-e form.

First we walk, then we run....  :)
gabriella_leveronAuthor Commented:
I've done Mathematical Expression Evaluators before...

But that is what has me, confused I guess...
When I say RE I mean the user will type in something like (11+0)*(00+1)* and then continue with what i told ya in the original post...

I'm not even crawling with this, dude!  If it were a homework assignment, like simple homework, I wouldn't bother posting, I would google.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Kent OlsenData Warehouse Architect / DBACommented:

Cool.  Then you should be off to a good start.  Build the tree such that it can be traversed to produce RPN.  From there the only difficulty should be in the understanding of each of the other notations.  (Sorry -- I don't know them all.)

Do you want to actually write the code, or just produce the outcome? The boost library has RE handling routines which I think are quite flexible..
Check out this link:

It shows how to use the Microsoft VBScript Regular Expression library in Delphi. The procedure to use it under BCB is the same (just the code changes from Pascal to C++, no big deal). This library comes with almost every version of windows.
gabriella_leveronAuthor Commented:
I actually have to write the code for it :S
So, is it homework/school project or not?
All Courses

From novice to tech pro — start learning today.