Aurochs is a parser generator that uses the parse expression grammar (PEG) or "packrat" approach. It takes a grammar in a BNF-like notation (a .peg file) and produces bytecode (a .nog file) for a stack automaton. This bytecode is later interpreted on the input to parse using a C library. Bindings are given for Ocaml, Java and Exascript.
OCaml C Java Shell
Switch branches/tags
Nothing to show
Latest commit 637bdc0 Oct 10, 2010 berke berke Remove .opt extensions in myocamlbuild.ml.
Permalink
Failed to load latest commit information.
aurochs Remove unmaintained AMD64 and Ritchie backends. Feb 7, 2009
backends Remove unmaintained AMD64 and Ritchie backends. Feb 7, 2009
c Fix 64-bit format string issue. Feb 7, 2009
examples Remove unmaintained AMD64 and Ritchie backends. Feb 7, 2009
front Starting constant attribute values. Dec 19, 2007
include Improved README. Fixed Java bindings. Jan 22, 2009
java Improved README. Fixed Java bindings. Jan 22, 2009
manual Added simplecalc example. Dec 13, 2007
nog Improving memory efficiency... Jan 19, 2009
pack Parsing and building works! Sep 28, 2007
peg Added -terse. Mar 5, 2008
syntax Added constant attributes. Dec 19, 2007
tests Some tests. Remove binary from HG. Dec 19, 2007
util Remove unmaintained AMD64 and Ritchie backends. Feb 7, 2009
.hgignore First Hg version. Sep 27, 2007
.svnignore First Hg version. Sep 27, 2007
AUTHORS E-mail. Dec 11, 2007
INSTALL Improved README. Fixed Java bindings. Jan 22, 2009
LICENSE LICENSE, AUTHORS. Nov 13, 2007
Makefile Libprefix, binprefix. Jan 26, 2009
Makefile.distrib Use macro for INLINE keyword, remove unused comments and definitions. Jan 20, 2009
Makefile.java Add pushdown module. Jan 20, 2009
README Improved README. Fixed Java bindings. Jan 22, 2009
TODO Improving memory efficiency... Jan 19, 2009
_tags Reorganizing. Jan 22, 2009
aurochs_lib.mllib Made aurochs_lib packed to avoid package name conflicts. Oct 3, 2007
aurochs_pack.mlpack Added bootstrapper. Oct 3, 2007
build.sh Fixed build.sh. Dec 19, 2007
genmachine.ml Reorganizing. Jan 22, 2009
libaurochs.clib Reorganizing. Jan 22, 2009
make-distrib.sh Fix include dir thing. Jan 7, 2009
myocamlbuild.ml Remove .opt extensions in myocamlbuild.ml. Oct 9, 2010

README

Aurochs, a parser generator.

  Copyright (C)2007-2009 Exalead SA
  Author: Berke Durak

  http://aurochs.fr/

Installation.
=============
1) You can try aurochs on-line at http://aurochs.fr/

2) You need Objective Caml 3.10 or later.  See http://caml.inria.fr/

   On Debian-like systems:
     apt-get install ocaml-nox

3) You also need the usual development tools (GNU Make, C compiler).

4) make (or gmake)

5) Typing
     sudo make PREFIX=/usr/local install
   will install the aurochs binary in /usr/local/bin and the Ocaml
   libraries in the Ocaml installation directory, as determined
   by
     ocamlc -where.

6) You can also use ./aurochs_tool.native if you do not want to install
   aurochs.

Testing
=======
1) There are some grammars in examples/.  You can parse them using
   Aurochs right away:

     aurochs -parse examples/test.markup examples/markup.peg

   Aurochs will print an XML-like representation of the parse tree.
   This is how you develop your grammar.

2) Once your grammar is OK, you generally use Aurochs to save the resulting
   automaton into a binary file.  The command

     aurochs -target nog examples/markup.peg

   will create a file markup.nog

3) You can parse a file using that NOG file:

     aurochs -parse examples/test.markup examples/markup.peg -load-nog markup.nog

4) There is an example C program in c/test/test_nog which does the same thing.

    _build/c/test/test_nog markup.nog examples/markup.peg

5) There are Ocaml examples in examples/calculator and examples/cgi-bin.

6) There is a Java example in java/.  Ensure you have Java 1.6 handy and type "make test" there.
   For Java 1.5, comment out the "@SuppressWarnings" annotation in java/fr/aurochs/Node.java.