Elsa: The Elkhound-based C/C++ Parser

Elsa is a C and C++ parser. It is based on the Elkhound parser generator. It lexes and parses input C/C++ code into an abstract syntax tree. It also does some type checking, but (currently) only insofar as that is required to disambiguate the syntax. The only major C++ features still not implemented are namespaces and template partial specializations.

To download Elkhound and Elsa, see the Elkhound distribution page.

Additional documentation:

Elsa requires the following external software:

Build instructions:

  $ ./configure
  $ make
  $ make check
./configure understands these options. You can also look at the Makefile.

Parsing some sample input:

  $ ./ccparse in/t0001.cc
The above command will parse and type check the given file. To make it print the annotated, post-type-check AST, say
  $ ./ccparse -tr printTypedAST in/t0001.cc

Additional -tr flags of interest:

The -tr flags can be passed separately, or strung together separated by commas (e.g. "-tr env,disamb,printAST").

Module List:

Module dependency diagram:
Module dependencies
Or, in Postscript.

Miscellanous files:

Valid HTML 4.01!