Compiler-compiler: Difference between revisions

Content deleted Content added
m fixed references
Edited to remove repetitiveness and improve readability/comprehension. Further work (e.g. more details and better explanations) is probably still needed to improve clarity
Line 8:
The most common type of compiler-compiler is more precisely 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 only handles syntactic analysis.
 
The input of a parser generator is aA [[formal grammar|grammar]] file, is supplied as the input for a parser generator. This is typically written in [[Backus–Naur form]] (BNF) or [[extended Backus–Naur form]] (EBNF) thatand defines the [[Syntax (programming languages)|syntax]] of a target programming language.
 
The output is the [[sourceSource code]] offor a parser forof the programming language. Theis outputreturned ofas the (compiled) parser generator's output. This source code iscan then be compiled into a parser., Itwhich may be either standalone or embedded. ThisThe compiled parser takesthen as an inputaccepts the source code of the target programming language sourceas an input and performs somean 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>