Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/examples/good/fc2.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 FC2_H | |
2 #define FC2_H | |
3 | |
4 typedef enum { | |
5 fc2_grammar_token = 1, fc2_temperature_token, fc2_eof_token = 7, | |
6 fc2_number_token, fc2_error_token = 11, fc2_integer_token = 13 | |
7 } fc2_token_type; | |
8 | |
9 typedef struct fc2_pcb_struct{ | |
10 fc2_token_type token_number, reduction_token, error_frame_token; | |
11 int input_code; | |
12 int input_value; | |
13 int line, column; | |
14 int ssx, sn, error_frame_ssx; | |
15 int drt, dssx, dsn; | |
16 int ss[128]; | |
17 int vs[128]; | |
18 int ag_ap; | |
19 const char *error_message; | |
20 char read_flag; | |
21 char exit_flag; | |
22 int bts[128], btsx; | |
23 char ag_msg[82]; | |
24 } fc2_pcb_type; | |
25 | |
26 #ifndef PRULE_CONTEXT | |
27 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
28 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
29 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
30 #endif | |
31 | |
32 #ifndef AG_RUNNING_CODE | |
33 /* PCB.exit_flag values */ | |
34 #define AG_RUNNING_CODE 0 | |
35 #define AG_SUCCESS_CODE 1 | |
36 #define AG_SYNTAX_ERROR_CODE 2 | |
37 #define AG_REDUCTION_ERROR_CODE 3 | |
38 #define AG_STACK_ERROR_CODE 4 | |
39 #define AG_SEMANTIC_ERROR_CODE 5 | |
40 #endif | |
41 | |
42 extern fc2_pcb_type fc2_pcb; | |
43 void init_fc2(void); | |
44 void fc2(void); | |
45 #endif | |
46 |