Mercurial > ~dholland > hg > ag > index.cgi
diff tests/agcl/oldagsrc/good/cc-crash.h @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/agcl/oldagsrc/good/cc-crash.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,109 @@ +#ifndef CC-CRASH_H +#define CC-CRASH_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 *)]; +} cc-crash_vs_type; + +typedef enum { + cc-crash_ws_token = 1, cc-crash_white_token = 9, cc-crash_comment_token, + cc-crash_comment_head_token, cc-crash_not_eol_token = 17, + cc-crash_script_file_token = 20, cc-crash_execution_block_token, + cc-crash_declaration_token, cc-crash_eof_token = 26, cc-crash_word_token, + cc-crash_undeclared_variable_token, cc-crash_parameter_string_token = 31, + cc-crash_string_token = 33, cc-crash_param_word_token = 35, + cc-crash_text_char_token, cc-crash_action_text_token, + cc-crash_action_text_head_token, cc-crash_action_word_token = 41, + cc-crash_operator_token, cc-crash_paren_string_chars_token, + cc-crash_paren_string_char_token = 46, cc-crash_not_paren_token, + cc-crash_string_chars_token = 49, cc-crash_string_char_token = 51, + cc-crash_not_double_quote_token, cc-crash_escape_sequence_token, + cc-crash_octal_escape_token = 65, cc-crash_hex_escape_token, + cc-crash_one_octal_token, cc-crash_two_octal_token, + cc-crash_three_octal_token, cc-crash_hex_number_token = 73, + cc-crash_hex_digit_token, cc-crash_command_token, + cc-crash_identifier_token, cc-crash_parameters_token, + cc-crash_piped_command_token = 80, cc-crash_command_sequence_token = 86, + cc-crash_if_sequence_token, cc-crash_statement_token = 89, + cc-crash_if_statement_token = 91, cc-crash_if_condition_token, + cc-crash_conditional_exp_token = 94, cc-crash_assignment_token, + cc-crash_for_statement_token, cc-crash_screen_description_token, + cc-crash_while_statement_token, cc-crash_integer_variable_token = 101, + cc-crash_string_variable_token = 104, cc-crash_string_exp_token, + cc-crash_primary_exp_token = 107, cc-crash_name_token = 110, + cc-crash_letter_token = 118, cc-crash_digit_token, + cc-crash_logical_or_exp_token, cc-crash_logical_and_exp_token = 123, + cc-crash_inclusive_or_exp_token = 125, + cc-crash_exclusive_or_exp_token = 127, cc-crash_and_exp_token, + cc-crash_equality_exp_token = 130, cc-crash_relational_exp_token = 132, + cc-crash_shift_exp_token = 135, cc-crash_additive_exp_token = 138, + cc-crash_multiplicative_exp_token = 140, cc-crash_unary_exp_token = 143, + cc-crash_nonzero_token = 146, cc-crash_string_term_token = 150, + cc-crash_string_element_token, cc-crash_numeric_name_token, + cc-crash_built_in_name_token, cc-crash_built_in_argument_token, + cc-crash_string_name_token, cc-crash_undefined_name_token, + cc-crash_hex_constant_token = 159, cc-crash_octal_constant_token, + cc-crash_decimal_constant_token, + cc-crash_char_constant_element_token = 170, + cc-crash_not_single_quote_token, cc-crash_screen_items_token, + cc-crash_formula_token = 175, cc-crash_color_spec_token, + cc-crash_query_line_token = 182, cc-crash_button_line_token, + cc-crash_formula_element_token = 191, cc-crash_eol_token = 198, + cc-crash_paren_string_token, cc-crash_string_literal_token, + cc-crash_literal_token = 206, cc-crash_literals_token = 222, + cc-crash_integer_constant_token = 244, cc-crash_character_constant_token, + cc-crash__last_token = 262 +} cc-crash_token_type; + +typedef struct cc-crash_pcb_struct{ + cc-crash_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]; + cc-crash_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; +} cc-crash_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 cc-crash_pcb_type cc-crash_pcb; +void init_cc-crash(void); +void cc-crash(void); +#endif +