/*  error recovery operations
{*  last modification:	24.01.92  16:32   }

 *  tim 24.01.92:  ALTLISTBEG and ALTLISTEND moved from errecy.c
*/

#define DECL          1
#define STM           2
#define SYNTAX        3
#define MAXUN         4     /* Maximum of syntactic units in parser */
#define MAX_RECUR   128


typedef struct  {
		   boolean   stop[ MAXUN];
		   shortint  stackptr;   /* points to last stack element */
		   shortint  synspec[MAX_RECUR];
					    /* specifying syntactic unit */
		 }   palo ;        /* locating parser for error recovery */

global  palo  parsloc;

/* global binptr  binqueue;    /* head of list of unparsed symbols due to */
/* (declared in bintab) */     /* error;list delimited by stop symbols */


#ifdef LINT_ARGS
global void       initparsloc(void);
global void       setparsloc(shortint, symctype);
global void       setstoppars (shortint);
global shortint   get_parsloc( void);
global void       pop_parsloc(void);
global boolean    stoppars (shortint);
global void       contpars (shortint);
global boolean    stop_chk (void);
global void       resetparsloc(shortint);
global void       finish_errecy(void);

global  void     ery_loahd (shortint);


#else

global void       initparsloc();
global void       setparsloc();
global void       setstoppars();
global shortint   get_parsloc();
global void       pop_parsloc();
global boolean    stoppars ();
global void       contpars ();
global boolean    stop_chk ();
global void       resetparsloc();
global void       finish_errecy();

global  void     ery_loahd ();


#endif

/* This block belongs to operations on patterns */

#define MAXPAT    200
#define ALTLISTBEG -2             /* marks beginning of an alternative */ 
                                                  /* list in a pattern */
#define ALTLISTEND -3                   /* marks end of an alternative */ 
                                                  /* list in a pattern */

typedef struct  {
		   long symc;      /* Symbol code of element */
		   boolean  alternat;  /* flag for alternative element */
				       /* in pattern */
		   shortint jumpindex;         /* used for iterations, */
			    /* alternatives  or alternative lists in a */
				  /* pattern or to find end of pattern */
		} pat_elem, *patternpt;

global patternpt  pat_list[MAXPAT];                  /* list of patterns */
global shortint   pat_desc_li[MAXPAT];       /* contains descriptors for */
				   /* corresponding elements of pat_list */
				  /* thus facilitating match operations */


