10 extern struct obstack ast_obstack;
26 expresion_type_t type;
28 source_position_t source_position;
32 expression_t expression;
36 struct string_literal_t {
37 expression_t expression;
41 struct reference_expression_t {
42 expression_t expression;
45 declaration_t *declaration;
49 struct call_argument_t {
50 expression_t *expression;
51 call_argument_t *next;
54 struct call_expression_t {
55 expression_t expression;
57 call_argument_t *arguments;
64 UNEXPR_BITWISE_NEGATE,
68 UNEXPR_POSTFIX_INCREMENT,
69 UNEXPR_POSTFIX_DECREMENT,
70 UNEXPR_PREFIX_INCREMENT,
71 UNEXPR_PREFIX_DECREMENT,
73 } unary_expression_type_t;
75 struct unary_expression_t {
76 expression_t expression;
77 unary_expression_type_t type;
107 BINEXPR_SHIFTLEFT_ASSIGN,
108 BINEXPR_SHIFTRIGHT_ASSIGN,
109 BINEXPR_BITWISE_AND_ASSIGN,
110 BINEXPR_BITWISE_XOR_ASSIGN,
111 BINEXPR_BITWISE_OR_ASSIGN
112 } binary_expression_type_t;
114 struct binary_expression_t {
115 expression_t expression;
116 binary_expression_type_t type;
121 struct select_expression_t {
122 expression_t expression;
123 expression_t *compound;
126 compound_entry_t *compound_entry;
129 struct array_access_expression_t {
130 expression_t expression;
131 expression_t *array_ref;
135 struct sizeof_expression_t {
136 expression_t expression;
139 expression_t *size_expression;
143 struct conditional_expression_t {
144 expression_t expression;
145 expression_t *condition;
146 expression_t *true_expression;
147 expression_t *false_expression;
150 struct expression_list_element_t {
151 expression_t *expression;
155 struct comma_expression_t {
156 expression_t expression;
157 expression_list_element_t *expressions;
162 STORAGE_CLASS_TYPEDEF,
163 STORAGE_CLASS_EXTERN,
164 STORAGE_CLASS_STATIC,
166 STORAGE_CLASS_REGISTER
169 struct method_parameter_t {
170 method_parameter_t *next;
176 struct declaration_t {
177 storage_class_t storage_class;
180 method_parameter_t *parameters;
181 statement_t *statement;
182 source_position_t source_position;
189 STATEMENT_DECLARATION,
191 STATEMENT_EXPRESSION,
197 statement_type_t type;
199 source_position_t source_position;
202 struct return_statement_t {
203 statement_t statement;
204 expression_t *return_value;
207 struct block_statement_t {
208 statement_t statement;
209 statement_t *first_statement;
212 struct declaration_statement_t {
213 statement_t statement;
214 declaration_t declaration;
216 int value_number; /**< filled in by semantic phase */
220 struct if_statement_t {
221 statement_t statement;
222 expression_t *condition;
223 statement_t *true_statement;
224 statement_t *false_statement;
227 struct goto_statement_t {
228 statement_t statement;
229 symbol_t *label_symbol;
230 label_statement_t *label;
233 struct label_statement_t {
234 statement_t statement;
238 struct expression_statement_t {
239 statement_t statement;
240 expression_t *expression;
243 struct unit_entry_t {
244 declaration_t declaration;
248 struct translation_unit_t {
249 unit_entry_t *entries;
253 void *_allocate_ast(size_t size)
255 return obstack_alloc(&ast_obstack, size);
258 #define allocate_ast(size) _allocate_ast(size)