view tests/agcl/parsifal/good/xml1.h @ 17:12171da8943f

Don't refer to CVS.
author David A. Holland
date Tue, 31 May 2022 01:56:37 -0400
parents 13d2b8934445
children
line wrap: on
line source

#ifndef XML1_H
#define XML1_H

typedef enum {
  xml1_document_token = 1, xml1_prolog_token, xml1_element_token,
  xml1_Misc_token, xml1_S_token = 7, xml1_Name_token = 10,
  xml1_NameChar_token = 12, xml1_Names_token = 15, xml1_Nmtoken_token = 19,
  xml1_Nmtokens_token, xml1_EntityValue_token = 24,
  xml1_PEReference_token = 27, xml1_Reference_token,
  xml1_AttValue_token = 37, xml1_SystemLiteral_token = 44,
  xml1_PubidLiteral_token = 51, xml1_PubidChar_token,
  xml1_CharData_token = 55, xml1_Comment_token = 59, xml1_Char_token = 61,
  xml1_PI_token = 66, xml1_PITarget_token = 68, xml1_char_token,
  xml1_CDSect_token = 74, xml1_CDStart_token, xml1_CData_token,
  xml1_CDEnd_token, xml1_XMLDecl_token = 80, xml1_doctypedecl_token = 82,
  xml1_VersionInfo_token = 85, xml1_EncodingDecl_token,
  xml1_SDDecl_token = 88, xml1_Eq_token = 92, xml1_VersionNum_token,
  xml1_ExternalID_token = 99, xml1_markupdecl_token = 102,
  xml1_elementdecl_token = 108, xml1_AttlistDecl_token,
  xml1_EntityDecl_token, xml1_NotationDecl_token
} xml1_token_type;

typedef struct xml1_pcb_struct{
  xml1_token_type token_number, reduction_token, error_frame_token;
  int input_code;
  int input_value;
  int line, column;
  int ssx, sn, error_frame_ssx;
  int drt, dssx, dsn;
  int ss[128];
  int vs[128];
  int ag_ap;
  const char *error_message;
  char read_flag;
  char exit_flag;
  int bts[128], btsx;
  int lab[10], rx, fx;
  const unsigned char *key_sp;
  int save_index, key_state;
  char ag_msg[82];
} xml1_pcb_type;

#ifndef PRULE_CONTEXT
#define PRULE_CONTEXT(pcb)  (&((pcb).cs[(pcb).ssx]))
#define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
#define PCONTEXT(pcb)       ((pcb).cs[(pcb).ssx])
#endif

#ifndef AG_RUNNING_CODE
/* PCB.exit_flag values */
#define AG_RUNNING_CODE         0
#define AG_SUCCESS_CODE         1
#define AG_SYNTAX_ERROR_CODE    2
#define AG_REDUCTION_ERROR_CODE 3
#define AG_STACK_ERROR_CODE     4
#define AG_SEMANTIC_ERROR_CODE  5
#endif

extern xml1_pcb_type xml1_pcb;
void init_xml1(void);
void xml1(void);
#endif