view tests/agcl/oldagsrc/good/dsl.h @ 23:cac4c76600eb

Update lint ok file for recent change.
author David A. Holland
date Mon, 13 Jun 2022 00:17:10 -0400
parents 13d2b8934445
children
line wrap: on
line source

#ifndef DSL_H
#define DSL_H

typedef union {
  long alignment;
  char ag_vt_2[sizeof(int)];
  char ag_vt_3[sizeof(long)];
  char ag_vt_4[sizeof(char *)];
  char ag_vt_5[sizeof(unsigned)];
  char ag_vt_6[sizeof(screen_descriptor *)];
  char ag_vt_7[sizeof(query_item *)];
} dsl_vs_type;

typedef enum {
  dsl_name_token = 1, dsl_ws_token, dsl_word_token = 10, dsl_white_token,
  dsl_comment_token, dsl_comment_head_token, dsl_not_eol_token = 19,
  dsl_script_file_token = 22, dsl_execution_block_token,
  dsl_declaration_token, dsl_eof_token = 28,
  dsl_parameter_string_token = 31, dsl_string_token = 33,
  dsl_param_word_token = 35, dsl_text_char_token = 37,
  dsl_action_text_token, dsl_action_text_head_token,
  dsl_operator_token = 42, dsl_paren_string_chars_token,
  dsl_paren_string_char_token = 46, dsl_not_paren_token,
  dsl_string_chars_token = 49, dsl_string_char_token = 51,
  dsl_not_double_quote_token, dsl_escape_sequence_token,
  dsl_octal_escape_token = 65, dsl_hex_escape_token, dsl_one_octal_token,
  dsl_two_octal_token, dsl_three_octal_token, dsl_hex_number_token = 73,
  dsl_hex_digit_token, dsl_command_token, dsl_identifier_token,
  dsl_parameters_token, dsl_piped_command_token = 80,
  dsl_command_sequence_token = 86, dsl_if_sequence_token,
  dsl_statement_token = 89, dsl_if_statement_token = 91,
  dsl_if_condition_token, dsl_conditional_exp_token = 94,
  dsl_assignment_token, dsl_for_statement_token,
  dsl_screen_description_token, dsl_while_statement_token,
  dsl_undeclared_variable_token = 100, dsl_integer_variable_token = 102,
  dsl_string_variable_token = 105, dsl_string_exp_token,
  dsl_primary_exp_token = 108, dsl_letter_token = 118, dsl_digit_token,
  dsl_logical_or_exp_token, dsl_logical_and_exp_token = 123,
  dsl_inclusive_or_exp_token = 125, dsl_exclusive_or_exp_token = 127,
  dsl_and_exp_token, dsl_equality_exp_token = 130,
  dsl_relational_exp_token = 132, dsl_shift_exp_token = 135,
  dsl_additive_exp_token = 138, dsl_multiplicative_exp_token = 140,
  dsl_unary_exp_token = 143, dsl_nonzero_token = 146,
  dsl_string_term_token = 150, dsl_string_element_token,
  dsl_numeric_name_token, dsl_built_in_name_token,
  dsl_built_in_argument_token, dsl_string_name_token,
  dsl_undefined_name_token, dsl_hex_constant_token = 159,
  dsl_octal_constant_token, dsl_decimal_constant_token,
  dsl_char_constant_element_token = 170, dsl_not_single_quote_token,
  dsl_screen_items_token, dsl_formula_token = 175, dsl_color_spec_token,
  dsl_query_line_token = 182, dsl_button_line_token,
  dsl_formula_element_token = 191, dsl_eol_token = 198,
  dsl_paren_string_token, dsl_string_literal_token, dsl_literal_token,
  dsl_literals_token = 222, dsl_integer_constant_token = 244,
  dsl_character_constant_token, dsl__last_token = 262
} dsl_token_type;

typedef struct dsl_pcb_struct{
  dsl_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];
  dsl_vs_type vs[128];
  int ag_ap;
  const char *error_message;
  char read_flag;
  char exit_flag;
  action_pointer input_context;
  action_pointer cs[128];
  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;
} dsl_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 dsl_pcb_type dsl_pcb;
void init_dsl(void);
void dsl(void);
#endif