SUPPORT THE WORK

GetWiki

yacc

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
yacc
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a Look Ahead Left-to-Right (LALR) parser generator, generating a parser, the part of a compiler that tries to make syntactic sense of the source code, specifically a LALR parser, based on an analytic grammar written in a notation similar to Backus–Naur Form (BNF).WEB, The A-Z of Programming Languages: YACC, Computerworld,weblink 30 November 2012, Yacc is supplied as a standard utility on BSD and AT&T Unix.BOOK, Levine, John, Lex & yacc, O'Reilly & Associates, Sebastopol, CA, 1992, 1-56592-000-7, xx, GNU-based Linux distributions include Bison, a forward-compatible Yacc replacement.BOOK, Levine, John, Flex & bison, O'Reilly Media, Sebastopol, Calif, 2009, 978-0-596-15597-1, xv,

History

In the early 1970s, Stephen C. Johnson, a computer scientist at Bell Labs / AT&T, developed Yacc because he wanted to insert an exclusive or operator into a B language compiler. He was directed to Bell Labs colleague Donald Knuth's work on LR parsing, which served as the basis for Yacc.NEWS, Morris, Richard, Stephen Curtis Johnson: Geek of the Week,weblink 19 January 2018, Red Gate Software, 1 October 2009, In a 2008 interview, Johnson reflected that "the contribution Yacc made to the spread of Unix and C is what I'm proudest of".NEWS, Hamilton, Naomi, Yacc, Unix, and Advice from Bell Labs Alumni Stephen Johnson,weblink 19 January 2018, Computerworld, 10 July 2008, Yacc was originally written in the B programming language, but was soon rewritten in C.CONFERENCE, Ritchie, Dennis M., Dennis Ritchie, April 1993, The Development of the C Language, Association for Computing Machinery, Inc.,weblink It appeared as part of Version 3 Unix,TECHREPORT, M. D., McIlroy, Doug McIlroy, 1987,weblink A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986, CSTR, 139, Bell Labs, and a full description of Yacc was published in 1975.JOURNAL, Johnson, Stephen C., Stephen C. Johnson, 1975, Yacc: Yet Another Compiler-Compiler, AT&T Bell Laboratories Technical Reports, 32, AT&T Bell Laboratories Murray Hill, New Jersey 07974,weblink 31 October 2014,

Description

The input to Yacc is a grammar with snippets of C code (called "actions") attached to its rules. Its output is a shift-reduce parser in C that executes the C snippets associated with each rule as soon as the rule is recognized. Typical actions involve the construction of parse trees. Using an example from Johnson, if the call {{mono|node(label, left, right)}} constructs a binary parse tree node with the specified {{mono|label}} and children, then the ruleexpr : expr '+' expr { $$ = node('+', $1, $3); }recognizes summation expressions and constructs nodes for them. The special identifiers {{mono|$$}}, {{mono|$1}} and {{mono|$3}} refer to items on the parser's stack.{{r|Yacc: Yet Another Compiler-Compiler}}Yacc produces only a parser (phrase analyzer); for full syntactic analysis this requires an external lexical analyzer to perform the first tokenization stage (word analysis), which is then followed by the parsing stage proper. Lexical analyzer generators, such as Lex or Flex are widely available. The IEEE POSIX P1003.2 standard defines the functionality and requirements for both Lex and Yacc.{{man|cu|lex}}, {{man|cu|yacc}}.Some versions of AT&T Yacc have become open source. For example, source code is available with the standard distributions of Plan 9.WEB, plan9: UC Berkeley release of Plan 9 under the GPLv2,weblink 2 January 2018, 26 December 2017,

Impact

Yacc and similar programs (largely reimplementations) have been very popular. Yacc itself used to be available as the default parser generator on most Unix systems, though it has since been supplanted by more recent, largely compatible, programs such as Berkeley Yacc, GNU bison, MKS Yacc, and Abraxas PCYACC. An updated version of the original AT&T version is included as part of Sun's OpenSolaris project. Each offers slight improvements and additional features over the original Yacc, but the concept and syntax have remained the same.{{citation needed|date=November 2015}}Yacc has also been rewritten for other languages, including OCaml,WEB, OCaml User's Manual: Chapter 12 Lexer and parser generators (ocamllex, ocamlyacc),weblink 25 Nov 2013, Ratfor, ML, Ada, Pascal, Java, Python, Ruby, Go,WEB, Yacc.go: A version of Yacc for the Go Programming Language,weblink 15 July 2017, , Common LispWEB, CL-Yacc: A Common Lisp version of Yacc,weblink and Erlang.WEB, yecc: An Erlang implementation of Yacc,weblink
  • Berkeley Yacc: The Berkeley implementation of Yacc quickly became more popular than AT&T Yacc itself because of its performance and lack of reuse restrictions.
  • LALR parser: The underlying parsing algorithm in Yacc-generated parsers.
  • Bison: The GNU version of Yacc.
  • Lex (and Flex lexical analyser), a token parser commonly used in conjunction with Yacc (and Bison).
  • BNF, is a metasyntax used to express context-free grammars: that is, a formal way to describe context-free languages.
  • PLY (Python Lex-Yacc) is an alternative implementation of Lex and Yacc in python.

References

{{reflist|30em}}

External links

{{Unix commands}}

- content above as imported from Wikipedia
- "yacc" does not exist on GetWiki (yet)
- time: 6:12pm EDT - Sun, Jul 22 2018
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
GETWIKI 18 AUG 2014
Wikinfo
Culture
CONNECT