view tests/agcl/parsifal/good/sql.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 SQL_H
#define SQL_H

typedef enum {
  sql_CHAR_token = 3, sql_DECIMAL_token = 8, sql_DECLARE_SECTION_token = 11,
  sql_DELETE_FROM_token = 14, sql_NOT_NULL_token = 17,
  sql_PACKAGE_token = 20, sql_PRIMARY_KEY_token = 23,
  sql_USING_DESCRIPTOR_token = 26, sql_white_space_token,
  sql_blank_token = 33, sql_identifier_token = 46,
  sql_qualified_identifier_token, sql_any_identifier_token = 49,
  sql_letter_token, sql_delimited_identifier_text_token = 53,
  sql_delimited_identifier_char_token, sql_host_identifier_token = 57,
  sql_descriptor_name_token = 60, sql_host_variable_token = 62,
  sql_expression_token, sql_term_token, sql_addop_token,
  sql_factor_token = 68, sql_multop_token, sql_special_register_token = 72,
  sql_simple_factor_token, sql_duration_token, sql_sign_token,
  sql_function_token, sql_constant_token = 79, sql_column_name_token,
  sql_floating_point_constant_token, sql_signed_integer_token = 84,
  sql_character_string_char_token = 87, sql_predicate_token = 106,
  sql_comparison_operator_token, sql_comparand_token,
  sql_between_operator_token, sql_similarity_operator_token = 112,
  sql_like_operand_token, sql_existence_operator_token,
  sql_set_designation_token, sql_fullselect_token = 117,
  sql_quantifier_token = 126, sql_simple_search_condition_token = 138,
  sql_search_condition_token, sql_logical_op_token,
  sql_aggregate_function_token = 142, sql_count_function_token,
  sql_char_function_token, sql_function_name_token, sql_args_token,
  sql_aggregate_function_name_token, sql_distinct_column_name_token = 153,
  sql_date_type_token = 156, sql_subselect_token = 165,
  sql_select_clause_token, sql_from_clause_token, sql_where_clause_token,
  sql_group_by_clause_token = 170, sql_having_clause_token = 172,
  sql_select_list_token = 176, sql_select_item_token = 178,
  sql_from_list_token, sql_from_item_token, sql_identifier_list_token = 184,
  sql_paren_identifier_list_token, sql_simple_select_token = 187,
  sql_set_operator_token, sql_select_statement_token = 192,
  sql_order_by_clause_token, sql_fetch_clause_token,
  sql_update_clause_token, sql_sort_list_token = 197, sql_sort_item_token,
  sql_sort_direction_token, sql_grammar_token = 207, sql_statements_token,
  sql_eof_token = 210, sql_drop_hack_token, sql_statement_token,
  sql_alter_table_item_list_token = 215, sql_comment_object_token = 222,
  sql_create_statement_token = 226, sql_delete_statement_token = 232,
  sql_execute_statement_token = 236, sql_fetch_statement_token,
  sql_privileges_token = 239, sql_privileged_object_token,
  sql_grantee_token = 242, sql_insert_statement_token = 247,
  sql_open_statement_token = 253, sql_select_into_statement_token = 258,
  sql_update_statement_token, sql_privileged_object_type_token = 268,
  sql_alter_table_item_token = 271, sql_alter_column_definition_token = 273,
  sql_referential_constraint_token, sql_data_type_token = 279,
  sql_alter_column_attribute_list_token, sql_alter_column_attribute_token,
  sql_references_token = 284, sql_alter_column_identifier_token,
  sql_referential_constraint_head_token, sql_rules_token = 288,
  sql_delete_rule_token, sql_create_table_list_token = 306,
  sql_create_table_item_token = 312, sql_create_column_definition_token,
  sql_create_column_attribute_token, sql_where_current_clause_token,
  sql_host_variable_list_token = 317, sql_privilege_list_token = 322,
  sql_privilege_token, sql_value_list_token = 332, sql_value_token = 334,
  sql_set_clause_token = 336, sql_conditioned_set_clause_token,
  sql_assignment_list_token, sql_assignment_token,
  sql_ordinary_identifier_token = 365, sql_delimited_identifier_token,
  sql_integer_token = 375, sql_decimal_constant_token,
  sql_character_string_constant_token, sql_digit_token = 515
} sql_token_type;

typedef struct sql_pcb_struct{
  sql_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[13], rx, fx;
  const unsigned char *key_sp;
  int save_index, key_state;
  char ag_msg[82];
} sql_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 sql_pcb_type sql_pcb;
void init_sql(void);
void sql(void);
#endif