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 variable_declaration_statement_t *variable;
47 global_variable_t *global_variable;
48 method_parameter_t *method_parameter;
52 struct call_argument_t {
53 expression_t *expression;
54 call_argument_t *next;
57 struct call_expression_t {
58 expression_t expression;
60 call_argument_t *arguments;
67 UNEXPR_BITWISE_NEGATE,
71 UNEXPR_POSTFIX_INCREMENT,
72 UNEXPR_POSTFIX_DECREMENT,
73 UNEXPR_PREFIX_INCREMENT,
74 UNEXPR_PREFIX_DECREMENT,
76 } unary_expression_type_t;
78 struct unary_expression_t {
79 expression_t expression;
80 unary_expression_type_t type;
110 BINEXPR_SHIFTLEFT_ASSIGN,
111 BINEXPR_SHIFTRIGHT_ASSIGN,
112 BINEXPR_BITWISE_AND_ASSIGN,
113 BINEXPR_BITWISE_XOR_ASSIGN,
114 BINEXPR_BITWISE_OR_ASSIGN
115 } binary_expression_type_t;
117 struct binary_expression_t {
118 expression_t expression;
119 binary_expression_type_t type;
124 struct select_expression_t {
125 expression_t expression;
126 expression_t *compound;
129 compound_entry_t *compound_entry;
132 struct array_access_expression_t {
133 expression_t expression;
134 expression_t *array_ref;
138 struct sizeof_expression_t {
139 expression_t expression;
142 expression_t *size_expression;
146 struct conditional_expression_t {
147 expression_t expression;
148 expression_t *condition;
149 expression_t *true_expression;
150 expression_t *false_expression;
153 struct expression_list_element_t {
154 expression_t *expression;
158 struct comma_expression_t {
159 expression_t expression;
160 expression_list_element_t *expressions;
167 STATEMENT_VARIABLE_DECLARATION,
169 STATEMENT_EXPRESSION,
175 statement_type_t type;
177 source_position_t source_position;
180 struct return_statement_t {
181 statement_t statement;
182 expression_t *return_value;
185 struct block_statement_t {
186 statement_t statement;
187 statement_t *first_statement;
190 struct variable_declaration_statement_t {
191 statement_t statement;
195 int value_number; /**< filled in by semantic phase */
199 struct if_statement_t {
200 statement_t statement;
201 expression_t *condition;
202 statement_t *true_statement;
203 statement_t *false_statement;
206 struct goto_statement_t {
207 statement_t statement;
208 symbol_t *label_symbol;
209 label_statement_t *label;
212 struct label_statement_t {
213 statement_t statement;
217 struct expression_statement_t {
218 statement_t statement;
219 expression_t *expression;
222 enum namespace_entry_type_t {
223 NAMESPACE_ENTRY_INVALID,
224 NAMESPACE_ENTRY_METHOD,
225 NAMESPACE_ENTRY_VARIABLE,
228 struct namespace_entry_t {
229 namespace_entry_type_t type;
230 namespace_entry_t *next;
231 source_position_t source_position;
234 struct method_parameter_t {
235 method_parameter_t *next;
242 namespace_entry_t namespace_entry;
245 method_parameter_t *parameters;
247 statement_t *statement;
250 struct global_variable_t {
251 namespace_entry_t namespace_entry;
257 namespace_entry_t *entries;
261 void *_allocate_ast(size_t size)
263 return obstack_alloc(&ast_obstack, size);
266 #define allocate_ast(size) _allocate_ast(size)