One way that might be effective for you is to create a syntax tree based on the commands you support. For instance, the root of the tree is empty and the first level of the tree is all the verbs you support. The node below each supported verb could be the set of objects valid for that verb. And so on...
This would work well for small languages but may become unwieldy as you include more command options. At that point you may look into a lexical analyzer that will verify input based on a specification. This route is certainly more advnaced.
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124