Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/examples/good/fc3.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 FC3_H | |
2 #define FC3_H | |
3 | |
4 typedef union { | |
5 double alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_4[sizeof(double)]; | |
8 } fc3_vs_type; | |
9 | |
10 typedef enum { | |
11 fc3_white_space_token = 1, fc3_grammar_token = 4, fc3_temperature_token, | |
12 fc3_eof_token = 10, fc3_number_token, fc3_error_token = 14, | |
13 fc3_integer_token = 18, fc3_fraction_token = 21, | |
14 fc3_end_of_line_token = 38, fc3_unsigned_number_token = 41 | |
15 } fc3_token_type; | |
16 | |
17 typedef struct fc3_pcb_struct{ | |
18 fc3_token_type token_number, reduction_token, error_frame_token; | |
19 int input_code; | |
20 int input_value; | |
21 int line, column; | |
22 int ssx, sn, error_frame_ssx; | |
23 int drt, dssx, dsn; | |
24 int ss[128]; | |
25 fc3_vs_type vs[128]; | |
26 int ag_ap; | |
27 const char *error_message; | |
28 char read_flag; | |
29 char exit_flag; | |
30 int bts[128], btsx; | |
31 int lab[3], rx, fx; | |
32 const unsigned char *key_sp; | |
33 int save_index, key_state; | |
34 char ag_msg[82]; | |
35 } fc3_pcb_type; | |
36 | |
37 #ifndef PRULE_CONTEXT | |
38 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
39 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
40 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
41 #endif | |
42 | |
43 #ifndef AG_RUNNING_CODE | |
44 /* PCB.exit_flag values */ | |
45 #define AG_RUNNING_CODE 0 | |
46 #define AG_SUCCESS_CODE 1 | |
47 #define AG_SYNTAX_ERROR_CODE 2 | |
48 #define AG_REDUCTION_ERROR_CODE 3 | |
49 #define AG_STACK_ERROR_CODE 4 | |
50 #define AG_SEMANTIC_ERROR_CODE 5 | |
51 #endif | |
52 | |
53 extern fc3_pcb_type fc3_pcb; | |
54 void init_fc3(void); | |
55 void fc3(void); | |
56 #endif | |
57 |