Mercurial > ~dholland > hg > ag > index.cgi
comparison cgbigen/cgbigen.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 CGBIGEN_H_1181769467 | |
2 #define CGBIGEN_H_1181769467 | |
3 | |
4 typedef enum { | |
5 cgbigen_file_token = 1, cgbigen_blank_lines_token, | |
6 cgbigen_block_token = 4, cgbigen_eof_token = 6, cgbigen_title_line_token, | |
7 cgbigen_body_line_token, cgbigen_titles_token = 12, cgbigen_comment_token, | |
8 cgbigen_newline_token = 15, cgbigen_title_token, cgbigen_blank_token = 18, | |
9 cgbigen_name_token = 22, cgbigen_namechar_token, cgbigen_text_token, | |
10 cgbigen_textchar_token, cgbigen_cr_token = 30, cgbigen_nl_token = 32, | |
11 cgbigen_blank_line_token | |
12 } cgbigen_token_type; | |
13 | |
14 typedef struct cgbigen_pcb_struct{ | |
15 cgbigen_token_type token_number, reduction_token, error_frame_token; | |
16 int input_code; | |
17 int input_value; | |
18 int line, column; | |
19 int ssx, sn, error_frame_ssx; | |
20 int drt, dssx, dsn; | |
21 int ss[128]; | |
22 int vs[128]; | |
23 int ag_ap; | |
24 const char *error_message; | |
25 char read_flag; | |
26 char exit_flag; | |
27 int bts[128], btsx; | |
28 int lab[3], rx, fx; | |
29 const unsigned char *key_sp; | |
30 int save_index, key_state; | |
31 char ag_msg[82]; | |
32 } cgbigen_pcb_type; | |
33 | |
34 #ifndef PRULE_CONTEXT | |
35 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
36 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
37 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
38 #endif | |
39 | |
40 #ifndef AG_RUNNING_CODE | |
41 /* PCB.exit_flag values */ | |
42 #define AG_RUNNING_CODE 0 | |
43 #define AG_SUCCESS_CODE 1 | |
44 #define AG_SYNTAX_ERROR_CODE 2 | |
45 #define AG_REDUCTION_ERROR_CODE 3 | |
46 #define AG_STACK_ERROR_CODE 4 | |
47 #define AG_SEMANTIC_ERROR_CODE 5 | |
48 #endif | |
49 | |
50 extern cgbigen_pcb_type cgbigen_pcb; | |
51 void init_cgbigen(void); | |
52 void cgbigen(void); | |
53 #endif | |
54 |