home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / yacc.1 < prev   
Encoding:
Text File  |  1975-06-26  |  1.8 KB  |  86 lines

  1. .th YACC I 11/25/74
  2. .sh NAME
  3. yacc \*- yet another compiler-compiler
  4. .sh SYNOPSIS
  5. .bd yacc
  6. [
  7. .bd \*-vor
  8. ]
  9. [ grammar ]
  10. .sh DESCRIPTION
  11. .it Yacc
  12. converts a context-free grammar into a set of
  13. tables for a simple automaton which executes an LR(1) parsing
  14. algorithm.
  15. The grammar may be ambiguous;
  16. specified precedence rules are used to break ambiguities.
  17. .s3
  18. The output is
  19. .it y.tab.c,
  20. which must be compiled by the C compiler
  21. and loaded with any other routines
  22. required (perhaps a lexical analyzer) and the Yacc library:
  23. .s3
  24.     cc y.tab.c other.o \*-ly
  25. .s3
  26. If the
  27. .bd \*-v
  28. flag is given, the file
  29. .it y.output
  30. is prepared, which contains a description of the parsing tables
  31. and a report on
  32. conflicts generated by ambiguities in the grammar.
  33. .s3
  34. The
  35. .bd \*-o
  36. flag calls an optimizer for the tables;
  37. the optimized tables, with parser included, appear on file
  38. .it y.tab.c
  39. .s3
  40. The
  41. .bd \*-r
  42. flag causes Yacc to accept grammars with Ratfor actions,
  43. and produce Ratfor output on
  44. .it y.tab.r;
  45. .bd \*-r
  46. implies the
  47. .bd \*-o
  48. flag.
  49. Typical usage is then
  50. .s3
  51.     rc y.tab.r other.o
  52. .s3
  53. .sh "SEE ALSO"
  54. ``LR Parsing'', by A. V. Aho and S. C. Johnson,
  55. Computing Surveys, June, 1974.
  56. ``The YACC Compiler-compiler'', internal memorandum.
  57. .sh AUTHOR
  58. S. C. Johnson
  59. .sh FILES
  60. y.output
  61. .br
  62. y.tab.c
  63. .br
  64. y.tab.r            when ratfor output is obtained
  65. .br
  66. yacc.tmp        when optimizer is called
  67. .br
  68. /lib/liby.a        runtime library for compiler
  69. .br
  70. /usr/yacc/fpar.r    ratfor parser
  71. .br
  72. /usr/yacc/opar.c    parser for optimized tables
  73. .br
  74. /usr/yacc/yopti        optimizer postpass
  75. .sh DIAGNOSTICS
  76. The number of reduce-reduce and shift-reduce conflicts
  77. is reported on the standard output;
  78. a more detailed report is
  79. found in the
  80. .it y.output
  81. file.
  82. .sh BUGS
  83. Because file names are fixed, at most one Yacc
  84. process can be active in a given directory at
  85. a time.
  86.