Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/parsifal/good/rfc822a.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 RFC822A_H | |
2 #define RFC822A_H | |
3 | |
4 typedef enum { | |
5 rfc822a_message_token = 1, rfc822a_CRLF_token, rfc822a_atom_token, | |
6 rfc822a_word_token, rfc822a_linear_space_token, rfc822a_number_token = 8, | |
7 rfc822a_address_token, rfc822a_mailbox_token, rfc822a_group_token, | |
8 rfc822a_addr_spec_token, rfc822a_local_part_token, | |
9 rfc822a_domain_token = 15, rfc822a_ATOM_CHAR_token, | |
10 rfc822a_authentic_token, rfc822a_SPACE_token = 22, | |
11 rfc822a_multiple_mailboxes_token, rfc822a_comment_token = 26, | |
12 rfc822a_comment_choice_token, rfc822a_ctext_token, | |
13 rfc822a_quoted_pair_token, rfc822a_linear_white_space_token = 32, | |
14 rfc822a_date_token, rfc822a_day_numb_token, rfc822a_month_token, | |
15 rfc822a_year_token, rfc822a_DIGIT_token, rfc822a_dates_token, | |
16 rfc822a_orig_date_token, rfc822a_resent_date_token, | |
17 rfc822a_date_time_token, rfc822a_day_token, rfc822a_time_token = 45, | |
18 rfc822a_delimeters_token = 53, rfc822a_specials_token, | |
19 rfc822a_destination_token, rfc822a_addresses_token = 57, | |
20 rfc822a_multiple_sub_domains_token = 64, rfc822a_sub_domain_token, | |
21 rfc822a_domain_literal_token = 67, rfc822a_literal_fill_token = 69, | |
22 rfc822a_dtext_token = 72, rfc822a_domain_ref_token, | |
23 rfc822a_field_token = 75, rfc822a_field_name_token, | |
24 rfc822a_field_body_token, rfc822a_fields_token = 79, | |
25 rfc822a_fields_makeup_token, rfc822a_source_token, | |
26 rfc822a_optional_field_token, rfc822a_field_body_contents_token, | |
27 rfc822a_LWSP_char_token, rfc822a_CHAR_token = 86, rfc822a_hour_token = 91, | |
28 rfc822a_route_addr_token = 95, rfc822a_text_token, | |
29 rfc822a_msg_id_token = 112, rfc822a_optional_fields_token = 115, | |
30 rfc822a_originator_token = 118, rfc822a_phrase_token = 121, | |
31 rfc822a_qtext_token = 123, rfc822a_quoted_string_token = 126, | |
32 rfc822a_QUOTED_token = 128, rfc822a_received_token = 131, | |
33 rfc822a_received_fields_token = 133, rfc822a_rec_date_time_token = 135, | |
34 rfc822a_from_token, rfc822a_from_domain_token, | |
35 rfc822a_by_domain_token = 139, rfc822a_via_atom_token = 141, | |
36 rfc822a_with_atom_token = 143, rfc822a_rec_msg_id_token = 145, | |
37 rfc822a_for_addr_spec_token = 147, rfc822a_resent_token, | |
38 rfc822a_resent_authentic_token, rfc822a_return_token = 155, | |
39 rfc822a_route_token = 157, rfc822a_route_list_token, | |
40 rfc822a_sub_route_token, rfc822a_trace_token = 161, | |
41 rfc822a_text_char_token = 164, rfc822a_zone_token = 166, | |
42 rfc822a_ALPHA_token = 178 | |
43 } rfc822a_token_type; | |
44 | |
45 typedef struct rfc822a_pcb_struct{ | |
46 rfc822a_token_type token_number, reduction_token, error_frame_token; | |
47 int input_code; | |
48 int input_value; | |
49 int line, column; | |
50 int ssx, sn, error_frame_ssx; | |
51 int drt, dssx, dsn; | |
52 int ss[128]; | |
53 int vs[128]; | |
54 int ag_ap; | |
55 const char *error_message; | |
56 char read_flag; | |
57 char exit_flag; | |
58 unsigned char * input_context; | |
59 unsigned char * cs[128]; | |
60 int bts[128], btsx; | |
61 unsigned char * pointer; | |
62 unsigned char * la_ptr; | |
63 const unsigned char *key_sp; | |
64 int save_index, key_state; | |
65 char ag_msg[82]; | |
66 } rfc822a_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 | |
84 extern rfc822a_pcb_type rfc822a_pcb; | |
85 void init_rfc822a(void); | |
86 void rfc822a(void); | |
87 #endif | |
88 |