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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
1994-06-24 11:31:16 +00:00
|
|
|
* $Id$
|
1984-10-08 14:14:53 +00:00
|
|
|
* Miscellanious constants and
|
|
|
|
* some variables that are visible in more than one file
|
|
|
|
*/
|
|
|
|
|
1991-11-23 10:41:43 +00:00
|
|
|
# define LTEXTSZ 256 /* Size of longest token */
|
1985-11-25 15:47:51 +00:00
|
|
|
|
1984-10-08 14:14:53 +00:00
|
|
|
/*
|
|
|
|
* options for the identifier search routine
|
|
|
|
*/
|
1985-11-25 15:47:51 +00:00
|
|
|
|
1984-10-08 14:14:53 +00:00
|
|
|
# define ENTERING 1
|
|
|
|
# define BOTH 2
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now for some declarations
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern char ltext[]; /* input buffer */
|
|
|
|
extern int nnonterms; /* number of nonterminals */
|
1985-11-25 15:47:51 +00:00
|
|
|
extern int ntokens; /* number of terminals */
|
1987-05-12 18:23:09 +00:00
|
|
|
extern int nterms; /* number of terms */
|
|
|
|
extern int nalts; /* number of alternatives */
|
1984-10-08 14:14:53 +00:00
|
|
|
extern p_start start; /* will contain startsymbols */
|
|
|
|
extern int linecount; /* line number */
|
|
|
|
extern int assval; /* to create difference between literals
|
|
|
|
* and other terminals
|
|
|
|
*/
|
1985-11-25 15:47:51 +00:00
|
|
|
extern p_nont nonterms; /* the nonterminal array */
|
1984-10-08 14:14:53 +00:00
|
|
|
extern p_nont maxnt; /* is filled up until here */
|
1985-11-25 15:47:51 +00:00
|
|
|
extern p_token tokens; /* the token array */
|
|
|
|
extern p_token maxt; /* is filled up until here */
|
1991-11-01 10:37:26 +00:00
|
|
|
extern int norder, torder;
|
1985-11-25 15:47:51 +00:00
|
|
|
/* order of nonterminals in the grammar,
|
1984-10-08 14:14:53 +00:00
|
|
|
* important because actions are copied to
|
|
|
|
* a temporary file in the order in which they
|
|
|
|
* were read
|
|
|
|
*/
|
|
|
|
extern string e_noopen; /* Error message string used often */
|
|
|
|
extern int verbose; /* Level of verbosity */
|
1987-11-27 11:04:07 +00:00
|
|
|
extern int wflag; /* warnings? */
|
1984-10-08 14:14:53 +00:00
|
|
|
extern string lexical; /* name of lexical analyser */
|
1990-01-29 13:45:42 +00:00
|
|
|
extern string prefix; /* prefix of externals */
|
1987-02-16 21:38:52 +00:00
|
|
|
extern string onerror; /* name of user error handler */
|
1984-10-08 14:14:53 +00:00
|
|
|
extern int ntneeded; /* ntneeded = 1 if nonterminals are included
|
|
|
|
* in the sets.
|
|
|
|
*/
|
|
|
|
extern int ntprint; /* ntprint = 1 if they must be printed too in
|
|
|
|
* the LL.output file (-x option)
|
|
|
|
*/
|
|
|
|
# ifndef NDEBUG
|
|
|
|
extern int debug;
|
1991-12-02 09:15:04 +00:00
|
|
|
# endif /* not NDEBUG */
|
1984-10-08 14:14:53 +00:00
|
|
|
extern p_file files,pfile; /* pointers to file structure.
|
|
|
|
* "files" points to the start of the
|
|
|
|
* list */
|
1985-11-25 15:47:51 +00:00
|
|
|
extern p_file maxfiles;
|
1984-10-08 14:14:53 +00:00
|
|
|
extern string LLgenid; /* LLgen identification string */
|
|
|
|
extern t_token lextoken; /* the current token */
|
|
|
|
extern int nerrors;
|
1985-11-25 15:47:51 +00:00
|
|
|
extern string rec_file, incl_file;
|
1988-06-22 16:23:36 +00:00
|
|
|
extern int low_percentage, high_percentage;
|
|
|
|
extern int min_cases_for_jmptable;
|
|
|
|
extern int jmptable_option;
|
1991-11-26 15:38:41 +00:00
|
|
|
extern int ansi_c;
|
1995-02-24 12:10:44 +00:00
|
|
|
extern int strip_grammar;
|