My guess is that you don't have a context-free grammar?
If you have a context-free grammar, you can use a context-free parser generator; there are lots of tools for creating a parser for context-free grammar. The key word to search for: parser generator.
Generally, the easiest way to parse a context-sensitive grammar is to build a parser with a parser generator that can parse a context-free superset of the actual grammar, and then do a second parsing stage to do the contexts-sensitive checks.