home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 mARCH
/
PCWK3A99.iso
/
Linux
/
DDD331
/
DDD-3_1_.000
/
DDD-3_1_
/
ddd-3.1.1
/
vsllib
/
struct.vsl
< prev
next >
Wrap
Text File
|
1998-11-23
|
3KB
|
103 lines
// $Id: struct.vsl,v 1.6 1998/11/23 13:53:02 zeller Exp $
// Draw structograms
// Copyright (C) 1993 Technische Universitaet Braunschweig, Germany.
// Written by Andreas Zeller <zeller@ips.cs.tu-bs.de>.
//
// This file is part of the DDD Library.
//
// The DDD Library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// The DDD Library 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 Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with the DDD Library -- see the file COPYING.LIB.
// If not, write to the Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// DDD is the data display debugger.
// For details, see the DDD World-Wide-Web page,
// `http://www.cs.tu-bs.de/softech/ddd/',
// or send a mail to the DDD developers <ddd@ips.cs.tu-bs.de>.
#include "std.vsl"
#include "tab.vsl"
#include "slopes.vsl"
// Version
struct_version() = "$Revision: 1.6 $";
// Structograms
// framedListStruct() creates a vertical list, separated by horizontal lines
_framedListStruct(stmt) = stmt;
_framedListStruct(stmt, ...) =
_framedListStruct(stmt)
| hrule()
| _framedListStruct(...);
framedListStruct(...) =
vfix(_framedListStruct(...));
// topLoopStruct() creates a while loop
topLoopStruct(cond, body) =
cond
| indent(hrule() | vrule() & body);
// bottomLoopStruct() creates a do-while loop
bottomLoopStruct(body, cond) =
indent(vrule() & body | hrule())
| cond;
// topBottomLoopStruct() creates a loop with entry and exit conditions
topBottomLoopStruct(cond1, body, cond2) =
cond1
| indent(hrule() | vrule() & body | hrule())
| cond2;
// fallStruct() creates a box separated by a diagonal line `\'
// riseStruct() creates a box separated by a diagonal line `/'
_fallStruct(sw, ne) =
fall() ^ sw_flush(sw) ^ ne_flush(ne) ^ (sw + ne + rulethickness())
| hrule();
fallStruct(sw, ne) = _fallStruct(sw, ne);
_riseStruct(nw, se) =
rise() ^ nw_flush(nw) ^ se_flush(se) ^ (nw + se + rulethickness())
| hrule();
riseStruct(nw, se) = _riseStruct(nw, se);
// testStruct() creates a test box
testStruct(cond, leftbody, rightbody, leftlabel, rightlabel) =
let width = hspace(leftlabel | leftbody | rightlabel | rightbody | cond) in
let height = vspace((leftlabel & rightlabel) | cond) in
let ltop = width ^ fall() ^ sw_flush(leftlabel),
rtop = width ^ rise() ^ se_flush(rightlabel),
top = ((ltop & rtop) ^ n_flush(cond)) ^ height in
let lbottom = leftbody ^ width,
rbottom = rightbody ^ width,
bottom = (lbottom & vrule() & rbottom) in
top | hrule() | bottom;