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 is defined as a tuple having nonterminals, terminals, counters, production rules and a start nonterminal, such that the counters are variables with an integer value used to chronicle parsing history of the production rules, and at least one of the production rules includes an action association with a terminal or nonterminal comprising body of the production rule and the action is an expression for updating a value of a counter defined by 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 traversing through a network and extract data elements from the data packets in accordance with the counting automaton, where the field extractor is implemented by an integrated circuit.
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 is defined as a tuple having nonterminals, terminals, counters, production rules and a start nonterminal, such that the counters are variables with an integer value used to chronicle parsing history of the production rules, and at least one of the production rules includes an action association with a terminal or nonterminal comprising body of the production rule and the action is an expression for updating a value of a counter defined by 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 traversing through a network and extract data elements from the data packets in accordance with the counting automaton, where the field extractor is implemented by an integrated circuit. 6. The system of claim 1 wherein the automata generator generates the counting automaton by setting an initial state of the counting automaton to the start nonterminal of the regular grammar; setting states of the counting automaton equal to set of nonterminals in the regular grammar; and, for each state, assigning transition functions by identifying a set of production rules having a head whose predicate is satisfied by each possible counter configuration and constructing a given state from regular expressions taken from the body of each rule in the identified set of productions rules, where the decision for the given state is corresponding action taken from the body of each rule in the identified set of production rules.