aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
blob: 73669329f94b1d60211c8624a824635d7fcb8bc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include <stdlib.h>

#include "include/util.h"
#include "include/token.h"
#include "include/pp.h"
#include "include/lexer.h"
#include "include/source.h"
#include "include/hlkt.h"

int main(int argc, char* argv[]) {
   char*    source;
   /*lexer_t* lexer;*/
   /*int      in_file;*/
   pp_t*    pp;

   source = source_get(argv[1]); 

   pp = pp_init(source);
   HLKT_ASS(pp);
   log_inf("preprocessor created");

   /*
   lexer = lexer_init(source);
   HLKT_ASS(lexer);
   log_inf("lexer created");

   log_inf("BEGIN INPUT");
   log_raw(lexer->content);
   log_inf("END INPUT");

   in_file = 1;
   */

   pp_run(pp);

   log_raw("%s\n%s", source, pp->psrc);

   // clean up
   /*lexer_destroy(lexer);*/
   pp_destroy(pp);

   free(source);

   HLKT_LOG();

   return 0;
}