compiler - microsoft.com · compiler pipeline compiler api binding & flow analysis apis symbol...
TRANSCRIPT
![Page 1: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/1.jpg)
![Page 2: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/2.jpg)
Compiler
Compiler
Source code
Source code
Source
File Source code
Source code
.NET
Assembly
Class
Field
public Foo
private
string
X
Language
Object Model Read-Eval-Print Loop
Hosting in
other contexts DSL Embedding
![Page 3: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/3.jpg)
• Includes:− Managed compilers + language services
− Code analysis APIs
− Language service extensibility
− Read-Eval-Print-Loop (REPL)
![Page 4: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/4.jpg)
Symbol Table
Binder IL
Emitter Parser
Metadata
Import
Compiler
Pipeline
![Page 5: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/5.jpg)
Symbol
Table Binder
IL
Emitter Parser
Metadata
Import
Compiler
Pipeline
Compiler
API
Binding & Flow
Analysis APIs
Symbol
API
Syntax
Tree API
Emit
API
![Page 6: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/6.jpg)
Compiler
Pipeline Binding & Flow
Analysis APIs
Symbol
API
Syntax
Tree API
Emit
API
Language
Service
![Page 7: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/7.jpg)
![Page 8: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/8.jpg)
CompilationUnit
TypeDeclaration
MethodDeclaration
class C { void M() { } }// C ▫
ParameterList Block
![Page 9: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/9.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M
class C { void M() { } }// C ▫
ParameterList Block
( ) { }
![Page 10: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/10.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M ParameterList Block
( )
{ }
SP EOL EOL // C
SPx4 SP
EOL
EOL
EOL SPx4 EOL SPx4
class∙C { ∙∙∙∙void∙M() ∙∙∙∙{ ∙∙∙∙} } // C ▫
![Page 11: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/11.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M
class C { void M() { } }// C ▫
ParameterList Block
( ) { }
![Page 12: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/12.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M ParameterList Block
( ) { }
class C { void M(int x) { } }// C ▫
![Page 13: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/13.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M
class C { void M(int x) { } }// C ▫
ParameterList Block
( ) { } Parameter
int
x PredefinedType
![Page 14: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/14.jpg)
CompilationUnit
TypeDeclaration
class C { MethodDeclaration }
EOF
void M
class C { void M(int x) { } }// C ▫
ParameterList Block
( ) { } Parameter
int
x PredefinedType
![Page 15: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/15.jpg)
Trees
References
Compilation
• Symbols
• Binding
• Flow Analysis
• Diagnostics
• Emit
![Page 16: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/16.jpg)
![Page 17: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/17.jpg)
![Page 18: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/18.jpg)
![Page 19: Compiler - microsoft.com · Compiler Pipeline Compiler API Binding & Flow Analysis APIs Symbol API Syntax Tree API Emit API . Compiler Pipeline Binding & Flow Analysis APIs Symbol](https://reader033.vdocuments.us/reader033/viewer/2022043008/5f98355b23f55226e71a52bf/html5/thumbnails/19.jpg)