4 * Basic parsing data structures. Statements and symbols.
6 * Copyright (C) 2003 Transmeta Corp.
9 * Licensed under the Open Software License version 1.1
32 enum statement_type type
;
35 struct /* declaration */ {
36 struct symbol_list
*declaration
;
38 struct /* label_arg */ {
40 struct statement
*label_statement
;
43 struct expression
*expression
;
44 struct expression
*context
;
46 struct /* return_statement */ {
47 struct expression
*ret_value
;
48 struct symbol
*ret_target
;
50 struct /* if_statement */ {
51 struct expression
*if_conditional
;
52 struct statement
*if_true
;
53 struct statement
*if_false
;
55 struct /* compound_struct */ {
56 struct statement_list
*stmts
;
58 struct symbol
*inline_fn
;
59 struct statement
*args
;
61 struct /* labeled_struct */ {
62 struct symbol
*label_identifier
;
63 struct statement
*label_statement
;
65 struct /* case_struct */ {
66 struct expression
*case_expression
;
67 struct expression
*case_to
;
68 struct statement
*case_statement
;
69 struct symbol
*case_label
;
71 struct /* switch_struct */ {
72 struct expression
*switch_expression
;
73 struct statement
*switch_statement
;
74 struct symbol
*switch_break
, *switch_case
;
76 struct /* iterator_struct */ {
77 struct symbol
*iterator_break
;
78 struct symbol
*iterator_continue
;
79 struct symbol_list
*iterator_syms
;
80 struct statement
*iterator_pre_statement
;
81 struct expression
*iterator_pre_condition
;
83 struct statement
*iterator_statement
;
85 struct statement
*iterator_post_statement
;
86 struct expression
*iterator_post_condition
;
88 struct /* goto_struct */ {
89 struct symbol
*goto_label
;
91 /* computed gotos have these: */
92 struct expression
*goto_expression
;
93 struct symbol_list
*target_list
;
95 struct /* goto_bb */ {
96 struct expression
*bb_conditional
;
97 struct symbol
*bb_target
;
99 struct /* multijmp */ {
100 struct expression
*multi_from
;
101 struct expression
*multi_to
;
102 struct symbol
*multi_target
;
105 struct expression
*asm_string
;
106 struct expression_list
*asm_outputs
;
107 struct expression_list
*asm_inputs
;
108 struct expression_list
*asm_clobbers
;
111 struct expression
*range_expression
;
112 struct expression
*range_low
;
113 struct expression
*range_high
;
118 extern struct symbol_list
*function_computed_target_list
;
119 extern struct statement_list
*function_computed_goto_list
;
121 extern struct token
*parse_expression(struct token
*, struct expression
**);
122 extern struct symbol
*label_symbol(struct token
*token
);
124 extern int show_statement(struct statement
*);
125 extern void show_statement_list(struct statement_list
*, const char *);
126 extern int show_expression(struct expression
*);
128 extern struct token
*external_declaration(struct token
*token
, struct symbol_list
**list
);
130 extern struct symbol
*ctype_integer(int size
, int want_unsigned
);
132 extern void copy_statement(struct statement
*src
, struct statement
*dst
);
133 extern int inline_function(struct expression
*expr
, struct symbol
*sym
);
134 extern void uninline(struct symbol
*sym
);
135 extern void init_parser(int);