Yacc

from Wikipedia, the free encyclopedia

Yacc is a computer program used to create compilers . The word Yacc is an acronym , which ironically for y et a nother c ompiler c ompiler stands.

Yacc is used for syntactic analysis . It implements a parser generator , which consists syntax definitions of programming languages , by LALR (1) grammars (special LR (k) grammars ) in a BNF -like notation are given, automates a parser based on a pushdown automaton can produce.

Yacc generated from the language definition program code, typically in C is provided. There are also other Yacc variants that generate code for other languages, such as Ayacc for the Ada language .

In order to create a compiler or interpreter , a parser generated by Yacc needs an additional program module for the lexical analysis of the source code. The Lex program, which was also developed for UNIX, is often used for this purpose .

Yacc was originally developed by Stephen C. Johnson at AT&T as part of the UNIX project. Other variants of the program emerged later, such as Berkeley Yacc (short byacc ) in modern BSD operating systems, GNU Bison as part of the GNU project , MKS Yacc and Abraxas Yacc . These are based on the same basic concept as Yacc, but offer improvements in detail. Yacc's source code is also released today under a free license. Yacc is part of OpenSolaris and Plan 9 , among others .

literature

  • Herold, Helmut: lex & yacc. The professional tools for lexical and syntactic text analysis . Addison-Wesley, 2003, ISBN 3-82732-096-8
  • John R. Levine, Tony Mason, Doug Brown: lex & yacc . O'Reilly 1992, ISBN 1-56592-000-7
  • SC Johnson, Yacc: Yet Another Compiler Compiler . Computing Science Technical Report No. 32, 1975, Bell Laboratories, Murray Hill, New Jersey 07974
  • Simson L. Garfinkel & Michael K. Mahoney, NeXtstep (Tm) Programming: Step One: Object-Oriented Applications , Springer, 1993, ISBN 978-0387978840

Web links