Common Lisp Package: COM.INFORMATIMAGO.COMMON-LISP.PICTURE.CONS-TO-ASCII

This packages draws ASCII art cons cell diagrams. License: AGPL3 Copyright Pascal J. Bourguignon 2004 - 2012 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

README:

FUNCTION

Public

DRAW-LIST (LIST &KEY (TITLE (FORMAT NIL ~(~S~) LIST)))

DO: Draws the LIST structure. TITLE: An alternative title. RETURN: A string containing the drawing. EXAMPLE: (draw-list '(if (< a b) (decf b a) (decf a b))) returns: "+-----------------------------------------------------------------------+ | (if (< a b) (decf b a) (decf a b)) | | | | +---+---+ +---+---+ +---+---+ +---+---+ | | | * | * |-->| * | * |-->| * | * |-->| * |NIL| | | +---+---+ +---+---+ +---+---+ +---+---+ | | | | | | | | v | | v | | +----+ | | +---+---+ +---+---+ +---+---+ | | | if | | | | * | * |-->| * | * |-->| * |NIL| | | +----+ | | +---+---+ +---+---+ +---+---+ | | | | | | | | | | | v v v | | | | +------+ +---+ +---+ | | | | | decf | | a | | b | | | | | +------+ +---+ +---+ | | | v | | | +---+---+ +---+---+ +---+---+ | | | | * | * |-->| * | * |-->| * |NIL| | | | +---+---+ +---+---+ +---+---+ | | | | | | | | | v v v | | | +------+ +---+ +---+ | | | | decf | | b | | a | | | | +------+ +---+ +---+ | | v | | +---+---+ +---+---+ +---+---+ | | | * | * |-->| * | * |-->| * |NIL| | | +---+---+ +---+---+ +---+---+ | | | | | | | v v v | | +---+ +---+ +---+ | | | < | | a | | b | | | +---+ +---+ +---+ | +-----------------------------------------------------------------------+"

Private

DECORATE (CELL)

DOES: Converts the list CELL to a decorated list. The building of the decoration is done by the make-decoration function. RETURN: The decorated list.

Undocumented

FIND-NODES (TREE TABLE)

TRANSPOSE-TREE (TREE)

GENERIC-FUNCTION

Public

DRAW-CELL (PICT X Y CELL)

Draws the CELL in the picture PICT, at coordinates X,Y

Private

Undocumented

DRAW-CONS (PICT X Y CELL)

DRAW-DECORATED-CELL (PICT X Y DEC)

SIZE-CELL (PICT CELL &OPTIONAL MAX-WIDTH)

SLOT-ACCESSOR

Private

Undocumented

ATOM-VALUE (OBJECT)

SETFATOM-VALUE (NEW-VALUE OBJECT)

CAR-DECO (OBJECT)

SETFCAR-DECO (NEW-VALUE OBJECT)

CDR-DECO (OBJECT)

SETFCDR-DECO (NEW-VALUE OBJECT)

CELL-VALUE (OBJECT)

SETFCELL-VALUE (NEW-VALUE OBJECT)

H (OBJECT)

SETFH (NEW-VALUE OBJECT)

W (OBJECT)

SETFW (NEW-VALUE OBJECT)

X (OBJECT)

SETFX (NEW-VALUE OBJECT)

Y (OBJECT)

SETFY (NEW-VALUE OBJECT)

VARIABLE

Private

+CELL-WIDTH+

+---+---+

Undocumented

+NIL-DECORATION+

+NONE+

+PICTURE-INSTANCE+

CLASS

Private

Undocumented

ATOM-DECORATION

CONS-DECORATION

DECORATION