Sie sind auf Seite 1von 12

Various tools available for constructing compilers.

Ranging from scanner and parser generators to complex systems which produce a compiler from some form of formal description of a language and machine.

A tool used to construct compilers.

Creates a parser, interpreter, or compiler from some form of formal description of a language and machine.

Created in 1960 by Tony Brooker.

Used for creating compilers for Atlas computers at the University of Manchester including the Atlas Autocode Compiler.

Earliest and most common form of compilercompiler is a parse generator

Input: Grammar of a programming language.

Output: Source code of a parser often used as a component of a compiler.

Ideal compiler-compiler tool:

Takes a description of a programming language and a target instruction set architecture, and automatically generates a usable compiler from them.

ANTLR Bison Coco/R DMS Software Reengineering Toolkit, a program transformation system with parser generators ELI, an integrated toolset for compiler construction. Lemon parboiled, a Java library for building parsers. Packrat parser PQCC, a compiler-compiler that is more than a parser generator. SYNTAX, an integrated toolset for compiler construction VisualLangLab, a visual parser generator for JVM languages. Yacc

A typical parser generator associates executable code with each of the rules of the grammar that should be executed when these rules are applied by the parser. Depending upon the type of parser, these pieces of code may construct a parse tree or generate an executable code directly. Meta II accepted grammars code generation rules and is able to compile itself and other languages. Some experimental compiler-compilers take as input a formal description of programming language semantics. However, both the generated compiler and the code it produced were inefficient in time and space.

The Production Quality Compiler-Compiler does not formalize semantics, but does have a semiformal framework for machine description.

Compiler-compilers exist in many different forms, including bottom-up rewrite machine generators used to tile syntax trees according to a rewrite grammar for code generation, and attribute grammar parser generators.

Trade off between how much work the tool can do automatically and how flexible the system can be. For e.g., Assuming that lexical analyzers for all languages are except for particular keywords and signs recognized. Many compilers do in fact produce fixed lexical analysis routines for use in generated compiler. These routines differ in keywords recognized and this list is supplied by the user. Approach is valid but unworkable if required to recognize non standard tokens like identifiers that may include characters. Automatic generation of lexical analyzers exist. However, they require more input and the work load is increased.

I. II.

Scanner generators: The built-in approach and the regular expression based techniques. Parser generators: Provided in each compilercompiler tool because Provides a fixed framework in which parsing is done. Context free grammar that reduces the work of the user . Facilities for code generation: A higher-level language is provided in which the user writes the routines and in the resulting compiler the routines are called at correct times by the automatically generated parser.

Das könnte Ihnen auch gefallen