! PATPARSER.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: ! ! PATPARSER.REQ is the external specification for the parser. ! ! ENVIRONMENT: VAX/VMS user mode ! ! AUTHOR: C. Mitchell, CREATION DATE: 25-Feb-80 ! ! MODIFIED BY: ! ! Charlie Mitchell, 7-Dec-81 : VERSION X2-001 ! 001 - Combine .REQ and .RRR files. !-- ! ! INCLUDE FILES: ! require 'PATREQPRO_REQ'; library 'PAT_LANGSP_LIBRARY'; library 'XPORT_LIB'; ! ! ! Parse Stack Definition literal PAR_NO_SAVED_STATE = -3; !+ ! The fields PATSTK_SYMBOL and PATSTK_STATE must be at least the size of ! PAT_STATE_SYMBOL_TABLE_ALLOC and PAT_STATE_ACTION_TABLE_ALLOC respectively ! in PATDATA.REQ. !- $FIELD PATSTK_BASE = [$SUB_BLOCK ()], ! Placeholder to indicate base of token--uses no storage PATSTK_LOCATOR = [$INTEGER], %if PATBLSEXT_EXTRA_STACK_FIELD %then PATSTK_EXTRA_INFO = [$ADDRESS], %fi PATSTK_SYMBOL = [$SHORT_INTEGER], PATSTK_STATE = [$SHORT_INTEGER]; literal PATSTK_STR_SIZE = $FIELD_SET_SIZE*%upval; macro PATSTK_FIELDS = PATSTK_BASE, PATSTK_LOCATOR, %if PATBLSEXT_EXTRA_STACK_FIELD %then PATSTK_EXTRA_INFO, %fi PATSTK_SYMBOL, PATSTK_STATE %; macro PATSTK_STR = blockvector [LS_PARSE_STACK_SIZE, PATSTK_STR_SIZE/%upval] field (PATSTK_FIELDS) %; undeclare %quote $DESCRIPTOR; ! due to xport problem external PAT$STACK_P : ref PATSTK_STR; ! external routine PAT$PARSER; !++ ! FUNCTIONAL DESCRIPTION: ! ! PAT$PARSER is the parser. ! ! FORMAL PARAMETERS: ! ! STARTING_TOKEN_PTR - Pointer to initial token; if NULL ! then initial token is to be obtained ! from the lexical analyzer ! ! ANNOUNCE_ABBREVIATIONS - TRUE iff an error message should be ! printed when an abbreviation is corrected ! during error recovery. ! ! IMPLICIT INPUTS: ! ! NONE ! ! IMPLICIT OUTPUTS: ! ! NONE ! ! ROUTINE VALUE: ! ! TRUE - A compilation unit was parsed. ! FALSE - A compilation unit wasn't parsed. At end of file. ! ! SIDE EFFECTS: ! ! PAT$PARSER calls the lexical analyzer which reads the source ! file. ! !-- ! %if PATBLSEXT_DEBUGGING and PATBLSEXT_LOCAL_RECOVERY %then external routine PAT$DUMP_BACKUP_INFO : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PAT$DUMP_BACKUP_INFO dumps information useful in understanding ! the order in which error recovery will perform backup. ! ! FORMAL PARAMETERS: ! ! NONE ! !-- %fi ! %if PATBLSEXT_DEBUGGING %then external routine PAT$DUMP_PARSE_STACK : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PAT$DUMP_PARSE_STACK dumps the current parse stack. ! ! FORMAL PARAMETERS: ! ! NONE ! !-- %fi ! %if PATBLSEXT_DEBUGGING %then external routine PAT$DUMP_REDUCTION : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PAT$DUMP_REDUCTION does a symbolic display of the current ! reduction, including the contents of the current parse stack. ! ! FORMAL PARAMETERS: ! ! NONE ! !-- %fi ! %if PATBLSEXT_DEBUGGING %then external routine PAT$DUMP_TOKS : novalue; !++ ! FUNCTIONAL DESCRIPTION: ! ! PAT$DUMP_TOKS outputs several tokens and symbols which are relevant ! to the state of the parse. ! ! FORMAL PARAMETERS: ! ! NONE ! !-- %fi ! End of PATPARSER.REQ