Abstract: A system and method for a protocol parser that has native support for parsing TLVs and flag-fields and allow users to code in a language convenient to them and leverage standard tool chains and tools. The same parser source can be compiled to arbitrary software and hardware targets without code change and provide the highest performance possible given its capabilities.