1. A packet classification state machine for classifying data from a data stream, the state machine comprising: a) programmable memory for storing information relating to states within the state machine; b) last in first out stack memory for storing data indicative of a state, the stack memory operable independent of the programmable memory; and, c) a processor for retrieving information from the programmable memory one or fewer times per state transition and capable of retrieving information from the stack memory during a same state transition, the processor for determining a next state based on the current state and the data from the data stream, and for switching the state machine into the next state so determined.