Lines Matching refs:statement
51 static struct token *statement(struct token *token, struct statement **tree);
62 static struct token *parse_if_statement(struct token *token, struct statement *stmt);
63 static struct token *parse_return_statement(struct token *token, struct statement *stmt);
64 static struct token *parse_loop_iterator(struct token *token, struct statement *stmt);
65 static struct token *parse_default_statement(struct token *token, struct statement *stmt);
66 static struct token *parse_case_statement(struct token *token, struct statement *stmt);
67 static struct token *parse_switch_statement(struct token *token, struct statement *stmt);
68 static struct token *parse_for_statement(struct token *token, struct statement *stmt);
69 static struct token *parse_while_statement(struct token *token, struct statement *stmt);
70 static struct token *parse_do_statement(struct token *token, struct statement *stmt);
71 static struct token *parse_goto_statement(struct token *token, struct statement *stmt);
72 static struct token *parse_context_statement(struct token *token, struct statement *stmt);
73 static struct token *parse_range_statement(struct token *token, struct statement *stmt);
74 static struct token *parse_asm_statement(struct token *token, struct statement *stmt);
298 .statement = parse_if_statement,
302 .statement = parse_return_statement,
306 .statement = parse_loop_iterator,
310 .statement = parse_default_statement,
314 .statement = parse_case_statement,
318 .statement = parse_switch_statement,
322 .statement = parse_for_statement,
326 .statement = parse_while_statement,
330 .statement = parse_do_statement,
334 .statement = parse_goto_statement,
338 .statement = parse_context_statement,
343 .statement = parse_range_statement,
348 .statement = parse_asm_statement,
662 struct statement *alloc_statement(struct position pos, int type)
664 struct statement *stmt = __alloc_statement(0);
1981 return expect(token, ';', "at end of statement");
1984 static struct token *parse_asm_operands(struct token *token, struct statement *stmt,
2006 static struct token *parse_asm_clobbers(struct token *token, struct statement *stmt,
2019 static struct token *parse_asm_labels(struct token *token, struct statement *stmt,
2035 static struct token *parse_asm_statement(struct token *token, struct statement *stmt)
2060 return expect(token, ';', "at end of asm-statement");
2093 /* Make a statement out of an expression */
2094 static struct statement *make_statement(struct expression *expr)
2096 struct statement *stmt;
2114 static void start_iterator(struct statement *stmt)
2131 static void end_iterator(struct statement *stmt)
2136 static struct statement *start_function(struct symbol *sym)
2139 struct statement *stmt = alloc_statement(sym->pos, STMT_COMPOUND);
2163 * A "switch()" statement, like an iterator, has a
2171 * case/default statements to find the switch statement
2174 static void start_switch(struct statement *stmt)
2194 static void end_switch(struct statement *stmt)
2201 static void add_case_statement(struct statement *stmt)
2218 static struct token *parse_return_statement(struct token *token, struct statement *stmt)
2240 static struct token *parse_for_statement(struct token *token, struct statement *stmt)
2244 struct statement *iterator;
2262 token = statement(token, &iterator);
2275 static struct token *parse_while_statement(struct token *token, struct statement *stmt)
2278 struct statement *iterator;
2282 token = statement(token, &iterator);
2292 static struct token *parse_do_statement(struct token *token, struct statement *stmt)
2295 struct statement *iterator;
2298 token = statement(token->next, &iterator);
2310 warning(iterator->pos, "do-while statement is not a compound statement");
2312 return expect(token, ';', "after statement");
2315 static struct token *parse_if_statement(struct token *token, struct statement *stmt)
2319 token = statement(token, &stmt->if_true);
2324 return statement(token->next, &stmt->if_false);
2327 static inline struct token *case_statement(struct token *token, struct statement *stmt)
2332 return statement(token, &stmt->case_statement);
2335 static struct token *parse_case_statement(struct token *token, struct statement *stmt)
2343 static struct token *parse_default_statement(struct token *token, struct statement *stmt)
2348 static struct token *parse_loop_iterator(struct token *token, struct statement *stmt)
2355 return expect(token->next, ';', "at end of statement");
2358 static struct token *parse_switch_statement(struct token *token, struct statement *stmt)
2363 token = statement(token, &stmt->switch_statement);
2371 sparse_error(use, "label '%s' used outside statement expression", id);
2378 struct statement *def = label->stmt;
2389 static struct token *parse_goto_statement(struct token *token, struct statement *stmt)
2404 return expect(token, ';', "at end of statement");
2407 static struct token *parse_context_statement(struct token *token, struct statement *stmt)
2411 token = expect(token, '(', "after __context__ statement");
2422 token = expect(token, ')', "at end of __context__ statement");
2423 return expect(token, ';', "at end of statement");
2426 static struct token *parse_range_statement(struct token *token, struct statement *stmt)
2430 token = expect(token, '(', "after __range__ statement");
2436 token = expect(token, ')', "after range statement");
2437 return expect(token, ';', "after range statement");
2449 static struct token *statement(struct token *token, struct statement **tree)
2451 struct statement *stmt = alloc_statement(token->pos, STMT_NONE);
2456 if (s && s->op->statement)
2457 return s->op->statement(token, stmt);
2465 return statement(token, tree);
2476 warning(token->pos, "statement expected after label");
2480 return statement(token, &stmt->label_statement);
2486 return expect(token, '}', "at end of compound statement");
2516 struct statement * stmt;
2534 token = statement(token, &stmt);
2589 struct token *compound_statement(struct token *token, struct statement *stmt)
2741 struct statement *stmt, **p;
2875 struct statement *stmt;