Handling Multiple Language Contexts by Subtractive Context Switching
We propose a solution for analyzing programs with multiple language contexts as they occur, for example, in C# 3.0. C# 3.0 has two contexts: the normal C# context and the language integrated query (Linq) context, which are basically the same, but Linq has some additional keywords that are treated as identifiers in the C# context.
We demonstrate our solution by using the compiler generator Coco/R, which provides no support for enabling or disabling tokens in a grammar, as tokens are a global property of a programming language. We show how to handle additional tokens on top of the infrastructure provided by Coco/R.
Proceedings of the 6th International Symposium on Intelligent Systems and Informatics (SISY 2008), Subotica, Serbia, September 2008.