Pristine Ack-5.5
[Ack-5.5.git] / util / LLgen / src / global.c
1 /* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
2  * For full copyright and restrictions on use see the file COPYING in the top
3  * level of the LLgen tree.
4  */
5
6 /*
7  *  L L G E N
8  *
9  *  An Extended LL(1) Parser Generator
10  *
11  *  Author : Ceriel J.H. Jacobs
12  */
13
14 /*
15  * global.c
16  * Contains declarations visible in several other source files
17  */
18
19 # include "types.h"
20 # include "extern.h"
21 # include "io.h"
22
23 # ifndef NORCSID
24 static string rcsid4 = "$Id: global.c,v 2.16 1997/02/21 11:27:51 ceriel Exp $";
25 # endif
26
27 char    ltext[LTEXTSZ];
28 p_nont  nonterms;
29 p_nont  maxnt;
30 int     nnonterms;
31 p_token tokens;
32 p_token maxt;
33 int     ntokens;
34 int     nterms, nalts;
35 int     norder, torder;
36 #ifdef NON_CORRECTING
37 int     nsubstarts;
38 p_set   start_firsts;
39 #endif
40 p_start start;
41 int     linecount;
42 int     assval;
43 FILE    *fout;
44 FILE    *fpars;
45 FILE    *finput;
46 FILE    *fact;
47 char    f_pars[] = PARSERFILE;
48 char    f_temp[] = ACTFILE;
49 #ifdef NON_CORRECTING
50 char    f_nc[20];
51 #endif
52 char    f_out[20];
53 string  f_input;
54 char    f_include[20];
55 char    f_rec[20];
56 string  e_noopen = "Cannot open %s";
57 int     verbose;
58 int     wflag;
59 string  lexical;
60 string  prefix;
61 string  onerror;
62 int     ntneeded;
63 int     ntprint;
64 # ifndef NDEBUG
65 int     debug;
66 #endif /* not NDEBUG */
67 p_file  files;
68 p_file  maxfiles;
69 p_file  pfile;
70 string  LLgenid = "/* LLgen generated code from source %s */\n";
71 t_token lextoken;
72 int     nerrors;
73 string  rec_file, incl_file;
74 #ifdef NON_CORRECTING
75 string  nc_rec_file, nc_incl_file;
76 #endif
77 int     low_percentage = 10, high_percentage = 30;
78 int     min_cases_for_jmptable = 8;
79 int     jmptable_option;
80 int     ansi_c = 0;
81 #ifdef NON_CORRECTING
82 int     non_corr = 0;
83 int     subpars_sim = 0;
84 p_gram  illegal_gram;
85 #endif
86 int     strip_grammar = 0;
87 int     in_production;          /* set when the parser is reading a production
88                                    rule.
89                                 */