Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/contrib/good/plm.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 PLM_H | |
2 #define PLM_H | |
3 | |
4 typedef enum { | |
5 plm_compilation_token = 57, plm_white_space_token, | |
6 plm_actual_parameters_token = 68, plm_expression_list_token = 70, | |
7 plm_adding_operator_token = 72, plm_MINUS_SIGN_token, | |
8 plm_and_operator_token = 75, plm_arithmetic_expression_token, | |
9 plm_term_token, plm_array_specifier_token, plm_explicit_dimension_token, | |
10 plm_implicit_dimension_token, plm_assignment_statement_token, | |
11 plm_left_part_token, plm_expression_token = 84, | |
12 plm_base_specifier_token = 86, plm_basic_statement_token = 88, | |
13 plm_call_statement_token, plm_goto_statement_token, | |
14 plm_microprocessor_dependent_statement_token, plm_null_statement_token, | |
15 plm_return_statement_token, plm_basic_type_token, | |
16 plm_bound_expression_token, plm_by_part_token, plm_step_expression_token, | |
17 plm_simple_variable_token, plm_cast_type_token, | |
18 plm_cause_interrupt_statement_token, plm_module_token = 102, | |
19 plm_eof_token, plm_conditional_clause_token, plm_if_condition_token, | |
20 plm_true_unit_token, plm_true_element_token, plm_false_element_token, | |
21 plm_constant_token, plm_constant_attribute_token, plm_constant_list_token, | |
22 plm_declaration_token = 113, plm_declare_statement_token, | |
23 plm_procedure_definition_token, plm_declaration_sequence_token, | |
24 plm_declare_element_token, plm_factored_element_token, | |
25 plm_unfactored_element_token, plm_declare_element_list_token, | |
26 plm_disable_statement_token, plm_do_block_token, plm_do_case_block_token, | |
27 plm_do_while_block_token, plm_iterative_do_block_token, | |
28 plm_simple_do_block_token, plm_do_case_statement_token, plm_ending_token, | |
29 plm_unit_sequence_token, plm_do_while_statement_token, | |
30 plm_embedded_assignment_token, plm_variable_reference_token, | |
31 plm_logical_expression_token, plm_enable_statement_token, | |
32 plm_end_statement_token, plm_opt_identifier_token, | |
33 plm_label_definition_sequence_token, plm_factored_label_element_token, | |
34 plm_factored_variable_element_token, | |
35 plm_variable_name_specifier_list_token, plm_opt_public_or_external_token, | |
36 plm_factored_member_token, plm_member_name_list_token, | |
37 plm_opt_explicit_dimension_token, plm_variable_type_token, | |
38 plm_opt_variable_attributes_token, plm_unit_token, | |
39 plm_formal_parameter_token, plm_formal_parameter_list_token, | |
40 plm_formal_parameter_specifier_token, plm_go_to_token, | |
41 plm_halt_statement_token, plm_id_colon_token, plm_index_part_token = 156, | |
42 plm_index_variable_token, plm_start_expression_token, | |
43 plm_initial_value_token, plm_initial_value_list_token, | |
44 plm_initialization_token, plm_binary_number_token, | |
45 plm_decimal_number_token, plm_hex_number_token, plm_octal_number_token, | |
46 plm_interrupt_token, plm_opt_interrupt_number_token, | |
47 plm_interrupt_number_token, plm_iterative_do_statement_token, | |
48 plm_to_part_token, plm_opt_by_part_token, plm_label_definition_token, | |
49 plm_label_element_token, plm_variable_reference_list_token, | |
50 plm_literal_element_token, plm_location_reference_token, | |
51 plm_locator_token = 178, plm_locator_initialization_token, | |
52 plm_logical_factor_token, plm_or_operator_token, | |
53 plm_logical_secondary_token, plm_logical_primary_token, | |
54 plm_relation_operator_token, plm_member_element_token, | |
55 plm_structure_type_token, plm_unfactored_member_token, | |
56 plm_member_element_list_token, plm_member_name_token, | |
57 plm_member_specifier_token, plm_subscript_token, | |
58 plm_member_specifier_sequence_token, plm_module_name_token, | |
59 plm_multiplying_operator_token, plm_floating_point_number_token = 196, | |
60 plm_opt_array_specifier_token, plm_opt_formal_parameter_specifier_token, | |
61 plm_opt_procedure_attribute_sequence_token, | |
62 plm_procedure_attribute_sequence_token, plm_opt_procedure_type_token, | |
63 plm_procedure_type_token, plm_variable_attributes_token, | |
64 plm_primary_token, plm_subexpression_token, plm_procedure_attribute_token, | |
65 plm_procedure_statement_token, plm_typed_return_token = 210, | |
66 plm_untyped_return_token, plm_secondary_token, plm_unary_sign_token, | |
67 plm_simple_do_statement_token, plm_subscript_or_actual_parameters_token, | |
68 plm_true_statement_token, plm_unary_minus_token, plm_unary_plus_token, | |
69 plm_variable_element_token, plm_unit_element_token, | |
70 plm_variable_name_specifier_token, plm_decimal_number_tail_token, | |
71 plm_binary_number_tail_token = 226, plm_octal_number_tail_token = 229, | |
72 plm_hex_number_tail_token = 232, | |
73 plm_floating_point_number_tail_token = 235, plm_fraction_part_token, | |
74 plm_exponent_token, plm_RPAREN_token = 258, plm_LPAREN_token, | |
75 plm_MINUS_token, plm_PLUS_token, plm_PLUS_SIGN_token, plm_AND_token, | |
76 plm_SEMI_token, plm_EQ_token, plm_IDENTIFIER_token, plm_DOT_token, | |
77 plm_ADDRESS_token, plm_BYTE_token, plm_CHARINT_token, plm_DWORD_token, | |
78 plm_HWORD_token, plm_INTEGER_token, plm_LONGINT_token, plm_OFFSET_token, | |
79 plm_POINTER_token, plm_QWORD_token, plm_REAL_token, plm_SELECTOR_token, | |
80 plm_SHORTINT_token, plm_WORD_token, plm_BY_token, plm_CALL_token, | |
81 plm_CAUSE_INTERRUPT_token, plm_EOF_KW_token, plm_ELSE_token, | |
82 plm_STRING_token, plm_numeric_constant_token, plm_DATA_token, | |
83 plm_COMMA_token, plm_DECLARE_token, plm_DISABLE_token, plm_CASE_token, | |
84 plm_DO_token, plm_WHILE_token, plm_ASSIGN_OP_token, plm_ENABLE_token, | |
85 plm_END_token, plm_LABEL_token, plm_GOTO_token, plm_TO_token, | |
86 plm_GO_token, plm_HALT_token, plm_COLON_token, plm_THEN_token, | |
87 plm_IF_token, plm_STAR_token, plm_INITIAL_KW_token, plm_INTERRUPT_token, | |
88 plm_LITERALLY_token, plm_AT_SIGN_token, plm_AT_token, plm_NOT_token, | |
89 plm_MOD_token, plm_SLASH_token, plm_EXTERNAL_token, plm_PUBLIC_token, | |
90 plm_OR_token, plm_XOR_token, plm_REENTRANT_token, plm_PROCEDURE_token, | |
91 plm_GE_token, plm_GT_token, plm_LE_token, plm_LT_token, plm_NE_token, | |
92 plm_STRUCTURE_token, plm_RETURN_token, plm_BASED_token, | |
93 plm_integer_constant_token = 331 | |
94 } plm_token_type; | |
95 | |
96 typedef struct plm_pcb_struct{ | |
97 plm_token_type token_number, reduction_token, error_frame_token; | |
98 int input_code; | |
99 int input_value; | |
100 int line, column; | |
101 int ssx, sn, error_frame_ssx; | |
102 int drt, dssx, dsn; | |
103 int ss[128]; | |
104 int vs[128]; | |
105 int ag_ap; | |
106 const char *error_message; | |
107 char read_flag; | |
108 char exit_flag; | |
109 int bts[128], btsx; | |
110 int lab[15], rx, fx; | |
111 const unsigned char *key_sp; | |
112 int save_index, key_state; | |
113 char ag_msg[82]; | |
114 } plm_pcb_type; | |
115 | |
116 #ifndef PRULE_CONTEXT | |
117 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
118 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
119 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
120 #endif | |
121 | |
122 #ifndef AG_RUNNING_CODE | |
123 /* PCB.exit_flag values */ | |
124 #define AG_RUNNING_CODE 0 | |
125 #define AG_SUCCESS_CODE 1 | |
126 #define AG_SYNTAX_ERROR_CODE 2 | |
127 #define AG_REDUCTION_ERROR_CODE 3 | |
128 #define AG_STACK_ERROR_CODE 4 | |
129 #define AG_SEMANTIC_ERROR_CODE 5 | |
130 #endif | |
131 | |
132 extern plm_pcb_type plm_pcb; | |
133 void init_plm(void); | |
134 void plm(void); | |
135 #endif | |
136 |