! DEB.REQ ! ! ! ! ! COPYRIGHT (c) 1982 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: PAT Parser ! ! ABSTRACT: ! ! DEB.REQ is the specification for some internal PAT parser ! debugging facilities. (Also PATDEB.REQ). ! ! ENVIRONMENT: VAX/VMS user mode ! ! AUTHOR: C. Mitchell, CREATION DATE: 19-Feb-80 ! ! MODIFIED BY: ! ! , : VERSION ! 01 - !-- require 'PATREQPRO_REQ'; %if PATBLSEXT_DEBUGGING %then external DEB_EVENT_TRACE, ! If true, display debugging output DEB_EVENT_BREAK; ! If true display and break on each debugging output ! ! ! Debugging I/O Macros ! macro PUT_MSG (QUOTED_STR) = !+ ! PUT_MSG moves a quoted string to the debug output line buffer. ! For example: ! ! PUT_MSG ('Skipping symbol '); !- PUT_STRING (SD_REF (QUOTED_STR)) %; macro PUT_MSG_EOL (QUOTED_STR) = !+ ! PUT_MSG_EOL moves a quoted string to the debug output line buffer and ! writes it out. !- begin PUT_MSG (QUOTED_STR); PUT_EOL (); end %; macro PUT_ASCII (LEN, REF_STR) = !+ ! PUT_ASCII moves an ASCII string to the debug output line buffer. ! ! PARAMETERS: ! ! LEN - string length ! ! REF_STR - address of the string text ! !- begin local DESCRIPTOR : vector [2]; DESCRIPTOR [0] = LEN; DESCRIPTOR [1] = REF_STR; PUT_STRING (DESCRIPTOR); end %; ! ! ! Debugging I/O Routines. ! ! Note that some debugging I/O macros are defined in DEB.RRR. ! external routine PUT_STRING : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! This routine moves a character string to the debug output ! buffer. ! ! FORMAL PARAMETERS: ! ! S - Address of a static string descriptor ! !-- external routine PUT_NUMBER : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PUT_NUMBER moves the ASCII representation of an integer value ! to the debug output line buffer. ! ! FORMAL PARAMETERS: ! ! NUMBER - integer value. ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! NONE ! ! SIDE EFFECTS: ! ! NONE ! !-- ! external routine PUT_EOL : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PUT_EOL writes the debug output line buffer and then clears it. ! ! FORMAL PARAMETERS: ! ! NONE ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! NONE ! ! SIDE EFFECTS: ! ! NONE ! !-- ! external routine PUT_HEX_LONG : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! This routine moves the HEX representation of a long word to ! the debug output line buffer. ! ! FORMAL PARAMETERS: ! ! NONE ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! NONE ! ! SIDE EFFECTS: ! ! NONE ! !-- ! external routine PUT_LINE_FULL; !++ ! FUNCTIONAL DESCRIPTION: ! ! PUT_LINE_FULL checks if the addition of NUM_CHAR characters to ! the debug output line buffer would overflow the line. ! ! FORMAL PARAMETERS: ! ! NUM_CHAR - Number of characters in next item to be output. ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! TRUE - if they won't fit. ! FALSE - if they will. ! ! SIDE EFFECTS: ! ! NONE ! !-- ! external routine PUT_START_AUTOEOL : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! Start writing the debug output buffer automatically when it ! is full. Parameters specify the number of columns to ! indent when a new line is started automatically and a ! separator that can be used to automatically insert ", " ! between each item in a list. ! ! FORMAL PARAMETERS: ! ! INDENT - Number of columns to indent when a new line ! is started. ! ! SEPARATOR_LEN - Length of separator. ! ! SEPARATOR_PTR - Text of separator. ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! NONE ! ! SIDE EFFECTS: ! ! Automatic end-of-line's will continue until PUT_END_AUTOEOL ! is called. ! !-- ! external routine PUT_END_AUTOEOL : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PUT_END_AUTOEOL stops automatic end-of-line's. ! ! FORMAL PARAMETERS: ! ! NONE ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! NONE ! ! SIDE EFFECTS: ! ! NONE ! !-- ! ! ! Misc. debugging routines and internal errors ! external routine DEB_SIGNAL_DEBUG : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! This routine signals SS$_DEBUG to invoke DEBUG-32. !-- %fi ! macro DEB_ASSERT (CONDITION, MESSAGE) = !+ ! DEB_ASSERT is called to make an internal consistency check. ! This macro is only expanded if compiling with the debug ! switch on. ! ! Parameters: ! ! CONDITION - Condition asserted to be true. ! ! MESSAGE - Message to be written if CONDITION ! is not true. ! ! %remaining - Optional list of expressions to be ! to be executed if CONDITION is not ! true. ! ! Example of use: ! ! DEB_ASSERT (.XXX leq MAX, 'XXX is too big', ! PUT_MSG ('XXX = '), ! ! PUT_NUMBER (.XXX), ! ! PUT_EOL ()); ! !- begin %if PATBLSEXT_DEBUGGING %then if (CONDITION) then 0 else begin %if %isstring (MESSAGE) %then bind M = SD_REF (MESSAGE); %else bind M = MESSAGE; %fi %if PATBLSEXT_DEBUGGING %then PUT_MSG ('Assert error in parser: '); PUT_STRING (M); DEB_EXPAND_EXPRS (%remaining) ! Expand the list of expressions PUT_EOL(); DEB_SIGNAL_DEBUG (); %fi end %else 0 %fi end %; macro DEB_EXPAND_EXPRS (EXPR) [] = EXPR; DEB_EXPAND_EXPRS (%remaining) %; !