comparison tests/agcl/ffcalc/good/ffcm-a.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 FFCM-A_H
2 #define FFCM-A_H
3
4 typedef union {
5 double alignment;
6 char ag_vt_2[sizeof(int)];
7 char ag_vt_4[sizeof(double)];
8 } ffcm-a_vs_type;
9
10 typedef enum {
11 ffcm-a_white_space_token = 1, ffcm-a_calculator_token = 3,
12 ffcm-a_eof_token = 9, ffcm-a_calculation_token, ffcm-a_expression_token,
13 ffcm-a_name_token, ffcm-a_error_token = 14, ffcm-a_term_token,
14 ffcm-a_factor_token = 18, ffcm-a_identifier_token = 21,
15 ffcm-a_integer_part_token = 31, ffcm-a_fraction_part_token = 33,
16 ffcm-a_digit_token = 35, ffcm-a_statement_token = 43,
17 ffcm-a_real_token = 49, ffcm-a_letter_token = 53
18 } ffcm-a_token_type;
19
20 typedef struct ffcm-a_pcb_struct{
21 ffcm-a_token_type token_number, reduction_token, error_frame_token;
22 int input_code;
23 int input_value;
24 int line, column;
25 int ssx, sn, error_frame_ssx;
26 int drt, dssx, dsn;
27 int ss[128];
28 ffcm-a_vs_type vs[128];
29 int ag_ap;
30 const char *error_message;
31 char read_flag;
32 char exit_flag;
33 int bts[128], btsx;
34 int lab[3], rx, fx;
35 const unsigned char *key_sp;
36 int save_index, key_state;
37 char ag_msg[82];
38 } ffcm-a_pcb_type;
39
40 #ifndef PRULE_CONTEXT
41 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
42 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
43 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
44 #endif
45
46 #ifndef AG_RUNNING_CODE
47 /* PCB.exit_flag values */
48 #define AG_RUNNING_CODE 0
49 #define AG_SUCCESS_CODE 1
50 #define AG_SYNTAX_ERROR_CODE 2
51 #define AG_REDUCTION_ERROR_CODE 3
52 #define AG_STACK_ERROR_CODE 4
53 #define AG_SEMANTIC_ERROR_CODE 5
54 #endif
55
56 extern ffcm-a_pcb_type ffcm-a_pcb;
57 void init_ffcm-a(void);
58 void ffcm-a(void);
59 #endif
60