extern.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * L L G E N
  7. *
  8. * An Extended LL(1) Parser Generator
  9. *
  10. * Author : Ceriel J.H. Jacobs
  11. */
  12. /*
  13. * $Id$
  14. * Miscellanious constants and
  15. * some variables that are visible in more than one file
  16. */
  17. # define LTEXTSZ 256 /* Size of longest token */
  18. /*
  19. * options for the identifier search routine
  20. */
  21. # define ENTERING 1
  22. # define BOTH 2
  23. /*
  24. * Now for some declarations
  25. */
  26. extern char ltext[]; /* input buffer */
  27. extern int nnonterms; /* number of nonterminals */
  28. extern int ntokens; /* number of terminals */
  29. extern int nterms; /* number of terms */
  30. extern int nalts; /* number of alternatives */
  31. extern p_start start; /* will contain startsymbols */
  32. #ifdef NON_CORRECTING
  33. extern int nsubstarts; /* number of subparserstarts */
  34. extern p_set start_firsts; /* Will contain the union of first sets of
  35. startsymbols when -n -s option is on */
  36. #endif
  37. extern int linecount; /* line number */
  38. extern int assval; /* to create difference between literals
  39. * and other terminals
  40. */
  41. extern p_nont nonterms; /* the nonterminal array */
  42. extern p_nont maxnt; /* is filled up until here */
  43. extern p_token tokens; /* the token array */
  44. extern p_token maxt; /* is filled up until here */
  45. extern int norder, torder;
  46. /* order of nonterminals in the grammar,
  47. * important because actions are copied to
  48. * a temporary file in the order in which they
  49. * were read
  50. */
  51. extern string e_noopen; /* Error message string used often */
  52. extern int verbose; /* Level of verbosity */
  53. extern int wflag; /* warnings? */
  54. extern string lexical; /* name of lexical analyser */
  55. extern string prefix; /* prefix of externals */
  56. extern string onerror; /* name of user error handler */
  57. extern int ntneeded; /* ntneeded = 1 if nonterminals are included
  58. * in the sets.
  59. */
  60. extern int ntprint; /* ntprint = 1 if they must be printed too in
  61. * the LL.output file (-x option)
  62. */
  63. # ifndef NDEBUG
  64. extern int debug;
  65. # endif /* not NDEBUG */
  66. extern p_file files,pfile; /* pointers to file structure.
  67. * "files" points to the start of the
  68. * list */
  69. extern p_file maxfiles;
  70. extern string LLgenid; /* LLgen identification string */
  71. extern t_token lextoken; /* the current token */
  72. extern int nerrors;
  73. extern string rec_file, incl_file;
  74. #ifdef NON_CORRECTING
  75. extern string nc_rec_file, nc_incl_file;
  76. #endif
  77. extern int low_percentage, high_percentage;
  78. extern int min_cases_for_jmptable;
  79. extern int jmptable_option;
  80. extern int ansi_c;
  81. #ifdef NON_CORRECTING
  82. extern int non_corr;
  83. extern int subpars_sim;
  84. extern p_gram illegal_gram;
  85. #endif
  86. extern int strip_grammar;
  87. extern int in_production;