Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/oldagsrc/good/pgg24-3.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 PGG24-3_H | |
2 #define PGG24-3_H | |
3 | |
4 typedef union { | |
5 long alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_4[sizeof(node)]; | |
8 } pgg_vs_type; | |
9 | |
10 typedef enum { | |
11 pgg_arrow_token = 1, pgg_blank_token = 3, pgg_comma_token = 6, | |
12 pgg_space_token = 8, pgg_ellipsis_token = 10, pgg_equals_token = 12, | |
13 pgg_bang_token = 14, pgg_left_brace_token = 16, | |
14 pgg_left_bracket_token = 18, pgg_left_parenthesis_token = 20, | |
15 pgg_minus_token = 22, pgg_plus_token = 24, pgg_right_bracket_token = 26, | |
16 pgg_right_brace_token = 28, pgg_right_parenthesis_token = 30, | |
17 pgg_right_quote_token = 32, pgg_single_quote_token, pgg_tilde_token, | |
18 pgg_vertical_bar_token = 36, pgg_syntax_definition_token = 38, | |
19 pgg_end_of_line_token, pgg_complete_statement_token = 41, | |
20 pgg_statement_token = 43, pgg_eof_token = 46, pgg_production_token, | |
21 pgg_simple_statement_token, pgg_left_hand_side_token, | |
22 pgg_right_hand_side_token, pgg_additional_rule_spec_token, | |
23 pgg_rule_specs_token = 53, pgg_definition_token, pgg_embedded_c_token, | |
24 pgg_configuration_section_token, pgg_token_name_list_token, | |
25 pgg_type_definition_token, pgg_token_name_token, pgg_name_token, | |
26 pgg_data_type_token = 62, pgg_proper_vp_rule_specs_token, | |
27 pgg_vp_rule_spec_token, pgg_additional_vp_rule_spec_token, | |
28 pgg_vp_rule_specs_token, pgg_reduction_procedure_token, | |
29 pgg_vp_rules_token, pgg_grammar_rule_token, pgg_rule_spec_token, | |
30 pgg_rule_element_token, pgg_parameter_name_token, pgg_c_expression_token, | |
31 pgg_type_name_token = 75, pgg_template_field_token, | |
32 pgg_abstract_declarator_token = 78, pgg_indirect_data_type_token = 82, | |
33 pgg_direct_abstract_declarator_token, pgg_template_field_head_token, | |
34 pgg_star_token = 88, pgg_pointer_token = 90, pgg_name_string_token, | |
35 pgg_letter_token, pgg_enum_fix_token = 94, pgg_blank_char_token = 96, | |
36 pgg_c_comment_token, pgg_continuation_token, pgg_comment_token, | |
37 pgg_next_line_token, pgg_carriage_return_token, pgg_newline_token = 103, | |
38 pgg_white_token, pgg_vertical_space_token, pgg_character_token = 110, | |
39 pgg_signed_number_token, pgg_char_const_token = 114, pgg_sign_token, | |
40 pgg_simple_number_token, pgg_decimal_number_token = 118, | |
41 pgg_octal_number_token = 120, pgg_hex_number_token = 124, | |
42 pgg_hex_digit_token = 128, pgg_token_token = 130, | |
43 pgg_mid_rule_action_token, pgg_union_token, pgg_virtual_production_token, | |
44 pgg_intersection_token, pgg_negation_token, pgg_simple_set_token = 137, | |
45 pgg_escape_sequence_token = 139, pgg_octal_escape_token, | |
46 pgg_three_octal_token, pgg_hex_escape_token, pgg_character_range_token, | |
47 pgg_enum_definition_token = 145, pgg_enum_statement_token, | |
48 pgg_keyword_string_token, pgg_keyword_string_head_token, pgg_string_token, | |
49 pgg_double_quote_token, pgg_string_A_token, pgg_string_B_token, | |
50 pgg_string_C_token, pgg_string_char_token, pgg_simple_string_char_token, | |
51 pgg_one_octal_token = 167, pgg_backslash_token, pgg_two_octal_token, | |
52 pgg_any_digit_token = 171, pgg_nonoctal_digit_token, | |
53 pgg_c_name_token = 174, pgg_simple_name_token, | |
54 pgg_configuration_parameters_token, | |
55 pgg_configuration_parameter_list_token, | |
56 pgg_configuration_parameter_token = 179, pgg_attribute_statement_token, | |
57 pgg_token_list_token = 182, pgg_new_reserve_statement_token = 188, | |
58 pgg_list_end_token, pgg_tokens_token = 195, | |
59 pgg_embedded_c_head_token = 202, pgg_c_code_token, | |
60 pgg_c_code_first_token = 207, pgg_c_text_token, | |
61 pgg_c_character_constant_token = 210, pgg_c_string_constant_token, | |
62 pgg_c_char_token, pgg_simple_c_char_token, pgg_c_expression_head_token, | |
63 pgg_c_chars_token, pgg_c_expression_char_token, | |
64 pgg_c_comment_head_token = 219, pgg_c_literal_elem_token = 223, | |
65 pgg_anything_token | |
66 } pgg_token_type; | |
67 | |
68 typedef struct pgg_pcb_struct{ | |
69 pgg_token_type token_number, reduction_token, error_frame_token; | |
70 int input_code; | |
71 int input_value; | |
72 int line, column; | |
73 int ssx, sn, error_frame_ssx; | |
74 int drt, dssx, dsn; | |
75 int ss[53]; | |
76 pgg_vs_type vs[53]; | |
77 int ag_ap; | |
78 const char *error_message; | |
79 char read_flag; | |
80 char exit_flag; | |
81 cint input_context; | |
82 cint cs[53]; | |
83 int bts[53], btsx; | |
84 int (near * near const *gt_procs)(void); | |
85 int (near * near const *r_procs)(void); | |
86 int (near * near const *s_procs)(void); | |
87 unsigned char * pointer; | |
88 unsigned char * la_ptr; | |
89 const unsigned char *key_sp; | |
90 int save_index, key_state; | |
91 int ag_error_depth, ag_min_depth, ag_tmp_depth; | |
92 int ag_rss[2*53], ag_lrss; | |
93 char ag_msg[82]; | |
94 const int *ag_dtl; | |
95 int ag_dsn; | |
96 int ag_resynch_active; | |
97 } pgg_pcb_type; | |
98 | |
99 #ifndef PRULE_CONTEXT | |
100 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
101 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
102 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
103 #endif | |
104 | |
105 #ifndef AG_RUNNING_CODE | |
106 /* PCB.exit_flag values */ | |
107 #define AG_RUNNING_CODE 0 | |
108 #define AG_SUCCESS_CODE 1 | |
109 #define AG_SYNTAX_ERROR_CODE 2 | |
110 #define AG_REDUCTION_ERROR_CODE 3 | |
111 #define AG_STACK_ERROR_CODE 4 | |
112 #define AG_SEMANTIC_ERROR_CODE 5 | |
113 #endif | |
114 void init_pgg(void); | |
115 void pgg(void); | |
116 #endif | |
117 |