view tests/agcl/oldagsrc/good/asilbug1.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 ASILBUG1_H
#define ASILBUG1_H

typedef union {
  double alignment;
  char ag_vt_2[sizeof(int)];
  char ag_vt_4[sizeof(double)];
} asil_vs_type;

typedef enum {
  asil_white_space_token = 1, asil_input_string_token = 4,
  asil_statements_token, asil_eof_token = 7, asil_statement_text_token,
  asil_statement_char_token, asil_balanced_parens_token,
  asil_balanced_braces_token, asil_statement_token = 17,
  asil_unconditional_statement_token, asil_conditional_statement_token,
  asil_skip_statement_token, asil_skip_unconditional_statement_token,
  asil_skip_conditional_statement_token, asil_expression_token,
  asil_gather_unconditional_while_token = 25, asil_while_loop_token,
  asil_gather_conditional_while_token = 30, asil_true_if_clause_token,
  asil_false_if_clause_token, asil_conditional_expression_token = 35,
  asil_logical_or_expression_token = 41,
  asil_logical_and_expression_token = 44,
  asil_equality_expression_token = 46,
  asil_relational_expression_token = 48,
  asil_additive_expression_token = 51,
  asil_multiplicative_expression_token = 56, asil_factor_token = 59,
  asil_primary_token = 62, asil_blank_token = 67,
  asil_simple_real_token = 78, asil_exponent_token = 81,
  asil_integer_part_token, asil_fraction_part_token = 84,
  asil_name_string_token = 87, asil_letter_token,
  asil_false_condition_token = 101, asil_true_condition_token = 103,
  asil_name_token = 107, asil_real_token = 127, asil_digit_token = 133
} asil_token_type;

typedef struct asil_pcb_struct{
  asil_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];
  asil_vs_type vs[128];
  int ag_ap;
  const char *error_message;
  char read_flag;
  char exit_flag;
  int bts[128], btsx;
  unsigned char * pointer;
  unsigned char * la_ptr;
  const unsigned char *key_sp;
  int save_index, key_state;
  char ag_msg[82];
  const  int *ag_dtl;
  int ag_dsn;
} asil_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 asil_pcb_type asil_pcb;
void init_asil(void);
void asil(void);
#endif