Previous: , Up: Supplied backends   [Contents][Index]

3.3.12 The libsea_ast backend

Like the dot_ast backend (see The dot_ast backend), the libsea_ast backend visualizes a coNCePTuaL parse tree. This capability is primarily useful to backend developers to help prioritize the methods that need to be implemented (i.e., implementing first the AST node types needed by in a trivial program, then those needed by successively more complex programs).

The libsea_ast backend specifies a coNCePTuaL program’s parse tree in the LibSea graph file format, which can then be visualized and manipulated interactively using the Walrus visualization tool. The primary advantage of libsea_ast over dot_ast is that libsea_ast can handle much larger parse trees than dot_ast. For example, the following image illustrates the Walrus GUI displaying a 702,985-node coNCePTuaL parse tree:7

Image of the Walrus GUI displaying a large coNCePTuaL parse tree

A secondary advantage of libsea_ast is that Walrus lets a user selectively view information. For example, in the preceding image, only <simple_stmt> nodes (see Complex statements) are highlighted; the source code for only certain nodes is displayed; and all node type and node attribute information is hidden.

The libsea_ast backend accepts the following option from the ncptl command line:


Every node in the generated LibSea graph lists the fragment of coNCePTuaL code to which it corresponds. For large coNCePTuaL programs, these strings can get large. The <program> node (see Complete programs), for example, includes the complete program source code. Because the Walrus visualizer does not currently wrap long lines, most of a long string is never even presented to the user and therefore serves no practical purpose. The argument to --node-code is a number of characters at which to truncate the code fragment or ‘-1’ to inhibit truncation.



The original source program contained over 6000 lines of coNCePTuaL code.

Previous: , Up: Supplied backends   [Contents][Index]

Scott Pakin,