comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 #ifndef CC-CRASH_H
2 #define CC-CRASH_H
3
4 typedef union {
5 long alignment;
6 char ag_vt_2[sizeof(int)];
7 char ag_vt_3[sizeof(long)];
8 char ag_vt_4[sizeof(char *)];
9 char ag_vt_5[sizeof(unsigned)];
10 char ag_vt_6[sizeof(screen_descriptor *)];
11 char ag_vt_7[sizeof(query_item *)];
12 } cc-crash_vs_type;
13
14 typedef enum {
15 cc-crash_ws_token = 1, cc-crash_white_token = 9, cc-crash_comment_token,
16 cc-crash_comment_head_token, cc-crash_not_eol_token = 17,
17 cc-crash_script_file_token = 20, cc-crash_execution_block_token,
18 cc-crash_declaration_token, cc-crash_eof_token = 26, cc-crash_word_token,
19 cc-crash_undeclared_variable_token, cc-crash_parameter_string_token = 31,
20 cc-crash_string_token = 33, cc-crash_param_word_token = 35,
21 cc-crash_text_char_token, cc-crash_action_text_token,
22 cc-crash_action_text_head_token, cc-crash_action_word_token = 41,
23 cc-crash_operator_token, cc-crash_paren_string_chars_token,
24 cc-crash_paren_string_char_token = 46, cc-crash_not_paren_token,
25 cc-crash_string_chars_token = 49, cc-crash_string_char_token = 51,
26 cc-crash_not_double_quote_token, cc-crash_escape_sequence_token,
27 cc-crash_octal_escape_token = 65, cc-crash_hex_escape_token,
28 cc-crash_one_octal_token, cc-crash_two_octal_token,
29 cc-crash_three_octal_token, cc-crash_hex_number_token = 73,
30 cc-crash_hex_digit_token, cc-crash_command_token,
31 cc-crash_identifier_token, cc-crash_parameters_token,
32 cc-crash_piped_command_token = 80, cc-crash_command_sequence_token = 86,
33 cc-crash_if_sequence_token, cc-crash_statement_token = 89,
34 cc-crash_if_statement_token = 91, cc-crash_if_condition_token,
35 cc-crash_conditional_exp_token = 94, cc-crash_assignment_token,
36 cc-crash_for_statement_token, cc-crash_screen_description_token,
37 cc-crash_while_statement_token, cc-crash_integer_variable_token = 101,
38 cc-crash_string_variable_token = 104, cc-crash_string_exp_token,
39 cc-crash_primary_exp_token = 107, cc-crash_name_token = 110,
40 cc-crash_letter_token = 118, cc-crash_digit_token,
41 cc-crash_logical_or_exp_token, cc-crash_logical_and_exp_token = 123,
42 cc-crash_inclusive_or_exp_token = 125,
43 cc-crash_exclusive_or_exp_token = 127, cc-crash_and_exp_token,
44 cc-crash_equality_exp_token = 130, cc-crash_relational_exp_token = 132,
45 cc-crash_shift_exp_token = 135, cc-crash_additive_exp_token = 138,
46 cc-crash_multiplicative_exp_token = 140, cc-crash_unary_exp_token = 143,
47 cc-crash_nonzero_token = 146, cc-crash_string_term_token = 150,
48 cc-crash_string_element_token, cc-crash_numeric_name_token,
49 cc-crash_built_in_name_token, cc-crash_built_in_argument_token,
50 cc-crash_string_name_token, cc-crash_undefined_name_token,
51 cc-crash_hex_constant_token = 159, cc-crash_octal_constant_token,
52 cc-crash_decimal_constant_token,
53 cc-crash_char_constant_element_token = 170,
54 cc-crash_not_single_quote_token, cc-crash_screen_items_token,
55 cc-crash_formula_token = 175, cc-crash_color_spec_token,
56 cc-crash_query_line_token = 182, cc-crash_button_line_token,
57 cc-crash_formula_element_token = 191, cc-crash_eol_token = 198,
58 cc-crash_paren_string_token, cc-crash_string_literal_token,
59 cc-crash_literal_token = 206, cc-crash_literals_token = 222,
60 cc-crash_integer_constant_token = 244, cc-crash_character_constant_token,
61 cc-crash__last_token = 262
62 } cc-crash_token_type;
63
64 typedef struct cc-crash_pcb_struct{
65 cc-crash_token_type token_number, reduction_token, error_frame_token;
66 int input_code;
67 int input_value;
68 int line, column;
69 int ssx, sn, error_frame_ssx;
70 int drt, dssx, dsn;
71 int ss[128];
72 cc-crash_vs_type vs[128];
73 int ag_ap;
74 const char *error_message;
75 char read_flag;
76 char exit_flag;
77 action_pointer input_context;
78 action_pointer cs[128];
79 int bts[128], btsx;
80 unsigned char * pointer;
81 unsigned char * la_ptr;
82 const unsigned char *key_sp;
83 int save_index, key_state;
84 char ag_msg[82];
85 const int *ag_dtl;
86 int ag_dsn;
87 } cc-crash_pcb_type;
88
89 #ifndef PRULE_CONTEXT
90 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
91 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
92 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
93 #endif
94
95 #ifndef AG_RUNNING_CODE
96 /* PCB.exit_flag values */
97 #define AG_RUNNING_CODE 0
98 #define AG_SUCCESS_CODE 1
99 #define AG_SYNTAX_ERROR_CODE 2
100 #define AG_REDUCTION_ERROR_CODE 3
101 #define AG_STACK_ERROR_CODE 4
102 #define AG_SEMANTIC_ERROR_CODE 5
103 #endif
104
105 extern cc-crash_pcb_type cc-crash_pcb;
106 void init_cc-crash(void);
107 void cc-crash(void);
108 #endif
109