view tests/agcl/parsifal/good/xml2.h @ 24:a4899cdfc2d6 default tip

Obfuscate the regexps to strip off the IBM compiler's copyright banners. I don't want bots scanning github to think they're real copyright notices because that could cause real problems.
author David A. Holland
date Mon, 13 Jun 2022 00:40:23 -0400
parents 13d2b8934445
children
line wrap: on
line source

#ifndef XML2_H
#define XML2_H

typedef enum {
  xml2_document_token = 1, xml2_prolog_token, xml2_element_token,
  xml2_Misc_token, xml2_SpaceChar_token = 7, xml2_S_token = 9,
  xml2_Name_token = 11, xml2_NameChar_token = 13, xml2_Names_token = 16,
  xml2_Nmtoken_token = 20, xml2_Nmtokens_token, xml2_EntityValue_token = 25,
  xml2_PEReference_token = 28, xml2_Reference_token,
  xml2_AttValue_token = 38, xml2_SystemLiteral_token = 45,
  xml2_PubidLiteral_token = 52, xml2_PubidChar_token,
  xml2_CharData_token = 56, xml2_Comment_token = 60, xml2_Char_token = 62,
  xml2_PI_token = 67, xml2_PITarget_token = 69, xml2_char_token,
  xml2_CDSect_token = 75, xml2_CDStart_token, xml2_CData_token,
  xml2_CDEnd_token, xml2_XMLDecl_token = 81, xml2_doctypedecl_token = 83,
  xml2_VersionInfo_token = 86, xml2_EncodingDecl_token,
  xml2_SDDecl_token = 89, xml2_Eq_token = 93, xml2_VersionNum_token,
  xml2_ExternalID_token = 100, xml2_markupdecl_token = 104,
  xml2_elementdecl_token = 110, xml2_AttlistDecl_token,
  xml2_EntityDecl_token, xml2_NotationDecl_token, xml2_extSubset_token,
  xml2_TextDecl_token, xml2_extSubsetDecl_token = 117,
  xml2_conditionalSect_token, xml2_Language_Id_token = 127,
  xml2_Langcode_token, xml2_Subcode_token = 130,
  xml2_ISO639Code_token = 134, xml2_IanaCode_token, xml2_UserCode_token,
  xml2_EmptyElemTag_token = 142, xml2_STag_token, xml2_content_token,
  xml2_ETag_token, xml2_Attribute_token = 147
} xml2_token_type;

typedef struct xml2_pcb_struct{
  xml2_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[11], rx, fx;
  const unsigned char *key_sp;
  int save_index, key_state;
  char ag_msg[82];
} xml2_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 xml2_pcb_type xml2_pcb;
void init_xml2(void);
void xml2(void);
#endif