Mercurial > ~dholland > hg > ag > index.cgi
comparison tests/agcl/oldagsrc/good/xvmc.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 XVMC_H | |
2 #define XVMC_H | |
3 | |
4 typedef union { | |
5 double alignment; | |
6 char ag_vt_2[sizeof(int)]; | |
7 char ag_vt_4[sizeof(Code)]; | |
8 char ag_vt_5[sizeof(double)]; | |
9 } vmCompile_vs_type; | |
10 | |
11 typedef enum { | |
12 vmCompile_white_space_token = 1, vmCompile_input_string_token = 6, | |
13 vmCompile_eof_token, vmCompile_statements_token, vmCompile_error_token, | |
14 vmCompile_statement_token = 13, vmCompile_executable_statement_token, | |
15 vmCompile_declaration_token, vmCompile_type_name_token = 17, | |
16 vmCompile_expression_token = 19, vmCompile_expression_list_token = 23, | |
17 vmCompile_expressions_token = 25, | |
18 vmCompile_unconditional_statement_token = 27, | |
19 vmCompile_conditional_statement_token, vmCompile_while_clause_token = 32, | |
20 vmCompile_for_exprs_token = 34, vmCompile_condition_token, | |
21 vmCompile_for_expr_list_token, vmCompile_if_clause_token = 38, | |
22 vmCompile_conditional_expression_token = 41, vmCompile_lvalue_token, | |
23 vmCompile_variable_name_token = 53, vmCompile_logical_or_expression_token, | |
24 vmCompile_logical_or_condition_token, | |
25 vmCompile_logical_and_expression_token = 58, | |
26 vmCompile_bitwise_or_expression_token = 60, | |
27 vmCompile_logical_and_condition_token, | |
28 vmCompile_bitwise_xor_expression_token = 63, | |
29 vmCompile_bitwise_and_expression_token = 65, | |
30 vmCompile_equality_expression_token = 67, | |
31 vmCompile_relational_expression_token = 69, | |
32 vmCompile_shift_expression_token = 72, | |
33 vmCompile_additive_expression_token = 77, | |
34 vmCompile_multiplicative_expression_token = 80, | |
35 vmCompile_cast_expression_token = 83, | |
36 vmCompile_unary_expression_token = 87, vmCompile_power_expression_token, | |
37 vmCompile_primary_token = 93, vmCompile_integer_constant_token = 95, | |
38 vmCompile_space_token = 97, vmCompile_simple_real_token = 108, | |
39 vmCompile_exponent_token = 111, vmCompile_fraction_part_token = 113, | |
40 vmCompile_digit_token, vmCompile_letter_token, | |
41 vmCompile_char_constant_element_token = 118, | |
42 vmCompile_not_single_quote_token, vmCompile_escape_sequence_token, | |
43 vmCompile_string_chars_token, vmCompile_string_char_token = 123, | |
44 vmCompile_not_double_quote_token, vmCompile_octal_escape_token = 136, | |
45 vmCompile_hex_escape_token, vmCompile_one_octal_token, | |
46 vmCompile_two_octal_token, vmCompile_three_octal_token, | |
47 vmCompile_hex_digit_token = 144, vmCompile_name_string_token = 155, | |
48 vmCompile_real_token = 204, vmCompile_string_literal_token, | |
49 vmCompile_character_constant_token = 207, vmCompile_integer_token = 217 | |
50 } vmCompile_token_type; | |
51 | |
52 typedef struct vmCompile_pcb_struct{ | |
53 vmCompile_token_type token_number, reduction_token, error_frame_token; | |
54 int input_code; | |
55 int input_value; | |
56 int line, column; | |
57 int ssx, sn, error_frame_ssx; | |
58 int drt, dssx, dsn; | |
59 int ss[128]; | |
60 vmCompile_vs_type vs[128]; | |
61 int ag_ap; | |
62 const char *error_message; | |
63 char read_flag; | |
64 char exit_flag; | |
65 int bts[128], btsx; | |
66 unsigned char * pointer; | |
67 unsigned char * la_ptr; | |
68 const unsigned char *key_sp; | |
69 int save_index, key_state; | |
70 char ag_msg[82]; | |
71 const int *ag_dtl; | |
72 int ag_dsn; | |
73 } vmCompile_pcb_type; | |
74 | |
75 #ifndef PRULE_CONTEXT | |
76 #define PRULE_CONTEXT(pcb) (&((pcb).cs[(pcb).ssx])) | |
77 #define PERROR_CONTEXT(pcb) ((pcb).cs[(pcb).error_frame_ssx]) | |
78 #define PCONTEXT(pcb) ((pcb).cs[(pcb).ssx]) | |
79 #endif | |
80 | |
81 #ifndef AG_RUNNING_CODE | |
82 /* PCB.exit_flag values */ | |
83 #define AG_RUNNING_CODE 0 | |
84 #define AG_SUCCESS_CODE 1 | |
85 #define AG_SYNTAX_ERROR_CODE 2 | |
86 #define AG_REDUCTION_ERROR_CODE 3 | |
87 #define AG_STACK_ERROR_CODE 4 | |
88 #define AG_SEMANTIC_ERROR_CODE 5 | |
89 #endif | |
90 | |
91 extern vmCompile_pcb_type vmCompile_pcb; | |
92 void init_vmCompile(void); | |
93 void vmCompile(void); | |
94 | |
95 Code vmCompile_value(void); | |
96 #endif | |
97 |