30. Compiler APIs Demo1 (追記)
• 単純な構文のみを検証するプログラム
30
Dim tree = VisualBasicSyntaxTree.ParseText(code)
Dim errors As New List(Of ErrorItem)
For Each item In tree.GetDiagnostics
errors.Add(New ErrorItem With {.Message = item.GetMessage,
.Location = item.Location.SourceSpan.ToString,
.Id = item.Id,
.Severity = item.Severity.ToString})
Next
33. Compiler APIs Demo2 (追記)
• Semantic Analysisを用いて、意味も検証する
33
Dim tree = VisualBasicSyntaxTree.ParseText(code)
Dim compilation = VisualBasicCompilation.Create("pronama",
{tree},
{New MetadataFileReference(GetType(Object).Assembly.Location)})
Dim errors As New List(Of ErrorItem)
For Each item In compilation.GetDiagnostics
errors.Add(New ErrorItem With {.Message = item.GetMessage,
.Location = item.Location.SourceSpan.ToString,
.Id = item.Id,
.Severity = item.Severity.ToString})
Next
52. Roslynのロードマップ
• Review and refine the design of the REPL
window(scripting API).
• Discuss proposed language features.
• Remove the core compiler's dependency on the
full .NET framework allowing the use of the
Compilation data type on platforms like WinRT.
( http://roslyn.codeplex.com/wikipage?title=Roadmap&referringTitle=Documentation より抜粋)
52