You might want to investigate something like Lex.
Using BNF may (or may not) be of much use in actual parsing.
This is really not very different from someone saying, "How do I store the rules of chess in a program so that I can check if a move in a game is valid?" Certainly, there are many chess games and syntax parsers around, so there should be no shortage of existing source code for you to examine, but if you are looking for some function API like:
Originally Posted by iamnew
Well, you may (or may not) find some library around to suit your needs, there is certainly no standard procedure here. Like I said, google lex and yacc.
int DefineMyChessGame (char *rules); // "rules" is a string definition
int DefineMyBNF_lexer (char *rules); // "rules" is a string definition