Mercurial > ~dholland > hg > ag > index.cgi
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/agcl/oldagsrc/good/dsl-2.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,106 @@ +#ifndef DSL-2_H +#define DSL-2_H + +typedef union { + long alignment; + char ag_vt_2[sizeof(int)]; + char ag_vt_3[sizeof(long)]; + char ag_vt_4[sizeof(char *)]; + char ag_vt_5[sizeof(unsigned)]; + char ag_vt_6[sizeof(screen_descriptor *)]; + char ag_vt_7[sizeof(query_item *)]; +} dsl-2_vs_type; + +typedef enum { + dsl-2_ws_token = 1, dsl-2_white_token = 9, dsl-2_comment_token, + dsl-2_comment_head_token, dsl-2_not_eol_token = 17, + dsl-2_script_file_token = 20, dsl-2_execution_block_token, + dsl-2_declaration_token, dsl-2_eof_token = 26, dsl-2_word_token, + dsl-2_integer_variable_token, dsl-2_string_variable_token, + dsl-2_undeclared_variable_token, dsl-2_parameter_string_token = 33, + dsl-2_string_token = 35, dsl-2_param_word_token = 37, + dsl-2_text_char_token, dsl-2_action_text_token, + dsl-2_action_text_head_token, dsl-2_action_word_token = 43, + dsl-2_action_parameter_string_token = 45, dsl-2_action_param_word_token, + dsl-2_paren_string_chars_token, dsl-2_paren_string_char_token = 50, + dsl-2_not_paren_token, dsl-2_string_chars_token = 53, + dsl-2_string_char_token = 55, dsl-2_not_double_quote_token, + dsl-2_escape_sequence_token, dsl-2_octal_escape_token = 69, + dsl-2_hex_escape_token, dsl-2_one_octal_token, dsl-2_two_octal_token, + dsl-2_three_octal_token, dsl-2_hex_number_token = 77, + dsl-2_hex_digit_token, dsl-2_command_token, dsl-2_identifier_token, + dsl-2_parameters_token, dsl-2_piped_command_token = 84, + dsl-2_command_sequence_token = 90, dsl-2_if_sequence_token, + dsl-2_statement_token = 93, dsl-2_if_statement_token = 95, + dsl-2_if_condition_token, dsl-2_conditional_exp_token = 98, + dsl-2_assignment_token, dsl-2_for_statement_token, + dsl-2_screen_description_token, dsl-2_while_statement_token, + dsl-2_string_exp_token = 107, dsl-2_primary_exp_token = 109, + dsl-2_literals_token = 116, dsl-2_letter_token = 119, dsl-2_digit_token, + dsl-2_logical_or_exp_token, dsl-2_logical_and_exp_token = 124, + dsl-2_inclusive_or_exp_token = 126, dsl-2_exclusive_or_exp_token = 128, + dsl-2_and_exp_token, dsl-2_equality_exp_token = 131, + dsl-2_relational_exp_token = 133, dsl-2_shift_exp_token = 136, + dsl-2_additive_exp_token = 139, dsl-2_multiplicative_exp_token = 141, + dsl-2_unary_exp_token = 144, dsl-2_nonzero_token = 147, + dsl-2_string_term_token = 151, dsl-2_string_element_token, + dsl-2_numeric_name_token, dsl-2_built_in_name_token, + dsl-2_built_in_argument_token, dsl-2_string_name_token, + dsl-2_undefined_name_token, dsl-2_hex_constant_token = 160, + dsl-2_octal_constant_token, dsl-2_decimal_constant_token, + dsl-2_char_constant_element_token = 171, dsl-2_not_single_quote_token, + dsl-2_screen_items_token, dsl-2_formula_token = 176, + dsl-2_color_spec_token, dsl-2_query_line_token = 183, + dsl-2_button_line_token, dsl-2_formula_element_token = 192, + dsl-2_eol_token = 200, dsl-2_paren_string_token, + dsl-2_string_literal_token, dsl-2_literal_token = 208, + dsl-2_name_token = 223, dsl-2_integer_constant_token = 246, + dsl-2_character_constant_token, dsl-2__last_token = 262 +} dsl-2_token_type; + +typedef struct dsl-2_pcb_struct{ + dsl-2_token_type token_number, reduction_token, error_frame_token; + int input_code; + int input_value; + int line, column; + int ssx, sn, error_frame_ssx; + int drt, dssx, dsn; + int ss[128]; + dsl-2_vs_type vs[128]; + int ag_ap; + const char *error_message; + char read_flag; + char exit_flag; + action_pointer input_context; + action_pointer cs[128]; + int bts[128], btsx; + unsigned char * pointer; + unsigned char * la_ptr; + const unsigned char *key_sp; + int save_index, key_state; + char ag_msg[82]; + const int *ag_dtl; + int ag_dsn; +} dsl-2_pcb_type; + +#ifndef PRULE_CONTEXT +#define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) +#define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) +#define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) +#endif + +#ifndef AG_RUNNING_CODE +/* PCB.exit_flag values */ +#define AG_RUNNING_CODE 0 +#define AG_SUCCESS_CODE 1 +#define AG_SYNTAX_ERROR_CODE 2 +#define AG_REDUCTION_ERROR_CODE 3 +#define AG_STACK_ERROR_CODE 4 +#define AG_SEMANTIC_ERROR_CODE 5 +#endif + +extern dsl-2_pcb_type dsl-2_pcb; +void init_dsl-2(void); +void dsl-2(void); +#endif +