ProductPromotion
Logo

C Programming

made by https://0x3d.site

GitHub - abiggerhammer/hammer: Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.
Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that. - abiggerhammer/hammer
Visit Site

GitHub - abiggerhammer/hammer: Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.

GitHub - abiggerhammer/hammer: Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.

Hammer is a parsing library. Like many modern parsing libraries, it provides a parser combinator interface for writing grammars as inline domain-specific languages, but Hammer also provides a variety of parsing backends. It's also bit-oriented rather than character-oriented, making it ideal for parsing binary data such as images, network packets, audio, and executables.

Hammer is written in C, but will provide bindings for other languages. If you don't see a language you're interested in on the list, just ask.

Hammer currently builds under Linux and OS X. (Windows is coming.)

Build Status Features

  • Bit-oriented -- grammars can include single-bit flags or multi-bit constructs that span character boundaries, with no hassle
  • Thread-safe, reentrant
  • Benchmarking for parsing backends -- determine empirically which backend will be most time-efficient for your grammar
  • Parsing backends:
    • Packrat parsing
    • LL(k)
    • GLR
    • LALR
    • Regular expressions
  • Language bindings:
    • C++
    • Java (not currently building; give us a few days)
    • Python
    • Ruby
    • Perl
    • Go
    • PHP
    • .NET

Installing

Prerequisites

  • SCons

Optional Dependencies

  • pkg-config (for scons test)
  • glib-2.0 (>= 2.29) (for scons test)
  • glib-2.0-dev (for scons test)
  • swig (for Python/Perl/PHP bindings; Perl requires >= 2.0.8)
  • python2.7-dev (for Python bindings)
  • a JDK (for Java bindings)
  • a working phpenv configuration (for PHP bindings)
  • Ruby >= 1.9.3 and bundler, for the Ruby bindings
  • mono-devel and mono-mcs (>= 3.0.6) (for .NET bindings)
  • nunit (for testing .NET bindings)

To build, type scons. To run the built-in test suite, type scons test. For a debug build, add --variant=debug.

To build bindings, pass a "bindings" argument to scons, e.g. scons bindings=python. scons bindings=python test will build Python bindings and run tests for both C and Python. --variant=debug is valid here too. You can build more than one set of bindings at a time; just separate them with commas, e.g. scons bindings=python,perl.

For Java, if jni.h and jni_md.h aren't already somewhere on your include path, prepend C_INCLUDE_PATH=/path/to/jdk/include to that.

To make Hammer available system-wide, use scons install. This places include files in /usr/local/include/hammer and library files in /usr/local/lib by default; to install elsewhere, add a prefix=<destination> argument, e.g. scons install prefix=$HOME. A suitable bindings= argument will install bindings in whatever place your system thinks is appropriate.

Usage

Just #include <hammer/hammer.h> (also #include <hammer/glue.h> if you plan to use any of the convenience macros) and link with -lhammer.

If you've installed Hammer system-wide, you can use pkg-config in the usual way.

For documentation, see the user guide.

Examples

The examples/ directory contains some simple examples, currently including:

  • base64
  • DNS

Known Issues

The Python bindings only work with Python 2.7. SCons doesn't work with Python 3, and PyCapsule isn't available in 2.6 and below, so 2.7 is all you get. Sorry about that.

The requirement for SWIG >= 2.0.8 for Perl bindings is due to a known bug in SWIG. ppa:dns/irc has backports of SWIG 2.0.8 for Ubuntu versions 10.04-12.10; you can also build SWIG from source.

The .NET bindings are for Mono 3.0.6 and greater. If you're on a Debian-based distro that only provides Mono 2 (e.g., Ubuntu 12.04), there are backports for 3.0.x, and a 3.2.x PPA maintained by the Mono team.

Community

Please join us at #hammer on irc.upstandinghackers.com if you have any questions or just want to talk about parsing.

Contact

You can also email us at [email protected].

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory