Althought I didn't create the basic mechanism for this solution, I can answer some questions about how to do things and would be happy to, given time limitations, in the forum.

Google provides a lot of good examples on how to do things with flex and bison. Unfortunately, you may have to read more than the first search result to find what you are looking for.

Good luck.