4 * Basic parsing data structures. Statements and symbols.
6 * Copyright (C) 2003 Transmeta Corp.
9 * Licensed under the Open Software License version 1.1
29 enum statement_type type
;
32 struct /* label_arg */ {
34 struct statement
*label_statement
;
36 struct expression
*expression
;
37 struct /* return_statement */ {
38 struct expression
*ret_value
;
39 struct symbol
*ret_target
;
41 struct /* if_statement */ {
42 struct expression
*if_conditional
;
43 struct statement
*if_true
;
44 struct statement
*if_false
;
46 struct /* compound_struct */ {
47 struct symbol_list
*syms
;
48 struct statement_list
*stmts
;
51 struct /* labeled_struct */ {
52 struct symbol
*label_identifier
;
53 struct statement
*label_statement
;
55 struct /* case_struct */ {
56 struct expression
*case_expression
;
57 struct expression
*case_to
;
58 struct statement
*case_statement
;
59 struct symbol
*case_label
;
61 struct /* switch_struct */ {
62 struct expression
*switch_expression
;
63 struct statement
*switch_statement
;
64 struct symbol
*switch_break
, *switch_case
;
66 struct /* iterator_struct */ {
67 struct symbol
*iterator_break
;
68 struct symbol
*iterator_continue
;
69 struct symbol_list
*iterator_syms
;
70 struct statement
*iterator_pre_statement
;
71 struct expression
*iterator_pre_condition
;
73 struct statement
*iterator_statement
;
75 struct statement
*iterator_post_statement
;
76 struct expression
*iterator_post_condition
;
78 struct /* goto_struct */ {
79 struct symbol
*goto_label
;
80 struct expression
*goto_expression
;
85 extern struct token
*parse_expression(struct token
*, struct expression
**);
86 extern struct token
*statement_list(struct token
*, struct statement_list
**);
87 extern struct symbol
*label_symbol(struct token
*token
);
89 extern int show_statement(struct statement
*);
90 extern void show_statement_list(struct statement_list
*, const char *);
91 extern int show_expression(struct expression
*);
92 extern void translation_unit(struct token
*, struct symbol_list
**);
94 extern struct symbol
*ctype_integer(unsigned int spec
);
95 extern struct symbol
*ctype_fp(unsigned int spec
);
97 extern int match_string_ident(struct ident
*, const char *);
98 extern void copy_statement(struct statement
*src
, struct statement
*dst
);
99 extern int inline_function(struct expression
*expr
, struct symbol
*sym
);