[Haskell-cafe] ANNOUNCE: Haskell binding to the ANTLR parser generator C runtime library

Mark Wright markwright at internode.on.net
Mon Jan 17 15:56:31 CET 2011


Hi,

I'm pleased to announce the release of a Haskell binding to the
ANTLR LL(*) parser generator C runtime library.

The book on ANTLR is "The Definitive ANTLR Reference: Building Domain-Specific Languages"
by Terence Parr:

http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference

ANTLR is a very powerful parser generator.  It has support for predicated
parsing, where dis-ambiguating semantic predicates can be used to look
up information in the symbol table to handle context sensitive programming
languages.

The lexing and parsing handled in C.  The C parser actions call
Haskell code to do things such as:

- enter data into the symbol table

- look up data in the symbol table to implement dis-ambiguating semantic
  predicates for parsing context sensitive programming languages.

- create Abstract Symbol Table entries.

The ANTLR parser generator site is at:

http://antlr.org/

The Haskell binding to the ANTLR parser generator C runtime library is at:

http://hackage.haskell.org/package/antlrc

An example based on the implementation of arithmetic expressions example
from "Types and Programming Languages" by Benjamin Pierce, chapter 4, is
on github:

https://github.com/markwright/antlrc-examples/tree/master/src/tapl/arith

Building the example is somewhat challenging.  I provide a Makefile,
however it is specific to my system and will need to be customised.

Documentation for the ANTLR C runtime library is at:

http://www.antlr.org/wiki/display/ANTLR3/ANTLR3+Code+Generation+-+C

Documentation for the ANTLR parser generator is at:

http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+documentation

Thanks, Mark



More information about the Haskell-Cafe mailing list