Skip to content
/ nail Public
forked from jbangert/nail

A practical interface generator for data formats.

License

Notifications You must be signed in to change notification settings

gkwicker/nail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nail

\textit{Nail} is an interface generator that allows programmers to safely parse and generate protocols defined by a Parser-Expression based grammar. Nail also provides solutions for parsing common patterns such as length and offset fields within binary formats that are hard to process with existing parser generators.

Installation & Pre-requisites

The code generator (in /generator/) requires a C++ compiler and depends on boost. The code generator can either be invoked as ./nail foo.nail , which case it will emit C++ code (in foo.nail.cc and foo.nail.hh) , or as ./cnail foo.nail in which case it will emit a two-pass parser in C (in foo.nail.c and foo.nail.h) . Generated code has no dependencies (and does not even use the C++ or C standard library). longjmp.h/setjmp.h is used for handling out of memory errors.

Examples

Several examples are provided, pull requests for more are very welcome!

  • /dns - DNS server and resolver implemented in C. Used for older benchmarks
  • /dns_cpp - DNS server implemented in C++, used for newer benchmarks
  • /zip - ZIP extractor,compressor in C.
  • /protozip - Simplified 'pretend' zip, easier to grok
  • /utf16 - mini grammar for UTF-16 -- good starting point

Network stack

Nail has a (very prototype-y) network stack. Find it in /network/. The network stack depends on boost and (soon) Intel TBB and DPDK .

About

A practical interface generator for data formats.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TeX 71.2%
  • C 15.5%
  • C++ 6.8%
  • Python 5.3%
  • HTML 0.5%
  • Makefile 0.2%
  • Other 0.5%