I would strongly suggest the OP really needs to do some serious reading (and there are literally thousands of references on this topic) on HOW to do parsing properly before proceeding. Doing string compares, as his current code does, is very resource-intensive, and will very quickly become completely unmanageable on a small-memory system. There is virtually NEVER a need to break an entire arbitrary-length command into individual tokens all at one time. That is the very heart of actual parsers - break down the command quickly, efficiently, and with a minimum of resources. Does a c++ compiler have to break an entire program down into tokens before it can start figuring out what it all means? The answer is no. It rarely has to look at more than a very few tokens at any one time. Parsing, at its simplest, consists of two basic, and totally independent, steps: lexical analysis (i.e. - recognizing and extracting valid tokens), and parsing (i.e - recognizing and enforcing the language syntax). Trying to do both in a single operation is appropriate only for the most trivial of languages, and for all others very quickly becomes totally unmanageable.