/* parse an overlay segment specification for PL/I symbolic debugger */ segment: procedure(segment_fileaddr); dcl segment_fileaddr fixed bin(23); /*returned fileaddr of overlay segment hash record*/ %include 'scandef.pli'; %include 'workdef.pli'; %include 'segdef.pli'; %include 'external.inc'; dcl segment_name char(31) varying, segment_name6 char(6) varying, save_nextp fixed bin(15), ttype fixed bin(7), x fixed bin(15); /**************************************************************************************************************/ save_nextp = nextp; ttype = nexttoken(segment_name); segment_name6 = segment_name; if (ttype ^= symbol_type) ! ^ nxtokenis('\') then do; /*no segment specified - restore scan state & return any_parent*/ nextp = save_nextp; errorp = nextp; segment_fileaddr = any_parent; if root_segment_fileaddr = null_fileaddr /*make sure root segment hash record exists (needed by SET MODULE, XG)*/ then x = external_address(any_name, overlay_segment_class, any_parent); return; end; do while(true); if workget(segment_name6, overlay_segment_class, any_parent, scratch_workp) then do; segment_fileaddr = scratch_workp->workbuf.fileaddr; return; end; /*segment not encountered yet - have external_address scan the map to the next one:*/ if external_address(segment_name6, overlay_segment_class, any_parent) = not_found /*i.e., if hit end of map*/ then call error('overlay segment to the left not found'); end; end/*segment*/;