Compiler construction
Compiler construction , German translation construction , is a discipline of computer science that deals with the design and programming of compilers that convert a source text into a target code . The source code is a program mostly written in a high-level programming language, which is converted into a target code in a mostly less expressive language, primarily machine language .
Software tools (for example parser generators ) are available for compiler construction , which generate parts of a compiler such as lexical scanners or parsers from specifications (often incorrectly referred to as compiler-compiler or compiler generation ). This includes:
- Lex - a scanner generator ; Open source alternative: Flex
- Yacc - Y et A nother C ompiler C ompiler, a parser ; Open source alternative: GNU Bison
- GOLD Parsing System - parser generator for C, C ++, .NET, Java, D, Delphi, Visual Basic, Python.
- JavaCC - Java C ompiler C ompiler, a CC implemented in Java with many possibilities, the u. a. Scanner and parser generator combined.
- Coco / R - scanner and parser generator for C #, Java, C ++, Oberon, Delphi, Ada, Ruby, Unicon. Is available under an extended GPL .
- ANTLR - AN other T ool for L anguage R ecognition - Parser generator for C, C #, C ++, Objective C, Java, Python, Ruby, LISP, Perl, PHP, Oberon, Ada 95
- AtoCC - Visual scanner and parser generator for academic purposes (C #, Java, Delphi and Scheme).
Real compiler generation, i.e. the automatic generation of a complete compiler from a formal specification, is still a research area, e.g. B. at the University of the Federal Armed Forces the projects JACCIE and SIC.
literature
- Niklaus Wirth : Basics and techniques of compiler construction. Oldenbourg Wissenschaftsverlag, Munich 1997, ISBN 3-486-24374-8 (The author develops a complete compiler for a simple language).
- Reinhard Wilhelm , Dieter Maurer: translator construction. Theory, construction, generation. 2, revised and expanded edition. Springer, Berlin a. a. 1997, ISBN 3-540-61692-6 .
- Reinhard Wilhelm , Helmut Seidl: translator construction. Virtual machines. Springer, Berlin a. a. 2007, ISBN 978-3-540-49596-3 .
- Ravi Sethi, Monica S. Lam, Alfred V. Aho , Jeffrey Ullman : Compiler. Principles, techniques and tools. 2nd updated edition. Pearson studies, Munich a. a. 2008, ISBN 978-3-8273-7097-6 .
Web links
- Nikolaus Wirth: Compiler Construction . , ISBN 0-201-40353-6 . The above linked book Compilerbau with examples in Oberon (English)
- Jack Crenshaw: Let's Build a Compiler . Pragmatic introduction to the topic of compiler construction
- Andreas Kunert: LR (k) analysis for pragmatists . Pragmatic introduction to LR (k) analysis