10 extern struct obstack ast_obstack;
26 declaration_t *declarations;
30 expresion_type_t type;
32 source_position_t source_position;
36 expression_t expression;
40 struct string_literal_t {
41 expression_t expression;
45 struct reference_expression_t {
46 expression_t expression;
48 declaration_t *declaration;
51 struct call_argument_t {
52 expression_t *expression;
53 call_argument_t *next;
56 struct call_expression_t {
57 expression_t expression;
59 call_argument_t *arguments;
66 UNEXPR_BITWISE_NEGATE,
70 UNEXPR_POSTFIX_INCREMENT,
71 UNEXPR_POSTFIX_DECREMENT,
72 UNEXPR_PREFIX_INCREMENT,
73 UNEXPR_PREFIX_DECREMENT,
75 } unary_expression_type_t;
77 struct unary_expression_t {
78 expression_t expression;
79 unary_expression_type_t type;
109 BINEXPR_SHIFTLEFT_ASSIGN,
110 BINEXPR_SHIFTRIGHT_ASSIGN,
111 BINEXPR_BITWISE_AND_ASSIGN,
112 BINEXPR_BITWISE_XOR_ASSIGN,
113 BINEXPR_BITWISE_OR_ASSIGN
114 } binary_expression_type_t;
116 struct binary_expression_t {
117 expression_t expression;
118 binary_expression_type_t type;
123 struct select_expression_t {
124 expression_t expression;
125 expression_t *compound;
128 declaration_t *compound_entry;
131 struct array_access_expression_t {
132 expression_t expression;
133 expression_t *array_ref;
137 struct sizeof_expression_t {
138 expression_t expression;
142 struct conditional_expression_t {
143 expression_t expression;
144 expression_t *condition;
145 expression_t *true_expression;
146 expression_t *false_expression;
149 struct expression_list_element_t {
150 expression_t *expression;
154 struct comma_expression_t {
155 expression_t expression;
156 expression_list_element_t *expressions;
161 STORAGE_CLASS_TYPEDEF,
162 STORAGE_CLASS_EXTERN,
163 STORAGE_CLASS_STATIC,
165 STORAGE_CLASS_REGISTER
168 struct declaration_t {
169 storage_class_t storage_class;
172 statement_t *statement;
173 source_position_t source_position;
183 STATEMENT_DECLARATION,
185 STATEMENT_EXPRESSION,
191 statement_type_t type;
193 source_position_t source_position;
196 struct return_statement_t {
197 statement_t statement;
198 expression_t *return_value;
201 struct compound_statement_t {
202 statement_t statement;
203 statement_t *first_statement;
207 struct declaration_statement_t {
208 statement_t statement;
209 declaration_t declaration;
211 int value_number; /**< filled in by semantic phase */
215 struct if_statement_t {
216 statement_t statement;
217 expression_t *condition;
218 statement_t *true_statement;
219 statement_t *false_statement;
222 struct goto_statement_t {
223 statement_t statement;
224 symbol_t *label_symbol;
225 label_statement_t *label;
228 struct label_statement_t {
229 statement_t statement;
233 struct expression_statement_t {
234 statement_t statement;
235 expression_t *expression;
238 struct translation_unit_t {
243 void *_allocate_ast(size_t size)
245 return obstack_alloc(&ast_obstack, size);
248 #define allocate_ast(size) _allocate_ast(size)