project roslyn
play

Project Roslyn Exposing the C# and Visual Basic compilers code - PowerPoint PPT Presentation

Project Roslyn Exposing the C# and Visual Basic compilers code analysis Dustin Campbell Senior Program Manager Microsoft Project Codename Roslyn Scope Managed compilers & language services Code analysis APIs


  1. Project Roslyn Exposing the C# and Visual Basic compilers’ code analysis Dustin Campbell Senior Program Manager Microsoft

  2. Project Codename “Roslyn” • Scope • Managed compilers & language services • Code analysis APIs • Scripting APIs • Language service extensibility • Read-Eval-Print-Loop (REPL) • Ship Date • v.Next + n, where n > 0

  3. IL Emitter Emit API Edit and Continue Go To Definition Binding and Flow Analysis Extract Method Signature Help Binder APIs Quick Info Rename Find All References Completion List Symbol API Metadata Symbols Import Object Browser Navigate To Syntax Tree API Outlining Parser Colorizer Formatter Compiler API Compiler Language Pipeline Service

  4. Design Choices Immutable Complete Resilient Efficient

  5. Demo: Compiler APIs

  6. Major Players class C { Syntax Nodes void M() { } GetRoot CompilationUnit SyntaxTree }// C ▫ TypeDeclaration MethodDeclaration ParameterList Block

  7. Major Players class C { Syntax Tokens void M() { } GetRoot CompilationUnit SyntaxTree }// C ▫ TypeDeclaration EOF class C { MethodDeclaration } void M ParameterList Block ( ) { }

  8. Major Players class ∙ C  {  ∙∙∙∙ void ∙ M()  Syntax Tokens ∙∙∙∙ {  ∙∙∙∙ }  class C }// C  ▫ { M ( ) void { } } EOF

  9. Major Players class ∙ C  {  ∙∙∙∙ void ∙ M()  Syntax “Trivia” ∙∙∙∙ {  ∙∙∙∙ }  class SP C EOL }// C  ▫ EOL { EOL SPx4 SP M ( ) void SPx4 { EOL SPx4 } EOL } EOL // C EOF

  10. Major Players Compilations, References and Symbols SyntaxTrees Compilation • Symbols • Diagnostics • Emit References

  11. Major Players Semantics GetSemanticModel(tree) SemanticModel • Binding Information • Conversion Classification Compilation • Flow Analysis • Overload Resolution • Etc.

  12. Major Players Workspace, Solutions, Projects and Documents Events (e.g. key presses) Apply Edit Edit Compilation SyntaxTree

  13. Demo: Building a Quick Fix

  14. Next Steps • Install the Roslyn CTP • Try out the APIs • Give us feedback! Dev Center: http://msdn.com/roslyn Forum: http://social.msdn.microsoft.com/forums/en-us/roslyn Email: dustinca@microsoft.com

Recommend


More recommend