/* ***************************************************************************** * * * Copyright (c) 1978, 1979, 1980 * * by DIGITAL Equipment Corporation, Maynard, Mass. * * * * This software is furnished under a license and may be used and copied * * only in accordance with the terms of such license and with the * * inclusion of the above copyright notice. This software or any other * * copies thereof may not be provided or otherwise made available to any * * other person. No title to and ownership of the software is hereby * * transferred. * * * * The information in this software is subject to change without notice * * and should not be construed as a commitment by DIGITAL Equipment * * Corporation. * * * * DIGITAL assumes no responsibility for the use or reliability of its * * software on equipment which is not supplied by DIGITAL. * * * ***************************************************************************** facility: SDL (Structure Definition Language) author: Paul A. Calato */ /* C H A N G E L O G Date ! Name ! Description ________________!_______!______________________________________________________ ! ! 23-Nov-1985 | pc | Adding copyright header and change log. ________________!_______!______________________________________________________ */ /****************************************************************/ /* */ /* TABS calculates the level of indentation i.e number of tabs */ /* */ /****************************************************************/ tabs: procedure (cur_node, level, flag) returns(char(132) var); /********************/ /* */ /* TABS */ /* */ /********************/ %include 'sdl$library:sdltypdef.in'; /* type definitions */ %include 'sdl$library:sdlnodef.in'; /* node structure definition */ /* declare variables */ declare cur_node pointer, /* pointer to the current node */ level fixed binary(31), /* level in the aggregate */ flag bit(1), /* union flag */ temp_node pointer, /* for traversing the parent tree */ tab char(132) var initial(''), /* indentation */ found bit(1) initial('0'b), /* flag */ i fixed binary(31); /* counter */ do i = 1 to level; tab = tab || ' '; end; /* if the calling program is interested, determine if the current item */ /* is inside of a union,these items need a extra tab */ if( flag ) then do; temp_node = cur_node->nod$a_parent; do while ( temp_node ^= null() & ^found ); if( temp_node->nod$w_datatype = typ$k_union ) then do; tab = tab || ' '; found = '1'b; end; temp_node = temp_node->nod$a_parent; end; end; return(tab); end tabs;