1984-10-08 14:14:53 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
*
|
|
|
|
* This product is part of the Amsterdam Compiler Kit.
|
|
|
|
*
|
|
|
|
* Permission to use, sell, duplicate or disclose this software must be
|
|
|
|
* obtained in writing. Requests for such permissions may be sent to
|
|
|
|
*
|
|
|
|
* Dr. Andrew S. Tanenbaum
|
|
|
|
* Wiskundig Seminarium
|
|
|
|
* Vrije Universiteit
|
|
|
|
* Postbox 7161
|
|
|
|
* 1007 MC Amsterdam
|
|
|
|
* The Netherlands
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
static string rcsid4 = "$Header$";
|
|
|
|
# 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;
|
|
|
|
p_order porder, sorder;
|
1984-10-08 14:14:53 +00:00
|
|
|
p_start start;
|
|
|
|
int linecount;
|
|
|
|
int assval;
|
|
|
|
FILE *fout;
|
|
|
|
FILE *fpars;
|
|
|
|
FILE *finput;
|
|
|
|
FILE *fact;
|
|
|
|
string f_pars = PARSERFILE;
|
|
|
|
string f_out = OUTFILE;
|
|
|
|
string f_temp = ACTFILE;
|
|
|
|
string f_input;
|
|
|
|
string e_noopen = "Cannot open %s";
|
|
|
|
int verbose;
|
|
|
|
string lexical;
|
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;
|
|
|
|
# endif not NDEBUG
|
|
|
|
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;
|
|
|
|
p_link links;
|
|
|
|
p_term terms;
|