5bade2d34d3bb5c2386c1ca39ea063ca0106568f
[oweals/cde.git] / cde / programs / dthelp / parser / pass2 / build / build.c
1 /* $XConsortium: build.c /main/3 1995/11/08 10:41:26 rswiston $ */
2 /*
3               Copyright 1986 Tandem Computers Incorporated.
4 This product and information is proprietary of Tandem Computers Incorporated.
5                    Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.
6 */
7
8 /* Build.c contains the main procedure for program BUILD */
9
10 #include <string.h>
11 #include <malloc.h>
12 #if defined(MSDOS)
13 #include <process.h>
14 #endif
15 #include "context.h"
16 #define BUILDEF
17 #include "build.h"
18 #include "delim.h"
19 #include "entdef.h"
20
21 /* Main procedure */
22 void main(argc, argv)
23 int argc ;
24 char **argv ;
25 {
26 int m_prevcon ;
27
28 if (argc > 1)
29     {
30     if (strchr(argv[1], 'a')) m_malftrace = TRUE ;
31     if (strchr(argv[1], 'A')) m_malftrace = TRUE ;
32     if (strchr(argv[1], 'a')) m_malftrace = TRUE ;
33     if (strchr(argv[1], 'H')) m_heapchk = TRUE ;
34     if (strchr(argv[1], 'm')) standard = TRUE ;
35     if (strchr(argv[1], 'M')) standard = TRUE ;
36     if (strchr(argv[1], 's')) scantrace = TRUE ;
37     if (strchr(argv[1], 'S')) scantrace = TRUE ;
38     }
39 initialize() ;
40 while (TRUE)
41     {
42     m_token = scan() ;
43     m_prevcon = curcon ;
44     curcon = m_newcon(m_prevcon - 1, m_token - 1) ;
45     if (scantrace)
46     printf(
47     "m_prevcon=%d, m_token=%d, curcon=%d, scanval = %c (%d), line=%d\n",
48     m_prevcon, m_token, curcon, scanval, scanval, m_line) ;
49     #include "case.c"
50     if (m_token == ENDFILE) exit(FALSE) ;
51     }
52 }