2. ► [Introduction]Compilateur et méta programmation
► Roslyn
► [Coding]Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
3. ► [Introduction]Compilateur et méta programmation
► Roslyn
► [Coding]Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
6. Compilateur et meta-programmation
Compilateurs
var x = 10;
var y = 20;
if(x == y)
{
}
IL_0001: ldc.i4.s 0A
IL_0003: stloc.0
IL_0004: ldc.i4.s 14
IL_0006: stloc.1
IL_0007: ldloc.0
IL_0008: ldloc.1
IL_0009: ceq
IL_000B: ldc.i4.0
IL_000C: ceq
IL_000E: stloc.2
IL_000F: ldloc.2
IL_0010: brtrue.s IL_0014
IL_0012: nop
7. ► [Introduction]Compilateur et méta programmation
► Roslyn
► [Coding]Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
18. Roslyn
Ressources
Api & templates téléchargeables
pour VS 2012.
Exemple format Word
Packages NuGet
Disponible pour les
autres versions de
Visual Studio.
26. ► [Introduction] Compilateur et méta programmation
► Roslyn
► [Coding] Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
29. [Coding] Syntaxe et Sémantique
Grammaire & langage
Grammaire (Arbre syntaxique)
ArgumentListSyntax paramètre de méthode
ClassDeclarationSyntax déclaration d’une classe
ExpressionStatementSyntax ligne de code
UsingDirectiveSyntax using d’un namespace
...
Sémantique (Symbol)
SemanticModel
GetTypeInfo() résultat de l’expression
(struct) CommonSymbolKind.Event
.Field
.Property
30. [Coding] Syntaxe et Sémantique
Syntax
SyntaxNode: Blue
SyntaxToken: Green
SyntaxTrivia: Red
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World");
}
}
37. ► [Introduction] Compilateur et méta programmation
► Roslyn
► [Coding] Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
38. [Demo] Scripting et Compilation
Script CS
scriptcs makes it easy to write and execute C# with a simple text editor.
C:> scriptcs scriptcs (ctrl-c or blank to exit)
> var message = "Hello, world!"; >
Console.WriteLine(message); Hello, world! >
40. ► [Introduction] Compilateur et méta programmation
► Roslyn
► [Coding] Syntaxe et Sémantique
► [Demo] Scripting et Compilation
► Le projet et son avenir
Agenda
41. Le projet et son avenir
Actuellement
Dogfooding
Build 2014
Balbutiement dans la communauté
42. Le projet et son avenir
Wish-list
Meilleur documentation (à jour!)
Full-Compatible avec VS 2013
Le retour de l’analyseur syntaxique
AOP