A simple programming model for creating extensions/add-ins for the Mono C# compiler.

I need to be able to access the abstract representation of a C# program immediately after the parsing stage has succeeded but before
the type checker kicks in. More than just this, I need to be able to modify the types assigned to various program features such as
method parameters etc. This change implements a very simple extensibility model that provides me with the minimum functionality to
perform these types of actions. I expect that this programming model will grow and change considerably over time as I build out my
compiler add-in.

Since the compiler (dmcs.exe) now exposes a public extensibility API that is intended to be consumed by third-party add-ins, the
target assembly must now have a strong name in order that other signed assemblies can reference it. The project has been modified to
reference the standard "mono.pub" key file.

To create an add-in, simply implement the new Mono.CompilerServices.Extensibility.IAddIn interface. This provides entry points for
parsing additional command-line options as well as access to the abstract parse tree results. Your assembly will be picked up by
dmcs.exe from the GAC so make sure that you remember to give your add-in assembly a strong name. dmcs.exe uses its application
configuration file (dmcs.exe.config) to determine which add-ins to load. To configure dmcs.exe to use your add-in, modify the
configuration file to include an "add-ins" key which is a semicolon-separated list of assembly-qualified type names referring to
classes implementing the IAddIn interface. Here is a sample configuration file:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0.30319"/>
  </startup>
  <appSettings>
    <add key="add-ins" value="Mono.DuctileSharp.AddIn, Mono.DuctileSharp, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=1b947822772207a0"/>
  </appSettings>
</configuration>

I'm sure that this loading mechanism will change over time too! Happy hacking!

Detailed code review:

.gitignore
  Added Mercurial common repository files to ignore list.

mcs/class/Mono.CSharp.csproj
mcs/mcs/dmcs.csproj
mcs/mcs/dmcs.exe.sources
mcs/mcs/gmcs.csproj
mcs/mcs/gmcs.exe.sources
mcs/mcs/smcs.exe.sources
  Added new extensibility support classes into various project files and file
  lists.

mcs/mcs/AssemblyInfo.cs
  Added strong name to dmcs.exe etc. by adding AssemblyDelaySign and
  AssemblyKeyFile attributes. This is necessary to allow other signed assemblies
  to reference dmcs.exe etc. which is necessary for third-party add-ins to
  access the new extensibility interfaces.

mcs/mcs/add_in_manager.cs
  New: manages compiler add-ins based on Mono.CompilerServices.Extensibility
  interfaces.

mcs/mcs/class.cs
  Implemented ITypeInfo on Mono.CSharp.Class.

mcs/mcs/driver.cs
  Added calls into AddInManager to load and invoke add-ins at start, during
  command-line argument parsing and immediately after parsing has completed
  but before type resolution is performed.

mcs/mcs/ecore.cs
  Implemented ITypeExpression on Mono.CSharp.FullNamedExpression.

mcs/mcs/extensibility/IAddIn.cs
  New: provides main entry points for a compiler add-in.

mcs/mcs/extensibility/ILocation.cs
  New: supplies source code location information.

mcs/mcs/extensibility/IMethodInfo.cs
  New: enables basic manipulation of methods.

mcs/mcs/extensibility/IParameterInfo.cs
  New: enables basic manipulation of parameters.

mcs/mcs/extensibility/ITypeExpression.cs
  New: enables basic manipulation of type expressions.

mcs/mcs/extensibility/ITypeExpressionFactory.cs
  New: allows add-ins to create type expressions.

mcs/mcs/extensibility/ITypeInfo.cs
  New: enables basic manipulation of types.

mcs/mcs/location.cs
  Implemented ILocation on Mono.CSharp.Location.

mcs/mcs/method.cs
  Implemented IMethodInfo on Mono.CSharp.Method.

mcs/mcs/parameter.cs
  Implemented IParameterInfo on Mono.CSharp.Parameter.
Do not compile with dependencies on System.Configuration.AppSettingsSection in bootstrap profiles

If either BOOTSTRAP_BASIC or BOOTSTRAP_NET_4_0 is defined, do not reference the AppSettings object in AddInManager.LoadAddIns since
the required assembly (System.Configuration.dll) is not available in bootstrap mode. This change also moves initialization of
_addIns into the static declaration.
Added new environment variable MCS_SAFE_MODE to allow the Mono build environment to switch off extensibility features while
bootstrapping itself

Relying on the BOOTSTRAP_BASIC and BOOTSTRAP_NET_4_0 preprocessor defines is insufficient for determining when to load in add-ins
that consume the extensibility features or not. Middle phases of the Mono build, for example, build with only a partially
implemented version of System.dll which omits classes in the System.Configuration namespace. AddInManager relies on these classes to
load in the application configuration file and extract values from it. We thus check the value of the MCS_SAFE_MODE environment
variable ("true" means use safe mode) to determine if we should bypass add-in loading or not.