comparison lwasm/main.c @ 329:c15cca3ae6a2

Created first pass of input layer
author lost
date Sun, 28 Feb 2010 05:01:31 +0000
parents 591d01b343b9
children 81c005b82775
comparison
equal deleted inserted replaced
328:591d01b343b9 329:c15cca3ae6a2
23 23
24 #include <argp.h> 24 #include <argp.h>
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <stdlib.h> 26 #include <stdlib.h>
27 27
28 #include <lw_alloc.h>
28 #include <lw_string.h> 29 #include <lw_string.h>
29 #include <lw_stringlist.h> 30 #include <lw_stringlist.h>
30 31
31 #include "lwasm.h" 32 #include "lwasm.h"
32 33
166 /* assembler state */ 167 /* assembler state */
167 asmstate_t asmstate = { 0 }; 168 asmstate_t asmstate = { 0 };
168 program_name = argv[0]; 169 program_name = argv[0];
169 170
170 /* initialize assembler state */ 171 /* initialize assembler state */
172 asmstate.include_list = lw_stringlist_create();
171 asmstate.input_files = lw_stringlist_create(); 173 asmstate.input_files = lw_stringlist_create();
172 asmstate.include_list = lw_stringlist_create(); 174 asmstate.file_dir = lw_stack_create(lw_free);
175 input_init();
173 176
174 /* parse command line arguments */ 177 /* parse command line arguments */
175 argp_parse(&argp, argc, argv, 0, 0, &asmstate); 178 argp_parse(&argp, argc, argv, 0, 0, &asmstate);
176 179
177 if (!asmstate.output_file) 180 if (!asmstate.output_file)