Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/oldagsrc/good/dsl-2.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 DSL-2_H | |
2 #define DSL-2_H | |
3 | |
4 typedef union { | |
5 long alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_3[sizeof(long)]; | |
8 char ag_vt_4[sizeof(char *)]; | |
9 char ag_vt_5[sizeof(unsigned)]; | |
10 char ag_vt_6[sizeof(screen_descriptor *)]; | |
11 char ag_vt_7[sizeof(query_item *)]; | |
12 } dsl-2_vs_type; | |
13 | |
14 typedef enum { | |
15 dsl-2_ws_token = 1, dsl-2_white_token = 9, dsl-2_comment_token, | |
16 dsl-2_comment_head_token, dsl-2_not_eol_token = 17, | |
17 dsl-2_script_file_token = 20, dsl-2_execution_block_token, | |
18 dsl-2_declaration_token, dsl-2_eof_token = 26, dsl-2_word_token, | |
19 dsl-2_integer_variable_token, dsl-2_string_variable_token, | |
20 dsl-2_undeclared_variable_token, dsl-2_parameter_string_token = 33, | |
21 dsl-2_string_token = 35, dsl-2_param_word_token = 37, | |
22 dsl-2_text_char_token, dsl-2_action_text_token, | |
23 dsl-2_action_text_head_token, dsl-2_action_word_token = 43, | |
24 dsl-2_action_parameter_string_token = 45, dsl-2_action_param_word_token, | |
25 dsl-2_paren_string_chars_token, dsl-2_paren_string_char_token = 50, | |
26 dsl-2_not_paren_token, dsl-2_string_chars_token = 53, | |
27 dsl-2_string_char_token = 55, dsl-2_not_double_quote_token, | |
28 dsl-2_escape_sequence_token, dsl-2_octal_escape_token = 69, | |
29 dsl-2_hex_escape_token, dsl-2_one_octal_token, dsl-2_two_octal_token, | |
30 dsl-2_three_octal_token, dsl-2_hex_number_token = 77, | |
31 dsl-2_hex_digit_token, dsl-2_command_token, dsl-2_identifier_token, | |
32 dsl-2_parameters_token, dsl-2_piped_command_token = 84, | |
33 dsl-2_command_sequence_token = 90, dsl-2_if_sequence_token, | |
34 dsl-2_statement_token = 93, dsl-2_if_statement_token = 95, | |
35 dsl-2_if_condition_token, dsl-2_conditional_exp_token = 98, | |
36 dsl-2_assignment_token, dsl-2_for_statement_token, | |
37 dsl-2_screen_description_token, dsl-2_while_statement_token, | |
38 dsl-2_string_exp_token = 107, dsl-2_primary_exp_token = 109, | |
39 dsl-2_literals_token = 116, dsl-2_letter_token = 119, dsl-2_digit_token, | |
40 dsl-2_logical_or_exp_token, dsl-2_logical_and_exp_token = 124, | |
41 dsl-2_inclusive_or_exp_token = 126, dsl-2_exclusive_or_exp_token = 128, | |
42 dsl-2_and_exp_token, dsl-2_equality_exp_token = 131, | |
43 dsl-2_relational_exp_token = 133, dsl-2_shift_exp_token = 136, | |
44 dsl-2_additive_exp_token = 139, dsl-2_multiplicative_exp_token = 141, | |
45 dsl-2_unary_exp_token = 144, dsl-2_nonzero_token = 147, | |
46 dsl-2_string_term_token = 151, dsl-2_string_element_token, | |
47 dsl-2_numeric_name_token, dsl-2_built_in_name_token, | |
48 dsl-2_built_in_argument_token, dsl-2_string_name_token, | |
49 dsl-2_undefined_name_token, dsl-2_hex_constant_token = 160, | |
50 dsl-2_octal_constant_token, dsl-2_decimal_constant_token, | |
51 dsl-2_char_constant_element_token = 171, dsl-2_not_single_quote_token, | |
52 dsl-2_screen_items_token, dsl-2_formula_token = 176, | |
53 dsl-2_color_spec_token, dsl-2_query_line_token = 183, | |
54 dsl-2_button_line_token, dsl-2_formula_element_token = 192, | |
55 dsl-2_eol_token = 200, dsl-2_paren_string_token, | |
56 dsl-2_string_literal_token, dsl-2_literal_token = 208, | |
57 dsl-2_name_token = 223, dsl-2_integer_constant_token = 246, | |
58 dsl-2_character_constant_token, dsl-2__last_token = 262 | |
59 } dsl-2_token_type; | |
60 | |
61 typedef struct dsl-2_pcb_struct{ | |
62 dsl-2_token_type token_number, reduction_token, error_frame_token; | |
63 int input_code; | |
64 int input_value; | |
65 int line, column; | |
66 int ssx, sn, error_frame_ssx; | |
67 int drt, dssx, dsn; | |
68 int ss[128]; | |
69 dsl-2_vs_type vs[128]; | |
70 int ag_ap; | |
71 const char *error_message; | |
72 char read_flag; | |
73 char exit_flag; | |
74 action_pointer input_context; | |
75 action_pointer cs[128]; | |
76 int bts[128], btsx; | |
77 unsigned char * pointer; | |
78 unsigned char * la_ptr; | |
79 const unsigned char *key_sp; | |
80 int save_index, key_state; | |
81 char ag_msg[82]; | |
82 const int *ag_dtl; | |
83 int ag_dsn; | |
84 } dsl-2_pcb_type; | |
85 | |
86 #ifndef PRULE_CONTEXT | |
87 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
88 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
89 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
90 #endif | |
91 | |
92 #ifndef AG_RUNNING_CODE | |
93 /* PCB.exit_flag values */ | |
94 #define AG_RUNNING_CODE 0 | |
95 #define AG_SUCCESS_CODE 1 | |
96 #define AG_SYNTAX_ERROR_CODE 2 | |
97 #define AG_REDUCTION_ERROR_CODE 3 | |
98 #define AG_STACK_ERROR_CODE 4 | |
99 #define AG_SEMANTIC_ERROR_CODE 5 | |
100 #endif | |
101 | |
102 extern dsl-2_pcb_type dsl-2_pcb; | |
103 void init_dsl-2(void); | |
104 void dsl-2(void); | |
105 #endif | |
106 |