comparison tests/agcl/oldagsrc/good/cf-old.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 CF-OLD_H
2 #define CF-OLD_H
3
4 typedef union {
5 long alignment;
6 char ag_vt_2[sizeof(int)];
7 char ag_vt_4[sizeof(unsigned long)];
8 } cf-old_vs_type;
9
10 typedef enum {
11 cf-old_config_file_token = 1, cf-old_equals_token, cf-old_space_token = 4,
12 cf-old_minus_token = 6, cf-old_plus_token = 8, cf-old_tilde_token = 10,
13 cf-old_left_parenthesis_token = 12, cf-old_right_parenthesis_token = 14,
14 cf-old_blank_token = 16, cf-old_global_parameter_token = 19,
15 cf-old_end_of_line_token, cf-old_eof_token = 24, cf-old_name_token,
16 cf-old_data_type_token, cf-old_keyword_string_token, cf-old_number_token,
17 cf-old_trial_copy_code_token = 32, cf-old_abstract_declarator_token = 34,
18 cf-old_indirect_data_type_token, cf-old_direct_abstract_declarator_token,
19 cf-old_pointer_token = 38, cf-old_star_token,
20 cf-old_name_string_token = 41, cf-old_letter_token,
21 cf-old_blank_char_token = 44, cf-old_c_comment_token,
22 cf-old_continuation_token, cf-old_comment_token, cf-old_next_line_token,
23 cf-old_carriage_return_token, cf-old_newline_token = 51,
24 cf-old_white_token, cf-old_vertical_space_token,
25 cf-old_decimal_number_token = 58, cf-old_octal_number_token = 60,
26 cf-old_hex_number_token = 63, cf-old_simple_number_token = 67,
27 cf-old_sign_token, cf-old_keyword_string_head_token = 70,
28 cf-old_string_token, cf-old_double_quote_token, cf-old_string_A_token,
29 cf-old_string_B_token, cf-old_string_C_token, cf-old_string_char_token,
30 cf-old_simple_string_char_token, cf-old_escape_sequence_token,
31 cf-old_three_octal_token = 90, cf-old_one_octal_token,
32 cf-old_backslash_token, cf-old_two_octal_token, cf-old_octal_escape_token,
33 cf-old_hex_escape_token = 96, cf-old_any_digit_token = 98,
34 cf-old_nonoctal_digit_token, cf-old_c_comment_text_token
35 } cf-old_token_type;
36
37 typedef struct cf-old_pcb_struct{
38 cf-old_token_type token_number, reduction_token, error_frame_token;
39 int input_code;
40 int input_value;
41 int line, column;
42 int ssx, sn, error_frame_ssx;
43 int drt, dssx, dsn;
44 int ss[128];
45 cf-old_vs_type vs[128];
46 int ag_ap;
47 const char *error_message;
48 char read_flag;
49 char exit_flag;
50 cint input_context;
51 cint cs[128];
52 int bts[128], btsx;
53 int (near * near const *gt_procs)(void);
54 int (near * near const *r_procs)(void);
55 int (near * near const *s_procs)(void);
56 unsigned char * pointer;
57 unsigned char * la_ptr;
58 const unsigned char *key_sp;
59 int save_index, key_state;
60 int ag_error_depth, ag_min_depth, ag_tmp_depth;
61 int ag_rss[2*128], ag_lrss;
62 char ag_msg[82];
63 const int *ag_dtl;
64 int ag_dsn;
65 int ag_resynch_active;
66 } cf-old_pcb_type;
67
68 #ifndef PRULE_CONTEXT
69 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
70 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
71 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
72 #endif
73
74 #ifndef AG_RUNNING_CODE
75 /* PCB.exit_flag values */
76 #define AG_RUNNING_CODE 0
77 #define AG_SUCCESS_CODE 1
78 #define AG_SYNTAX_ERROR_CODE 2
79 #define AG_REDUCTION_ERROR_CODE 3
80 #define AG_STACK_ERROR_CODE 4
81 #define AG_SEMANTIC_ERROR_CODE 5
82 #endif
83 void init_cf-old(void);
84 void cf-old(void);
85
86 int cf-old_value(void);
87 #endif
88