ack/util/LLgen/src/global.c

90 lines
1.7 KiB
C
Raw Normal View History

/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
1995-07-31 09:17:14 +00:00
* For full copyright and restrictions on use see the file COPYING in the top
1995-07-31 09:10:42 +00:00
* level of the LLgen tree.
1984-10-08 14:14:53 +00:00
*/
/*
* L L G E N
*
* An Extended LL(1) Parser Generator
*
* Author : Ceriel J.H. Jacobs
*/
/*
* global.c
* Contains declarations visible in several other source files
*/
#include <stdio.h>
1984-10-08 14:14:53 +00:00
# include "types.h"
# include "extern.h"
1984-10-08 14:14:53 +00:00
# include "io.h"
1984-10-08 17:11:03 +00:00
# ifndef NORCSID
1994-06-24 11:31:16 +00:00
static string rcsid4 = "$Id$";
1984-10-08 17:11:03 +00:00
# endif
1984-10-08 14:14:53 +00:00
char ltext[LTEXTSZ];
p_nont nonterms;
p_nont maxnt;
1984-10-08 14:14:53 +00:00
int nnonterms;
p_token tokens;
p_token maxt;
int ntokens;
1987-05-12 18:23:09 +00:00
int nterms, nalts;
int norder, torder;
#ifdef NON_CORRECTING
int nsubstarts;
p_set start_firsts;
#endif
1984-10-08 14:14:53 +00:00
p_start start;
int linecount;
int assval;
FILE *fout;
FILE *fpars;
FILE *finput;
FILE *fact;
char f_pars[L_tmpnam+sizeof(char)]; /* Add one more character for NULL, just in case of buggy implementations. */
char f_temp[L_tmpnam+sizeof(char)];
#ifdef NON_CORRECTING
char f_nc[20];
#endif
char f_out[20];
1984-10-08 14:14:53 +00:00
string f_input;
char f_include[20];
char f_rec[20];
1984-10-08 14:14:53 +00:00
string e_noopen = "Cannot open %s";
int verbose;
1987-11-27 11:04:07 +00:00
int wflag;
1984-10-08 14:14:53 +00:00
string lexical;
string prefix;
string onerror;
1984-10-08 14:14:53 +00:00
int ntneeded;
int ntprint;
# ifndef NDEBUG
int debug;
#endif /* not NDEBUG */
1984-10-08 14:14:53 +00:00
p_file files;
p_file maxfiles;
1984-10-08 14:14:53 +00:00
p_file pfile;
string LLgenid = "/* LLgen generated code from source %s */\n";
t_token lextoken;
int nerrors;
string rec_file, incl_file;
#ifdef NON_CORRECTING
string nc_rec_file, nc_incl_file;
#endif
1988-06-22 16:23:36 +00:00
int low_percentage = 10, high_percentage = 30;
int min_cases_for_jmptable = 8;
int jmptable_option;
#ifdef NON_CORRECTING
int non_corr = 0;
int subpars_sim = 0;
p_gram illegal_gram;
#endif
int strip_grammar = 0;
int in_production; /* set when the parser is reading a production
rule.
*/