This paper summarizes the novel features of our AOP extensions to C# language [3]. It also reports the experience gained while restructuring and enhancing a shared source compiler. Here we describe a general global view of this project, named CAMEO. The initial aim of CAMEO is to implement AspectJ like language support enabling aspect-oriented modularization in C#. Other goals include support for structural aspects that harness Common Language Runtime (CLR) features [1], incremental or partial aspect weaving, and configurable advice weaving. A preliminary source-to-source translator implementation is available for internal use. We intend to evolve this framework for exploring new ideas in AOP and metaprogramming.

Determining a collection of joinpoints in the base source involves performing a detailed control flow analysis of the code. Conducting flow analysis directly on the source text is an expensive operation in most practical cases. Since traditional compilers routinely parse source text and build Abstract Syntax Graphs (ASGs), it makes sense to make use of available infrastructure from implemented translators. In the CAMEO project, we counted on Microsoft’s Shared Source Common Language Infrastructure (SSCLI) implementation to meet these requirements.

SSCLI [2] is an implementation of Microsoft’s CLR architecture. Apart from the implementation of a Virtual Execution Engine and host of other tools, it includes C++ implementation of a C# language translator. The latter is a complete implementation of the ECMA standard [3] and its source code is available for modifications only for academic and research purposes. The SSCLI provided compiler generates Microsoft’s Intermediate Language (MSIL) code. Because the compiler is a tiny part of the larger framework, it is inextricably tied to the infrastructure. SSCLI itself is spread around some 9000 files and the compiler source occupies nearly 200 files. We decided, very early in the project, to separate compiler code per se from rest of the SSCLI. That way, building the compiler did not require ‘make’ing the entire SSCLI and it also eliminated dependencies on other tools.

Download pdf AOP Support for C#