comparison tests/agcl/examples/good/hw1.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 HW1_H
2 #define HW1_H
3
4 typedef enum {
5 hw1_grammar_token = 1
6 } hw1_token_type;
7
8 typedef struct hw1_pcb_struct{
9 hw1_token_type token_number, reduction_token, error_frame_token;
10 int input_code;
11 int input_value;
12 int line, column;
13 int ssx, sn, error_frame_ssx;
14 int drt, dssx, dsn;
15 int ss[128];
16 int vs[128];
17 int ag_ap;
18 const char *error_message;
19 char read_flag;
20 char exit_flag;
21 int bts[128], btsx;
22 char ag_msg[82];
23 } hw1_pcb_type;
24
25 #ifndef PRULE_CONTEXT
26 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx]))
27 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx])
28 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx])
29 #endif
30
31 #ifndef AG_RUNNING_CODE
32 /* PCB.exit_flag values */
33 #define AG_RUNNING_CODE 0
34 #define AG_SUCCESS_CODE 1
35 #define AG_SYNTAX_ERROR_CODE 2
36 #define AG_REDUCTION_ERROR_CODE 3
37 #define AG_STACK_ERROR_CODE 4
38 #define AG_SEMANTIC_ERROR_CODE 5
39 #endif
40
41 extern hw1_pcb_type hw1_pcb;
42 void init_hw1(void);
43 void hw1(void);
44 #endif
45