Compiler-compiler: Difference between revisions

Content deleted Content added
History: Add: Full name Brooker Morris Compiler Compiler (BMCC)
m Changed a three item list to only have one "or" and use Oxford comma
Line 8:
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) or, [[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).