Sammendrag
This master thesis explores the use of the full-scale production compiler platform Roslyn, and its aptitude for extending the C# language with the Package Template mechanism. Roslyn is a platform combining the compilers and language services of the C# and Visual Basic programming languages. The platform exposes the structures produced by each step of the compiler pipeline through various application programming interfaces (API), such as the syntax trees or symbol tables of a compilation. Utilizing these APIs, programmers can develop tools and environments for programming in C# or Visual Basic. However, offering these APIs, makes the Roslyn compiler significantly more complex than a straightforward compiler would be. The Package Template mechanism revolves around the reuse of collections of classes, called templates, that are instantiated at compile-time. The instantiation of a template allows the programmer to tailor the collection of classes to suit specific purposes. This is done through adding members to, renaming, and merging classes, among other things. This thesis details the implementation of the Package Template mechanism in C# through Roslyn, and will also look at how the various aspects of the mechanism fit with the C\# language as it is defined today.