1991-11-23 10:41:43 +00:00
|
|
|
/* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
|
|
|
|
* All rights reserved.
|
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 "types.h"
|
1985-11-25 15:47:51 +00:00
|
|
|
# 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];
|
1985-11-25 15:47:51 +00:00
|
|
|
p_nont nonterms;
|
|
|
|
p_nont maxnt;
|
1984-10-08 14:14:53 +00:00
|
|
|
int nnonterms;
|
1985-11-25 15:47:51 +00:00
|
|
|
p_token tokens;
|
|
|
|
p_token maxt;
|
|
|
|
int ntokens;
|
1987-05-12 18:23:09 +00:00
|
|
|
int nterms, nalts;
|
1991-11-01 10:37:26 +00:00
|
|
|
int norder, torder;
|
1984-10-08 14:14:53 +00:00
|
|
|
p_start start;
|
|
|
|
int linecount;
|
|
|
|
int assval;
|
|
|
|
FILE *fout;
|
|
|
|
FILE *fpars;
|
|
|
|
FILE *finput;
|
|
|
|
FILE *fact;
|
1990-01-29 13:45:42 +00:00
|
|
|
char f_pars[] = PARSERFILE;
|
|
|
|
char f_temp[] = ACTFILE;
|
|
|
|
char f_out[20];
|
1984-10-08 14:14:53 +00:00
|
|
|
string f_input;
|
1990-01-29 13:45:42 +00:00
|
|
|
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;
|
1990-01-29 13:45:42 +00:00
|
|
|
string prefix;
|
1987-02-16 21:38:52 +00:00
|
|
|
string onerror;
|
1984-10-08 14:14:53 +00:00
|
|
|
int ntneeded;
|
|
|
|
int ntprint;
|
|
|
|
# ifndef NDEBUG
|
|
|
|
int debug;
|
1991-12-17 15:28:58 +00:00
|
|
|
#endif /* not NDEBUG */
|
1984-10-08 14:14:53 +00:00
|
|
|
p_file files;
|
1985-11-25 15:47:51 +00:00
|
|
|
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;
|
1985-11-25 15:47:51 +00:00
|
|
|
string rec_file, incl_file;
|
1988-06-22 16:23:36 +00:00
|
|
|
int low_percentage = 10, high_percentage = 30;
|
|
|
|
int min_cases_for_jmptable = 8;
|
|
|
|
int jmptable_option;
|
1991-11-26 15:38:41 +00:00
|
|
|
int ansi_c = 0;
|