LLgen.1 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. .\" $Header$
  2. .TH LLGEN 1 "$Revision$"
  3. .ad
  4. .SH NAME
  5. LLgen, an extended LL(1) parser generator
  6. .SH SYNOPSIS
  7. LLgen [ \-vxw ] [ \-j[\fInum\fP] ] [ \-l\fInum\fP ] [ \-h\fInum\fP ] file ...
  8. .SH DESCRIPTION
  9. \fILLgen\fP
  10. converts a context-free grammar into a set of
  11. functions which form a recursive descent parser with no backtrack.
  12. The grammar may be ambiguous;
  13. ambiguities can be broken by user specifications.
  14. .PP
  15. \fILLgen\fP
  16. reads each
  17. \fIfile\fP
  18. in sequence.
  19. Together, these files must constitute a context-free grammar.
  20. For each file,
  21. \fILLgen\fP
  22. generates an output file, which must be compiled by the
  23. C-compiler.
  24. In addition, it generates the files
  25. \fILpars.c\fP
  26. and
  27. \fILpars.h.\fP
  28. \fILpars.h\fP
  29. contains the
  30. \fIdefine\fP
  31. statements that associate the
  32. \fILLgen\fP-assigned `token-codes' with user declared `token-names'.
  33. This allows other source files, for instance the source file
  34. containing the lexical analyzer,
  35. to access the token-codes by
  36. using the token-names.
  37. \fILpars.c\fP
  38. contains the error recovery routines and tables. It must also
  39. be compiled by the C-compiler.
  40. .PP
  41. \fILLgen\fP
  42. will only update those output files that differ from their previous
  43. version.
  44. This allows
  45. \fILLgen\fP
  46. to be used with
  47. \fImake\fP
  48. (I) convieniently.
  49. .PP
  50. To obtain a working program, the user must also supply a
  51. lexical analyzer, as well as
  52. \fImain\fP
  53. and
  54. \fILLmessage\fP,
  55. an error reporting routine;
  56. \fILex\fP
  57. (I) is a useful program for creating lexical analysers usable
  58. by
  59. \fILLgen\fP.
  60. .PP
  61. \fILLgen\fP accepts the following flags:
  62. .IP \fB\-v\fP
  63. create a file called
  64. \fILL.output\fP,
  65. which contains a description of the conflicts that
  66. were not resolved.
  67. If the flag is given more than once,
  68. \fILLgen\fP
  69. will be more "verbose".
  70. If it is given three times, a complete description of the
  71. grammar will be supplied.
  72. .IP \fB\-x\fP
  73. the sets that are computed are extended with the nonterminal
  74. symbols and these extended sets are also included in the
  75. \fILL.output\fP
  76. file.
  77. .IP \fB\-w\fP
  78. no warnings are given.
  79. .IP \fB\-j\fP[\fInum\fP]
  80. when this flag is given, \fILLgen\fP will generate dense switches,
  81. so that the compiler can generate a jump table for it. This will only be
  82. done for switches that have density between
  83. \fIlow_percentage\fP and \fIhigh_percentage\fP, as explained below.
  84. Usually, compilers generate a jumptable when the density of the switch
  85. is above a certain threshold. If you want jump tables in more cases,
  86. set \fIhigh_percentage\fP to this threshold, and \fIlow_percentage\fP to
  87. a minimum threshold. There is a time-space trade-off here.
  88. .I num
  89. is the minimum number of cases in a switch for the \fB\-j\fP option to be
  90. effective. The default value (if
  91. .I num
  92. is not given) is 8.
  93. .IP \fB\-l\fP\fInum\fP
  94. The \fIlow_percentage\fP, as described above. Default value is 10.
  95. .IP \fB\-h\fP\fInum\fP
  96. The \fIhigh_percentage\fP, as described above. Default value is 30.
  97. .SH FILES
  98. LL.output verbose output file
  99. .br
  100. Lpars.c the error recovery routines
  101. .br
  102. Lpars.h defines for token names
  103. .SH "SEE ALSO"
  104. \fIlex\fP (I)
  105. .br
  106. \fImake\fP (I)
  107. .br
  108. \fILLgen, an Extended LL(1) Parser Generator\fP
  109. by C.J.H. Jacobs.
  110. .SH DIAGNOSTICS
  111. Are intended to be self-explanatory. They are reported
  112. on standard error. A more detailed report is found in the
  113. \fILL.output\fP
  114. file.
  115. .SH AUTHOR
  116. Ceriel J. H. Jacobs