Reference. Yacc: Yet another compiler-compiler

Computer program input generally has some structure; in fact, every computer program that does input can be thought of as defining an “input language” which it accepts. An input language may be as complex as a programming language, or as simple as a sequence of numbers. Unfortunately, usual input facilities are limited, difficult to use, and often are lax about checking their inputs for validity. Yacc provides a general tool for describing the input to a computer program. The Yacc user specifies the structures of his input, together with code to be invoked as each such structure is recognized. Yacc turns such a specification into a subroutine that handles the input process; frequently, it is convenient and appropriate to have most of the flow of control in the user’s application handled by this subroutine. The input subroutine produced by Yacc calls a user-supplied routine to return the next basic input item. Thus, the user can specify his input in terms of individual input characters, or in terms of higher level constructs such as names and numbers. The user-supplied routine may also handle idiomatic features such as comment and continuation conventions, which typically defy easy grammatical specification. Yacc is written in portable C. The class of specifications accepted is a very general one: LALR(1) grammars with disambiguating rules. In addition to compilers for C, APL, Pascal, RATFOR, etc., Yacc has also been used for less conventional languages, including a phototypesetter language, several desk calculator languages, a document retrieval system, and a Fortran debugging system.

Cite

Cite as @Johnsonyacc (helia, typst) · \cite{Johnsonyacc} (LaTeX)
BibTeX
bibtex · 8 lines
@techreport{Johnsonyacc,
 title = {Yacc: Yet Another Compiler-Compiler},
 author = {Stephen C. Johnson},
 year = {1975},
 pages = {PS1:15-1 - PS1:15-32},
 institution = {AT\&T Bell Laboratories},
 address = {Murray Hill, New Jersey 07974}
}
hayagriva YAML (typst)
yaml · 11 lines
Johnsonyacc:
  type: report
  title: 'Yacc: Yet Another Compiler-Compiler'
  author: Johnson, Stephen C.
  date: 1975
  publisher:
    name: null
    location: Murray Hill, New Jersey 07974
  organization: AT&T Bell Laboratories
  page-range: PS1:15-1 - PS1:15-32
  genre: technical report
Cited by (1)

Reasonably programmable literal notation omar-2018-reasonably

General-purpose programming languages typically define literal notation for only a small number of common data structures, like lists. This is unsatisfying because there are many other data structures for which literal notation might be useful, e.g. finite maps, regular expressions, HTML elements, SQL queries, syntax trees for various languages and chemical structures. There may also be different implementations of each of these data structures behind a common interface that could all benefit from common literal notation. This paper introduces typed literal macros (TLMs) , which allow library providers to define new literal notation of nearly arbitrary design at any specified type or parameterized family of types. Compared to existing approaches, TLMs are uniquely reasonable . TLM clients can reason abstractly, i.e. without examining grammars or generated expansions, about types and binding. The system only needs to convey to clients, via secondary notation, the inferred segmentation of each literal body, which gives the locations and types of spliced subterms. TLM providers can reason modularly about syntactic ambiguity and expansion correctness according to clear criteria. This paper incorporates TLMs into Reason, an emerging alternative front-end for OCaml, and demonstrates, through several non-trivial case studies, how TLMs integrate with the advanced features of OCaml, including pattern matching and the module system. We also discuss optional integration with MetaOCaml, which allows TLM providers to be more confident about type correctness. Finally, we establish these abstract reasoning principles formally with a detailed type-theoretic account of expression and pattern TLMs for “core ML”.
PDF · DOI · pldb
Johnsonyacc reference entries/refs/Johnsonyacc/Johnsonyacc.hel