comparison Paper/source/rid-goto.c~ @ 47:e07c7952f237

add sources
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Wed, 23 Nov 2011 02:27:44 +0900
parents
children
comparison
equal deleted inserted replaced
46:db63cc25d890 47:e07c7952f237
1 case RID_GOTO:
2 c_parser_consume_token (parser);
3 #ifndef noCbC
4 if ( c_parser_next_token_is (parser, CPP_NAME)
5 && c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON )
6 {
7 #else
8 if (c_parser_next_token_is (parser, CPP_NAME))
9 {
10 #endif
11 stmt = c_finish_goto_label (loc,
12 c_parser_peek_token (parser)->value);
13 c_parser_consume_token (parser);
14 }
15 else if (c_parser_next_token_is (parser, CPP_MULT))
16 {
17 tree val;
18
19 c_parser_consume_token (parser);
20 val = c_parser_expression (parser).value;
21 mark_exp_read (val);
22 stmt = c_finish_goto_ptr (loc, val);
23 }
24 else
25 #ifndef noCbC
26 {
27 if (c_parser_next_token_is (parser, CPP_NAME))
28 {
29 tree id = c_parser_peek_token (parser)->value;
30 location_t loc = c_parser_peek_token (parser)->location;
31 /** build_external_ref (id,RID_CbC_CODE , loc); **/
32 build_external_ref (loc, id, RID_CbC_CODE, &expr.original_type);
33 }
34 expr = c_parser_expr_no_commas (parser, NULL);
35 if (TREE_CODE(expr.value) == CALL_EXPR )
36 {
37 location_t loc = c_parser_peek_token (parser)->location;
38 cbc_replace_arguments (loc, expr.value);
39
40 TREE_TYPE(expr.value) = void_type_node;
41 /*tree env = NULL_TREE;**/
42 CbC_IS_CbC_GOTO (expr.value) = 1;
43 CALL_EXPR_TAILCALL (expr.value) = 1;
44 add_stmt(expr.value);
45 stmt = c_finish_return(loc, NULL_TREE, NULL_TREE); /* stmt = c_finish_return (0); */
46 }
47 else
48 c_parser_error (parser, "expected code segment jump or %<*%>");
49 }
50 #else
51 c_parser_error (parser, "expected identifier or %<*%>");
52 #endif
53 goto expect_semicolon;