view tests/agcl/parsifal/good/ss-kb.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 SS-KB_H
#define SS-KB_H

typedef enum {
  ss-kb_file_error_message_token = 1, ss-kb_goto_query_token,
  ss-kb_load_name_query_token, ss-kb_no_such_file_message_token,
  ss-kb_overwrite_query_token, ss-kb_save_changes_query_token,
  ss-kb_save_name_query_token, ss-kb_print_file_query_token,
  ss-kb_block_query_token, ss-kb_decimals_query_token,
  ss-kb_bad_decimals_message_token, ss-kb_grammar_token,
  ss-kb_top_level_command_token, ss-kb_eof_token = 16,
  ss-kb_recalc_request_token, ss-kb_utility_menu_token,
  ss-kb_main_menu_token = 20, ss-kb_edit_request_token = 22,
  ss-kb_edit_text_token, ss-kb_return_token, ss-kb_escape_token,
  ss-kb_delete_request_token, ss-kb_page_up_token, ss-kb_page_down_token,
  ss-kb_control_left_token, ss-kb_control_right_token, ss-kb_home_token,
  ss-kb_end_token, ss-kb_up_token, ss-kb_down_token, ss-kb_left_token,
  ss-kb_right_token, ss-kb_load_file_token, ss-kb_save_file_token,
  ss-kb_clear_spreadsheet_token, ss-kb_format_token, ss-kb_exit_token,
  ss-kb_error_token, ss-kb_goto_token, ss-kb_column_menu_token,
  ss-kb_column_width_token = 47, ss-kb_row_menu_token, ss-kb_any_menu_token,
  ss-kb_print_menu_token, ss-kb_print_file_name_token = 52,
  ss-kb_spreadsheet_menu_token, ss-kb_format_menu_token,
  ss-kb_block_token = 56, ss-kb_digits_spec_token = 58,
  ss-kb_label_menu_token, ss-kb_how_token, ss-kb_bad_digits_spec_token = 63,
  ss-kb_edit_number_token, ss-kb_F1_token, ss-kb_delete_token,
  ss-kb_cell_name_token, ss-kb_column_width_request_token,
  ss-kb_bad_cell_name_token = 70, ss-kb_bad_block_token,
  ss-kb_exit_request_token, ss-kb_save_changes_token,
  ss-kb_alt_x_token = 75, ss-kb_load_spreadsheet_token,
  ss-kb_save_spreadsheet_token = 78, ss-kb_not_changed_token,
  ss-kb_changed_token, ss-kb_no_token, ss-kb_yes_token,
  ss-kb_write_file_token = 84, ss-kb_old_file_token, ss-kb_new_file_token,
  ss-kb_file_error_token, ss-kb_any_key_token,
  ss-kb_clear_spreadsheet_request_token, ss-kb_F2_token = 95,
  ss-kb_text_character_token = 100, ss-kb_edit_key_token, ss-kb_digit_token,
  ss-kb_backspace_token
} ss-kb_token_type;

typedef struct ss-kb_pcb_struct{
  ss-kb_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;
  const  int *ag_dtl;
  int ag_dsn;
} ss-kb_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 ss-kb_pcb_type ss-kb_pcb;
void init_ss-kb(void);
void ss-kb(void);
#endif