Erlang parse trees

Richard Carlsson <>
Thu Oct 12 14:55:41 CEST 2000


Just a little announcment:

Every now and then, I see people asking for documentation on the data
structure (the "parse trees") that the Erlang standard library parser
constructs. However, that structure is still getting changed as needed,
and is not thoroughly documented anywhere. Also, it is really pretty
hairy to work with.

Whether you want to analyze, manipulate, or merely pretty-print Erlang
source code, I suggest you try the abstract datatype that I have written
in order to make these things easier and also to protect programs from
changes in the parser data structures. As well as being
backwards-compatible with the output from `erl_parse', it also allows you
to do a lot of nifty things like attaching source-code comments and user
annotations to nodes in the syntax trees.

    http://www.erlang.org/user.html#syntax_tools-1.0

The package also contains a completely new and very flexible
pretty-printer that can be used directly on any `erl_parse' output without
any knowledge of how the abstract datatype works, and also modules that
can extract comment lines from Erlang source code and automatically insert
them into the syntax tree at the right places (works like magic).

I'd like to get some users of this package - it has been pretty thoroughly
tested, so I don't expect many bug reports, but any feedback would be
appreciated.

	/Richard Carlsson


Richard Carlsson ()   (This space intentionally left blank.)
E-mail: 	WWW: http://www.csd.uu.se/~richardc/




More information about the erlang-questions mailing list