Erlang shell print depth and print length: how to change?

Richard Carlsson richardc@REDACTED
Tue Feb 6 09:37:54 CET 2001


On Mon, 5 Feb 2001, Arthur Reyes wrote:

> Dear Erlang Friend:
> 
> I need to inspect Erlang abstract syntax trees (ASTs) produced by
> epp:parse_file/3 and similar functions. 
>
> When given the filename and path of a large Erlang source code file,
> epp:parse_file/3 returns a long list of deeply nested tuples.
> 
> The returned list is often so long the Erlang shell elides the end of
> it with ellipses (...). The tuples are often so deeply nested the
> Erlang shell elides the deeper components with ellipses as well.

I would not go as far as to suggest that you try to modify the behaviour
of the shell itself, but this would show you the whole structure:

	io:fwrite("~p", [epp:parse_file("foo.erl", [], [])])

If you want to analyse the syntax tree in more detail, I recommend my
"syntax tools" package, which works as an abstract layer hiding the actual
representation details. It also comes with a more advanced pretty-printer
than the standard library 'erl_pp'.

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


    /Richard Carlsson


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





More information about the erlang-questions mailing list