comparison tests/agcl/ffcalc/good/ffcx.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_H
2 #define FFCX_H
3
4 typedef union {
5 double alignment;
6 char ag_vt_2[sizeof(int)];
7 char ag_vt_4[sizeof(double)];
8 } ffcx_vs_type;
9
10 typedef enum {
11 ffcx_white_space_token = 1, ffcx_unary_minus_token = 7,
12 ffcx_calculator_token, ffcx_calculation_token, ffcx_eof_token = 15,
13 ffcx_expression_token, ffcx_name_token, ffcx_error_token = 19,
14 ffcx_integer_part_token = 29, ffcx_fraction_part_token = 31,
15 ffcx_digit_token = 33, ffcx_real_token = 39
16 } ffcx_token_type;
17
18 typedef struct ffcx_pcb_struct{
19 ffcx_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_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_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_pcb_type ffcx_pcb;
55 void init_ffcx(void);
56 void ffcx(void);
57 #endif
58