global.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. * global.c
  14. * Contains declarations visible in several other source files
  15. */
  16. # include "types.h"
  17. # include "extern.h"
  18. # include "io.h"
  19. char ltext[LTEXTSZ];
  20. p_nont nonterms;
  21. p_nont maxnt;
  22. int nnonterms;
  23. p_token tokens;
  24. p_token maxt;
  25. int ntokens;
  26. int nterms, nalts;
  27. int norder, torder;
  28. #ifdef NON_CORRECTING
  29. int nsubstarts;
  30. p_set start_firsts;
  31. #endif
  32. p_start start;
  33. int linecount;
  34. int assval;
  35. FILE *fout;
  36. FILE *fpars;
  37. FILE *finput;
  38. FILE *fact;
  39. char f_pars[] = PARSERFILE;
  40. char f_temp[] = ACTFILE;
  41. #ifdef NON_CORRECTING
  42. char f_nc[20];
  43. #endif
  44. char f_out[20];
  45. string f_input;
  46. char f_include[20];
  47. char f_rec[20];
  48. string e_noopen = "Cannot open %s";
  49. int verbose;
  50. int wflag;
  51. string lexical;
  52. string prefix;
  53. string onerror;
  54. int ntneeded;
  55. int ntprint;
  56. # ifndef NDEBUG
  57. int debug;
  58. #endif /* not NDEBUG */
  59. p_file files;
  60. p_file maxfiles;
  61. p_file pfile;
  62. string LLgenid = "/* LLgen generated code from source %s */\n";
  63. t_token lextoken;
  64. int nerrors;
  65. string rec_file, incl_file;
  66. #ifdef NON_CORRECTING
  67. string nc_rec_file, nc_incl_file;
  68. #endif
  69. int low_percentage = 10, high_percentage = 30;
  70. int min_cases_for_jmptable = 8;
  71. int jmptable_option;
  72. int ansi_c = 0;
  73. #ifdef NON_CORRECTING
  74. int non_corr = 0;
  75. int subpars_sim = 0;
  76. p_gram illegal_gram;
  77. #endif
  78. int strip_grammar = 0;
  79. int in_production; /* set when the parser is reading a production
  80. rule.
  81. */