Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/oldagsrc/good/asilbug1.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 ASILBUG1_H | |
2 #define ASILBUG1_H | |
3 | |
4 typedef union { | |
5 double alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_4[sizeof(double)]; | |
8 } asil_vs_type; | |
9 | |
10 typedef enum { | |
11 asil_white_space_token = 1, asil_input_string_token = 4, | |
12 asil_statements_token, asil_eof_token = 7, asil_statement_text_token, | |
13 asil_statement_char_token, asil_balanced_parens_token, | |
14 asil_balanced_braces_token, asil_statement_token = 17, | |
15 asil_unconditional_statement_token, asil_conditional_statement_token, | |
16 asil_skip_statement_token, asil_skip_unconditional_statement_token, | |
17 asil_skip_conditional_statement_token, asil_expression_token, | |
18 asil_gather_unconditional_while_token = 25, asil_while_loop_token, | |
19 asil_gather_conditional_while_token = 30, asil_true_if_clause_token, | |
20 asil_false_if_clause_token, asil_conditional_expression_token = 35, | |
21 asil_logical_or_expression_token = 41, | |
22 asil_logical_and_expression_token = 44, | |
23 asil_equality_expression_token = 46, | |
24 asil_relational_expression_token = 48, | |
25 asil_additive_expression_token = 51, | |
26 asil_multiplicative_expression_token = 56, asil_factor_token = 59, | |
27 asil_primary_token = 62, asil_blank_token = 67, | |
28 asil_simple_real_token = 78, asil_exponent_token = 81, | |
29 asil_integer_part_token, asil_fraction_part_token = 84, | |
30 asil_name_string_token = 87, asil_letter_token, | |
31 asil_false_condition_token = 101, asil_true_condition_token = 103, | |
32 asil_name_token = 107, asil_real_token = 127, asil_digit_token = 133 | |
33 } asil_token_type; | |
34 | |
35 typedef struct asil_pcb_struct{ | |
36 asil_token_type token_number, reduction_token, error_frame_token; | |
37 int input_code; | |
38 int input_value; | |
39 int line, column; | |
40 int ssx, sn, error_frame_ssx; | |
41 int drt, dssx, dsn; | |
42 int ss[128]; | |
43 asil_vs_type vs[128]; | |
44 int ag_ap; | |
45 const char *error_message; | |
46 char read_flag; | |
47 char exit_flag; | |
48 int bts[128], btsx; | |
49 unsigned char * pointer; | |
50 unsigned char * la_ptr; | |
51 const unsigned char *key_sp; | |
52 int save_index, key_state; | |
53 char ag_msg[82]; | |
54 const int *ag_dtl; | |
55 int ag_dsn; | |
56 } asil_pcb_type; | |
57 | |
58 #ifndef PRULE_CONTEXT | |
59 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
60 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
61 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
62 #endif | |
63 | |
64 #ifndef AG_RUNNING_CODE | |
65 /* PCB.exit_flag values */ | |
66 #define AG_RUNNING_CODE 0 | |
67 #define AG_SUCCESS_CODE 1 | |
68 #define AG_SYNTAX_ERROR_CODE 2 | |
69 #define AG_REDUCTION_ERROR_CODE 3 | |
70 #define AG_STACK_ERROR_CODE 4 | |
71 #define AG_SEMANTIC_ERROR_CODE 5 | |
72 #endif | |
73 | |
74 extern asil_pcb_type asil_pcb; | |
75 void init_asil(void); | |
76 void asil(void); | |
77 #endif | |
78 |