comparison anagram/agcore/cf.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 5581ef01f993
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 #ifndef CF_H_1198348333
2 #define CF_H_1198348333
3
4 typedef enum {
5 cf_config_file_token = 1, cf_equals_token, cf_space_token = 4,
6 cf_minus_token = 6, cf_plus_token = 8, cf_tilde_token = 10,
7 cf_left_parenthesis_token = 12, cf_right_parenthesis_token = 14,
8 cf_blank_token = 16, cf_global_parameter_token = 19, cf_end_of_line_token,
9 cf_eof_token = 24, cf_name_token, cf_data_type_token,
10 cf_keyword_string_token, cf_number_token, cf_abstract_declarator_token,
11 cf_indirect_data_type_token, cf_direct_abstract_declarator_token,
12 cf_pointer_token = 33, cf_star_token, cf_name_string_token = 36,
13 cf_letter_token, cf_blank_char_token = 39, cf_c_comment_token,
14 cf_continuation_token, cf_comment_token, cf_next_line_token,
15 cf_carriage_return_token, cf_newline_token = 46, cf_white_token,
16 cf_vertical_space_token, cf_decimal_number_token = 53,
17 cf_octal_number_token = 56, cf_hex_number_token = 59,
18 cf_simple_number_token = 63, cf_sign_token,
19 cf_keyword_string_head_token = 66, cf_string_token, cf_double_quote_token,
20 cf_string_A_token, cf_string_B_token, cf_string_C_token,
21 cf_string_char_token, cf_simple_string_char_token,
22 cf_escape_sequence_token, cf_three_octal_token = 86, cf_one_octal_token,
23 cf_backslash_token, cf_two_octal_token, cf_octal_escape_token,
24 cf_hex_escape_token = 92, cf_any_digit_token = 94,
25 cf_nonoctal_digit_token, cf_c_comment_text_token
26 } cf_token_type;
27
28 typedef struct cf_pcb_struct{
29 cf_token_type token_number, reduction_token, error_frame_token;
30 int input_code;
31 int input_value;
32 int line, column;
33 int ssx, sn, error_frame_ssx;
34 int drt, dssx, dsn;
35 int ss[128];
36 int vs[128];
37 int ag_ap;
38 const char *error_message;
39 char read_flag;
40 char exit_flag;
41 cint input_context;
42 cint cs[128];
43 int bts[128], btsx;
44 int (* const *gt_procs)(void);
45 int (* const *r_procs)(void);
46 int (* const *s_procs)(void);
47 unsigned char * pointer;
48 unsigned char * la_ptr;
49 const unsigned char *key_sp;
50 int save_index, key_state;
51 int ag_error_depth, ag_min_depth, ag_tmp_depth;
52 int ag_rss[2*128], ag_lrss;
53 char ag_msg[82];
54 const int *ag_dtl;
55 int ag_dsn;
56 int ag_resynch_active;
57 } cf_pcb_type;
58
59 #ifndef PRULE_CONTEXT
60 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
61 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
62 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
63 #endif
64
65 #ifndef AG_RUNNING_CODE
66 /* PCB.exit_flag values */
67 #define AG_RUNNING_CODE 0
68 #define AG_SUCCESS_CODE 1
69 #define AG_SYNTAX_ERROR_CODE 2
70 #define AG_REDUCTION_ERROR_CODE 3
71 #define AG_STACK_ERROR_CODE 4
72 #define AG_SEMANTIC_ERROR_CODE 5
73 #endif
74 void init_cf(void);
75 void cf(void);
76
77 int cf_value(void);
78 #endif
79