Rune - Content-locking work 1/2
[rune.git] / tests / dparse.c
1 /*
2  * TEST_DPARSE.C
3  *
4  * (c)Copyright 1993-2014, Matthew Dillon, All Rights Reserved.  See the  
5  *    COPYRIGHT file at the base of the distribution.
6  */
7
8 #include "defs.h"
9
10 int
11 main(int ac, char **av)
12 {
13         int i;
14
15         LibRuneInit();
16         LibGenInterpInit();
17
18         for (i = 1; i < ac; ++i) {
19                 Stmt *st;
20                 Parse *p;
21                 int t;
22
23                 DebugOpt = 1;
24                 st = BuildRootImportStmt(av[i]);
25                 t = ParseOpen(st, &p, NULL);
26                 if ((t & TOKF_ERROR) == 0) {
27                         t = ParseModule(p, st, t);
28                         if ((t & TOKF_ERROR) == 0) {
29                                 printf("Resolving for Interpreter\n");
30                                 ResolveProject(p, st);
31                                 (void)st->st_Func(NULL, st);
32                                 printf("Run Complete\n");
33                         } else {
34                                 LexPrintError(&p->p_Token);
35                         }
36                 }
37         }
38         return(0);
39 }