what you need amongst other things is a parser, not the easiest thing to write, theres a c++ book at
www.relisoft.com that talks you through the implementation of one but they use a lot of c++ concepts. i seem to remember reading an article by jack crenshaw about building a compiler in pascal, its hosted on a comp.compilers mirror somewhere, the majority of that would be quite useful and being in pascal should be easy to port. if your not interested in writing one but just using one im sure you could grab something off sourceforge and link it into your program.