1. A computer-implemented system for application protocol field extraction, comprising: an extraction specification that specifies data elements to be extracted from data packets and is expressed in terms of a context-free grammar, where the grammar defines grammatical structures of data packets transmitted in accordance with an application protocol and includes a counter used to chronicle parsing history of production rules comprising the grammar; an automata generator configured to receive the extraction specification and generate a counting automaton; and a field extractor configured to receive a data flow comprised of a plurality of data packets and operable to extract data elements from the data packets in accordance with the counting automaton.