9 date 2007.08.12.18.59.10; author khansen; state Exp;
14 date 2007.08.12.02.42.46; author khansen; state Exp;
19 date 2007.07.22.13.35.20; author khansen; state Exp;
24 date 2004.12.06.04.54.00; author kenth; state Exp;
29 date 2004.06.30.07.56.12; author kenth; state Exp;
40 @ability to generate pure 6502 binary
44 * $Id: astproc.h,v 1.4 2007/08/12 02:42:46 khansen Exp khansen $
46 * Revision 1.4 2007/08/12 02:42:46 khansen
49 * Revision 1.3 2007/07/22 13:35:20 khansen
50 * convert tabs to whitespaces
52 * Revision 1.2 2004/12/06 04:54:00 kenth
55 * Revision 1.1 2004/06/30 07:56:12 kenth
61 * (C) 2004 Kent Hansen
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.
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.
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
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
90 typedef int (*astnodeproc)(astnode *, void *, astnode **);
93 * Structure that represents a mapping from node type to processor function.
94 * All AST traversal functions rely on tables of such mappings.
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 */
123 * $Id: astproc.h,v 1.3 2007/07/22 13:35:20 khansen Exp khansen $
131 @convert tabs to whitespaces
136 * $Id: astproc.h,v 1.2 2004/12/06 04:54:00 kenth Exp khansen $
140 void astproc_walk(astnode *, void *, astnodeprocmap *);
151 * $Id: astproc.h,v 1.1 2004/06/30 07:56:12 kenth Exp $
155 astnode_type type; /* The AST node type (*_NODE, see header file) */
156 astnodeproc proc; /* The function that will process nodes of type */
159 #endif /* !ASTPROC_H */
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 *);