Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Compiler-compiler
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Program that generates parsers or compilers}} {{Distinguish|self-hosting compiler|source-to-source compiler}} {{more citations needed|date=October 2015}} {{Use dmy dates|date=January 2020|cs1-dates=y}} In [[computer science]], a '''compiler-compiler''' or '''compiler generator''' is a programming tool that creates a [[Parsing#Computer_languages|parser]], [[interpreter (computer software)|interpreter]], or [[compiler]] from some form of formal description of a [[programming language]] and machine. The most common type of compiler-compiler is called a '''parser generator'''.<ref>{{cite book |url=https://www.worldcat.org/oclc/70775643 |title=Compilers : principles, techniques, & tools |date=2007 |others=Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman, Alfred V. Aho |isbn=978-0-321-48681-3 |edition=Second |location=Boston |page=287 |oclc=70775643}}</ref> It handles only [[syntactic analysis]]. A formal description of a language is usually a [[formal grammar|grammar]] used as an input to a parser generator. It often resembles [[Backus–Naur form]] (BNF), [[extended Backus–Naur form]] (EBNF), or has its own syntax. Grammar files describe a [[Syntax (programming languages)|syntax]] of a generated compiler's target programming language and actions that should be taken against its specific constructs. [[Source code]] for a parser of the programming language is returned as the parser generator's output. This source code can then be compiled into a parser, which may be either standalone or embedded. The compiled parser then accepts the source code of the target programming language as an input and performs an action or outputs an [[abstract syntax tree]] (AST). Parser generators do not handle the [[Semantics (computer science)|semantics]] of the AST, or the [[Code generation (compiler)|generation of machine code]] for the target machine.<ref name="name">"A Syntax Directed Compiler for ALGOL 60" Edgar T. Irons, Communications of the ACM Volume 4 Issue 1, Jan. 1961.</ref> A '''metacompiler''' is a software development tool used mainly in the construction of [[compiler]]s, [[Translator (computing)|translators]], and [[interpreter (computing)|interpreters]] for other programming languages.<ref name="McGraw"/> The input to a metacompiler is a [[computer program]] written in a [[Domain-specific language|specialized]] programming [[metalanguage]] designed mainly for the purpose of constructing compilers.<ref name="McGraw"/><ref name="CWIC" /> The language of the compiler produced is called the object language. The minimal input producing a compiler is a [[Metaprogramming|metaprogram]] specifying the object language grammar and [[Semantics (computer science)|semantic]] transformations into an [[object program]].<ref name="CWIC" /><ref name="TMETA" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)