home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / doc / yacc / rpss next >
Encoding:
Text File  |  1975-06-26  |  2.0 KB  |  48 lines

  1. .RP
  2. .TL
  3. YACC \- Yet Another Compiler-Compiler
  4. .AU
  5. Stephen C. Johnson
  6. .AI
  7. .MH
  8. .AB
  9. Computer program input generally has some structure;
  10. in fact, every computer program which does input can be thought of as defining
  11. an ``input language'' which it accepts.
  12. The input languages may be as complex as a programming language, or as simple as
  13. a sequence of numbers.
  14. Unfortunately, standard input facilities
  15. are restricted, difficult to use and change,
  16. and do not completely check their inputs for validity.
  17. .PP
  18. Yacc provides a general tool for controlling
  19. the input to a computer program.
  20. The Yacc user describes the structures
  21. of his input, together with code which is to be invoked when
  22. each such structure is recognized.
  23. Yacc turns such a specification into a subroutine which may
  24. be invoked to handle the input process;
  25. frequently, it is convenient and appropriate to have most
  26. of the flow of control in the user\'s application
  27. handled by this subroutine.
  28. .PP
  29. The input subroutine produced by Yacc calls a user supplied routine to
  30. return the next basic input item.
  31. Thus, the user can specify his input in terms of individual input characters, or, if he wishes,
  32. in terms of higher level constructs such as names and numbers.
  33. The user supplied routine may also handle idiomatic features such as
  34. comment and continuation conventions, which typically defy easy specification.
  35. .PP
  36. Yacc is written in C[7], and runs under UNIX.
  37. The subroutine which is output may be in C or in Ratfor[4], at the user\'s choice;
  38. Ratfor permits translation of the output subroutine into portable Fortran[5].
  39. The class of specifications accepted is a very general one, called LALR(1)
  40. grammars with disambiguating rules.
  41. The theory behind Yacc has been described elsewhere[1,2,3].
  42. .PP
  43. Yacc was originally designed to help produce the ``front end'' of
  44. compilers; in addition to this use, it has been successfully used in many application
  45. programs, including a phototypesetter language, a document retrieval system,
  46. a Fortran debugging system, and the Ratfor compiler.
  47. .AE
  48.