Вы находитесь на странице: 1из 1

Briefly explain compiler construction tools

Compiler construction tools: The compiler writer like any programmer, can profitably use software tools such as debuggers, version managers, profilers and so on. In addition to these software development tools, other more specialized tools have been developed for helping implement various phases of a compiler. Some of the useful compiler-construction tools are, 1. Parser generators 4. Automatic code generators 2. Scanner generators 5. Data-flow engines. 3. Syntax-directed translation engines Returned value 1. Parser generators: These produce syntax analyzers [parse tree], normally from input that is based on a context-free grammar. In early compilers, syntax analysis consumed not only a large fraction of the running time of a compiler, but a large fraction of the intellectual effort of writing a compiler. Example: PIC, EQM 1. Scanner generators; These automatically generate lexical analyzers [the stream of tokens], normally from a specification based on regular expressions. The basic organization of the resulting lexical analyzer is in effect, a finite automation. 2. Syntax-directed translation engines: These produce intermediate code with three-address format, normally from input that is based on the parse tree. The basic ideal is that one or more translation are associated with each node of the parse tree, and each translation is defined in terms of translations at its neighbor nodes in the tree. 3. Automatic code generators: It lakes a collection of rules that define the translation of each operation of the intermediate language into the machine language for the target machine. The basic technique used is template matching. The intermediate code statements are replaced by templates that represent sequences of machine instructions, in such a way that the assumptions about storage of variables match from template to template. The input specification for these systems may contain: 1. A description of the lexical and syntactic structure of the source language. 2. A description of what output is to be generated for each source language construct. 1. A description of the target machine. 2. Data-flow engines: Much of the information needed to perform good code optimization involves data-flow analysis, the gathering of information about how values are transmitted from one part of a program to each other part. After the first compilers were written, systems to help with the compiler-writing process appeared. These systems have often been referred as, . 1. Compiler-compilers 3. Translator-writing systems 2. Compiler-generators

Вам также может понравиться