4 * Basic parsing data structures. Statements and symbols.
6 * Copyright (C) 2003 Transmeta Corp.
9 * Licensed under the Open Software License version 1.1
27 /* These only show up after linearization */
32 enum statement_type type
;
35 struct /* label_arg */ {
37 struct statement
*label_statement
;
39 struct expression
*expression
;
40 struct /* return_statement */ {
41 struct expression
*ret_value
;
42 struct symbol
*ret_target
;
44 struct /* if_statement */ {
45 struct expression
*if_conditional
;
46 struct statement
*if_true
;
47 struct statement
*if_false
;
49 struct /* compound_struct */ {
50 struct symbol_list
*syms
;
51 struct statement_list
*stmts
;
54 struct /* labeled_struct */ {
55 struct symbol
*label_identifier
;
56 struct statement
*label_statement
;
58 struct /* case_struct */ {
59 struct expression
*case_expression
;
60 struct expression
*case_to
;
61 struct statement
*case_statement
;
62 struct symbol
*case_label
;
64 struct /* switch_struct */ {
65 struct expression
*switch_expression
;
66 struct statement
*switch_statement
;
67 struct symbol
*switch_break
, *switch_case
;
69 struct /* iterator_struct */ {
70 struct symbol
*iterator_break
;
71 struct symbol
*iterator_continue
;
72 struct symbol_list
*iterator_syms
;
73 struct statement
*iterator_pre_statement
;
74 struct expression
*iterator_pre_condition
;
76 struct statement
*iterator_statement
;
78 struct statement
*iterator_post_statement
;
79 struct expression
*iterator_post_condition
;
81 struct /* goto_struct */ {
82 struct symbol
*goto_label
;
83 struct expression
*goto_expression
;
85 struct /* goto_bb */ {
86 struct expression
*bb_conditional
;
87 struct basic_block
*bb_target
;
92 extern struct token
*parse_expression(struct token
*, struct expression
**);
93 extern struct token
*statement_list(struct token
*, struct statement_list
**);
94 extern struct symbol
*label_symbol(struct token
*token
);
96 extern int show_statement(struct statement
*);
97 extern void show_statement_list(struct statement_list
*, const char *);
98 extern int show_expression(struct expression
*);
99 extern void translation_unit(struct token
*, struct symbol_list
**);
101 extern struct symbol
*ctype_integer(unsigned int spec
);
102 extern struct symbol
*ctype_fp(unsigned int spec
);
104 extern int match_string_ident(struct ident
*, const char *);
105 extern void copy_statement(struct statement
*src
, struct statement
*dst
);
106 extern int inline_function(struct expression
*expr
, struct symbol
*sym
);