1. A method for generating configuration data for configuring a hardware switch, the method comprising: receiving a description of functionality for the hardware switch; based on the description, generating sets of match and action entries for use in configuring the hardware switch to process packets through a plurality of stages that match against packet header fields and modify packet header fields; determining, for each packet header field in a parse graph that specifies instructions for a parser of the switch to extract packet header fields from packets, whether the packet header field is used by at least one match entry or modified by at least one action entry; and generating configuration data for the parser of the hardware switch, wherein the configuration data instructs the parser to (i) extract packet header fields used by at least one match entry or modified by at least one action entry to a first set of registers and (ii) extract packet header fields not used by any match or action entries to a second set of registers.