This article needs additional citations for verification. (October 2015) |
In computer science, a compiler-compiler or compiler generator is a programming tool that creates a parser, 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.[1] It handles only syntactic analysis.
A formal description of a language is usually a 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 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 of the AST, or the generation of machine code for the target machine.[2]
A metacompiler is a software development tool used mainly in the construction of compilers, translators, and interpreters for other programming languages.[3] The input to a metacompiler is a computer program written in a specialized programming metalanguage designed mainly for the purpose of constructing compilers.[3][4] The language of the compiler produced is called the object language. The minimal input producing a compiler is a metaprogram specifying the object language grammar and semantic transformations into an object program.[4][5]
{{cite book}}
: CS1 maint: location missing publisher (link) CS1 maint: others (link)
McGraw
was invoked but never defined (see the help page).CWIC
was invoked but never defined (see the help page).TMETA
was invoked but never defined (see the help page).