Mercurial > ~dholland > hg > ag > index.cgi
comparison helpgen/readhelp.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 READHELP_H_1181769468 | |
2 #define READHELP_H_1181769468 | |
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(const char *)]; | |
9 } readhelp_vs_type; | |
10 | |
11 typedef enum { | |
12 readhelp_letter_token = 1, readhelp_blanks_token = 3, | |
13 readhelp_blank_token, readhelp_eol_token, readhelp_text_token = 7, | |
14 readhelp_cr_token = 10, readhelp_nl_token = 12, readhelp_new_line_token, | |
15 readhelp_continue_token, readhelp_name_token = 17, readhelp_title_token, | |
16 readhelp_titles_token, readhelp_text_lines_token = 21, | |
17 readhelp_text_unit_token, readhelp_cross_reference_token = 25, | |
18 readhelp_cross_reference_text_token, readhelp_right_token, | |
19 readhelp_left_token, readhelp_block_body_token, | |
20 readhelp_blank_lines_token, readhelp_end_block_token, | |
21 readhelp_block_token = 33, readhelp_real_block_body_token = 35, | |
22 readhelp_file_token = 37, readhelp_blocks_token, readhelp_eof_token | |
23 } readhelp_token_type; | |
24 | |
25 typedef struct readhelp_pcb_struct{ | |
26 readhelp_token_type token_number, reduction_token, error_frame_token; | |
27 int input_code; | |
28 int input_value; | |
29 int line, column; | |
30 int ssx, sn, error_frame_ssx; | |
31 int drt, dssx, dsn; | |
32 int ss[128]; | |
33 readhelp_vs_type vs[128]; | |
34 int ag_ap; | |
35 const char *error_message; | |
36 char read_flag; | |
37 char exit_flag; | |
38 unsigned char * input_context; | |
39 unsigned char * cs[128]; | |
40 int bts[128], btsx; | |
41 unsigned char * pointer; | |
42 unsigned char * la_ptr; | |
43 const unsigned char *key_sp; | |
44 int save_index, key_state; | |
45 char ag_msg[82]; | |
46 } readhelp_pcb_type; | |
47 | |
48 #ifndef PRULE_CONTEXT | |
49 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
50 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
51 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
52 #endif | |
53 | |
54 #ifndef AG_RUNNING_CODE | |
55 /* PCB.exit_flag values */ | |
56 #define AG_RUNNING_CODE 0 | |
57 #define AG_SUCCESS_CODE 1 | |
58 #define AG_SYNTAX_ERROR_CODE 2 | |
59 #define AG_REDUCTION_ERROR_CODE 3 | |
60 #define AG_STACK_ERROR_CODE 4 | |
61 #define AG_SEMANTIC_ERROR_CODE 5 | |
62 #endif | |
63 | |
64 extern readhelp_pcb_type readhelp_pcb; | |
65 void init_readhelp(void); | |
66 void readhelp(void); | |
67 #endif | |
68 |