don't assert if a struct-type symbol hasn't been defined
[xorcyst.git] / RCS / astproc.h,v
blob8de4abff1147eec8f26545b1f0692845c5db7cf2
1 head    1.5;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
8 1.5
9 date    2007.08.12.18.59.10;    author khansen; state Exp;
10 branches;
11 next    1.4;
13 1.4
14 date    2007.08.12.02.42.46;    author khansen; state Exp;
15 branches;
16 next    1.3;
18 1.3
19 date    2007.07.22.13.35.20;    author khansen; state Exp;
20 branches;
21 next    1.2;
23 1.2
24 date    2004.12.06.04.54.00;    author kenth;   state Exp;
25 branches;
26 next    1.1;
28 1.1
29 date    2004.06.30.07.56.12;    author kenth;   state Exp;
30 branches;
31 next    ;
34 desc
38 1.5
39 log
40 @ability to generate pure 6502 binary
42 text
43 @/*
44  * $Id: astproc.h,v 1.4 2007/08/12 02:42:46 khansen Exp khansen $
45  * $Log: astproc.h,v $
46  * Revision 1.4  2007/08/12 02:42:46  khansen
47  * prettify, const
48  *
49  * Revision 1.3  2007/07/22 13:35:20  khansen
50  * convert tabs to whitespaces
51  *
52  * Revision 1.2  2004/12/06 04:54:00  kenth
53  * xorcyst 1.1.0
54  *
55  * Revision 1.1  2004/06/30 07:56:12  kenth
56  * Initial revision
57  *
58  */
60 /**
61  *    (C) 2004 Kent Hansen
62  *
63  *    The XORcyst is free software; you can redistribute it and/or modify
64  *    it under the terms of the GNU General Public License as published by
65  *    the Free Software Foundation; either version 2 of the License, or
66  *    (at your option) any later version.
67  *
68  *    The XORcyst is distributed in the hope that it will be useful,
69  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
70  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
71  *    GNU General Public License for more details.
72  *
73  *    You should have received a copy of the GNU General Public License
74  *    along with The XORcyst; if not, write to the Free Software
75  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
76  */
78 #ifndef ASTPROC_H
79 #define ASTPROC_H
81 #include "astnode.h"
83 /**
84  * Signature for procedure to process an AST node.
85  * @@param node The node to process
86  * @@param arg General-purpose argument
87  * @@param next Next node to process
88  * @@return 0 if node children should not be processed, 1 otherwise
89  */
90 typedef int (*astnodeproc)(astnode *, void *, astnode **);
92 /**
93  * Structure that represents a mapping from node type to processor function.
94  * All AST traversal functions rely on tables of such mappings.
95  */
96 struct tag_astnodeprocmap {
97     astnode_type type;  /* The AST node type (*_NODE, see header file) */
98     astnodeproc proc;   /* The function that will process nodes of type */
101 typedef struct tag_astnodeprocmap astnodeprocmap;
103 /* Function prototypes */
104 void astproc_first_pass(astnode *);
105 void astproc_second_pass(astnode *);
106 void astproc_third_pass(astnode *);
107 void astproc_fourth_pass(astnode *);
108 void astproc_fifth_pass(astnode *);
109 void astproc_walk(astnode *, void *, const astnodeprocmap *);
110 int astproc_err_count();
112 #endif  /* !ASTPROC_H */
118 @prettify, const
120 text
121 @d2 1
122 a2 1
123  * $Id: astproc.h,v 1.3 2007/07/22 13:35:20 khansen Exp khansen $
124 d4 3
125 d65 2
131 @convert tabs to whitespaces
133 text
134 @d2 1
135 a2 1
136  * $Id: astproc.h,v 1.2 2004/12/06 04:54:00 kenth Exp khansen $
137 d4 3
138 d62 1
139 a62 1
140 void astproc_walk(astnode *, void *, astnodeprocmap *);
146 @xorcyst 1.1.0
148 text
149 @d2 1
150 a2 1
151  * $Id: astproc.h,v 1.1 2004/06/30 07:56:12 kenth Exp $
152 d4 3
153 d49 2
154 a50 2
155         astnode_type type;      /* The AST node type (*_NODE, see header file) */
156         astnodeproc proc;       /* The function that will process nodes of type */
157 d62 1
158 a62 1
159 #endif  /* !ASTPROC_H */
165 @Initial revision
167 text
168 @d2 5
169 a6 2
170  * $Id$
171  * $Log$
172 d32 20
173 d53 4
174 a56 17
175 void astproc_enter_macros(astnode *);
176 void astproc_expand_macros(astnode *);
177 void astproc_remove_macro_decls(astnode *);
178 void astproc_enter_labels(astnode *);
179 void astproc_count_symbol_references(astnode *);
180 void astproc_remove_unused_labels(astnode *);
181 void astproc_tag_extrn_and_public_symbols(astnode *);
182 void astproc_remove_conditionals(astnode *);
183 void astproc_globalize_locals(astnode *);
184 astnode *astproc_fold_constants(astnode *);
185 void astproc_validate_data_segments(astnode *);
186 void astproc_validate_symbol_references(astnode *);
187 void astproc_validate_instruction_operands(astnode *);
188 void astproc_translate_instructions(astnode *);
189 void astproc_merge_data_nodes(astnode *);
190 void astproc_substitute_defines(astnode *);
191 void astproc_expand_incbins(astnode *);