Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/examples/good/mas.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 MAS_H | |
2 #define MAS_H | |
3 | |
4 typedef union { | |
5 long alignment; | |
6 char ag_vt_4[sizeof(token)]; | |
7 char ag_vt_5[sizeof(unsigned)]; | |
8 } mas_vs_type; | |
9 | |
10 typedef enum { | |
11 mas_space_token = 1, mas_grammar_token, mas_parse_unit_token, | |
12 mas_eof_token = 6, mas_parameter_expansion_token = 8, | |
13 mas_simple_parse_unit_token, mas_concatenation_token, mas_macro_token, | |
14 mas_parameter_name_token = 14, mas_variable_token, mas_simple_macro_token, | |
15 mas_macro_arg_list_token = 18, mas_defined_token = 20, | |
16 mas_macro_name_token, mas_NAME_token, mas_left_side_token, | |
17 mas_right_side_token, mas_CONCAT_token, mas_not_parameter_token, | |
18 mas_arg_elements_token, mas_initial_arg_element_token = 29, | |
19 mas_nested_elements_token = 31, mas_arg_element_token | |
20 } mas_token_type; | |
21 | |
22 typedef struct mas_pcb_struct{ | |
23 mas_token_type token_number, reduction_token, error_frame_token; | |
24 int input_code; | |
25 token input_value; | |
26 int line, column; | |
27 int ssx, sn, error_frame_ssx; | |
28 int drt, dssx, dsn; | |
29 int ss[128]; | |
30 mas_vs_type vs[128]; | |
31 int ag_ap; | |
32 const char *error_message; | |
33 char read_flag; | |
34 char exit_flag; | |
35 token * pointer; | |
36 token * la_ptr; | |
37 char ag_msg[82]; | |
38 const int *ag_dtl; | |
39 int ag_dsn; | |
40 } mas_pcb_type; | |
41 | |
42 #ifndef PRULE_CONTEXT | |
43 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
44 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
45 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
46 #endif | |
47 | |
48 #ifndef AG_RUNNING_CODE | |
49 /* PCB.exit_flag values */ | |
50 #define AG_RUNNING_CODE 0 | |
51 #define AG_SUCCESS_CODE 1 | |
52 #define AG_SYNTAX_ERROR_CODE 2 | |
53 #define AG_REDUCTION_ERROR_CODE 3 | |
54 #define AG_STACK_ERROR_CODE 4 | |
55 #define AG_SEMANTIC_ERROR_CODE 5 | |
56 #endif | |
57 void init_mas(void); | |
58 void mas(void); | |
59 #endif | |
60 |