Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/examples/good/fc4b.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 FC4B_H | |
2 #define FC4B_H | |
3 | |
4 typedef union { | |
5 double alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_4[sizeof(double)]; | |
8 } fc4b_vs_type; | |
9 | |
10 typedef enum { | |
11 fc4b_white_space_token = 1, fc4b_grammar_token = 4, | |
12 fc4b_temperature_token, fc4b_eof_token = 10, fc4b_number_token, | |
13 fc4b_error_token = 17, fc4b_integer_token = 19, fc4b_fraction_token = 22, | |
14 fc4b_end_of_line_token = 39, fc4b_unsigned_number_token = 44 | |
15 } fc4b_token_type; | |
16 | |
17 typedef struct fc4b_pcb_struct{ | |
18 fc4b_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 fc4b_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 } fc4b_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 fc4b_pcb_type fc4b_pcb; | |
54 void init_fc4b(void); | |
55 void fc4b(void); | |
56 #endif | |
57 |