introduction to code generation

PPTX 8 pages 205.1 KB Free download

Page preview (5 pages)

Scroll down 👇
1 / 8
introduction to code generation introduction to code generation what is code generation? the first part of a compiler analyzes the source code into a structure that carries the meaning of the program; this structure is generally the abstract syntax tree that’s been checked and decorated. (remember decorated means all identifier references have been resolved.) from this structure we can generate the corresponding code in some other language, the target language. this is what a code generator does. what is code generation? some compilers generate twice: they first generate code in some “intermediate language” like sil, llvm ir, hir, mir, cil, etc. then they do the “real” code generation into a target language that is directly runnable (or really close to it), like virtual machine code, assembly language, or machine language. goals of code generation here are the three goals of any good code generator: correctness it should produce correct code …
2 / 8
ta from the database, or is it better to have some program automatically create these for you? disadvantages the big disadvantage is that it forces you into writing the code that is compatible with the generated code. most of the time this isn't a problem, but it can be a real hassle when someone comes up to you and says "hey, can we do x?" and that conflicts with the generated code. if the generator is good, it will allow you to change functionality, but that almost always increases the complexity of the code generated etc. this complexity has a price. it's more difficult to understand, and it can be less efficient that code you write yourself. this of course varies by situation. image1.png image2.png image3.png source code front end (analyzer) checked/decorated ast with references resolved (a.k.a. semantic graph) target code source code front semantic end graph > int. repr. …
3 / 8
introduction to code generation - Page 3
4 / 8
introduction to code generation - Page 4
5 / 8
introduction to code generation - Page 5

Want to read more?

Download all 8 pages for free via Telegram.

Download full file

About "introduction to code generation"

introduction to code generation introduction to code generation what is code generation? the first part of a compiler analyzes the source code into a structure that carries the meaning of the program; this structure is generally the abstract syntax tree that’s been checked and decorated. (remember decorated means all identifier references have been resolved.) from this structure we can generate the corresponding code in some other language, the target language. this is what a code generator does. what is code generation? some compilers generate twice: they first generate code in some “intermediate language” like sil, llvm ir, hir, mir, cil, etc. then they do the “real” code generation into a target language that is directly runnable (or really close to …

This file contains 8 pages in PPTX format (205.1 KB). To download "introduction to code generation", click the Telegram button on the left.

Tags: introduction to code generation PPTX 8 pages Free download Telegram