global.c 1.6 KB

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