An algorithm for an efficient command interpreter
Jason Gait · Software Practice and Experience · 1982
Abstract The function of a command interpreter is to evaluate a command line, select an action according to the command entered and then execute the action, passing such parameters from the command line as required. Efficient run‐time behaviour is exhibited when the action is selected via a hash table, which provides constant time performance as the number of commands increases. Since the hash table is static and can be closely packed in an optimal fashion, the execution time can be limited to an average of less than two probes per selection even for closely packed tables.