comparison tests/agcl/ffcalc/good/ffcx-t.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 FFCX-T_H
2 #define FFCX-T_H
3
4 typedef union {
5 double alignment;
6 char ag_vt_2[sizeof(int)];
7 char ag_vt_4[sizeof(double)];
8 } ffcx-t_vs_type;
9
10 typedef enum {
11 ffcx-t_white_space_token = 1, ffcx-t_unary_minus_token = 7,
12 ffcx-t_calculator_token, ffcx-t_calculation_token, ffcx-t_eof_token = 15,
13 ffcx-t_expression_token, ffcx-t_name_token, ffcx-t_error_token = 19,
14 ffcx-t_integer_part_token = 29, ffcx-t_fraction_part_token = 31,
15 ffcx-t_digit_token = 33, ffcx-t_real_token = 39
16 } ffcx-t_token_type;
17
18 typedef struct ffcx-t_pcb_struct{
19 ffcx-t_token_type token_number, reduction_token, error_frame_token;
20 int input_code;
21 int input_value;
22 int line, column;
23 int ssx, sn, error_frame_ssx;
24 int drt, dssx, dsn;
25 int ss[128];
26 ffcx-t_vs_type vs[128];
27 int ag_ap;
28 const char *error_message;
29 char read_flag;
30 char exit_flag;
31 int bts[128], btsx;
32 int lab[3], rx, fx;
33 const unsigned char *key_sp;
34 int save_index, key_state;
35 char ag_msg[82];
36 } ffcx-t_pcb_type;
37
38 #ifndef PRULE_CONTEXT
39 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
40 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
41 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
42 #endif
43
44 #ifndef AG_RUNNING_CODE
45 /* PCB.exit_flag values */
46 #define AG_RUNNING_CODE 0
47 #define AG_SUCCESS_CODE 1
48 #define AG_SYNTAX_ERROR_CODE 2
49 #define AG_REDUCTION_ERROR_CODE 3
50 #define AG_STACK_ERROR_CODE 4
51 #define AG_SEMANTIC_ERROR_CODE 5
52 #endif
53
54 extern ffcx-t_pcb_type ffcx-t_pcb;
55 void init_ffcx-t(void);
56 void ffcx-t(void);
57 #endif
58