1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Rook
.Compiler
17 using Castle
.MicroKernel
;
19 using Castle
.Rook
.Compiler
.Services
;
20 using Castle
.Rook
.Compiler
.Services
.Default
;
21 using Castle
.Rook
.Compiler
.Services
.Passes
;
22 using Castle
.Rook
.Compiler
.TypeSystem
;
24 public class CompilerContainer
: DefaultKernel
26 public CompilerContainer()
31 public virtual void AddServices()
33 this.AddComponent("options", typeof(ICompilerOptionsSet
), typeof(DefaultCompilerOptionsSet
) );
34 this.AddComponent("type.container", typeof(ITypeContainer
), typeof(DefaultTypeContainer
) );
35 this.AddComponent("name.resolver", typeof(INameResolver
), typeof(DefaultNameResolver
) );
36 this.AddComponent("ident", typeof(IIdentifierNameService
), typeof(IdentifierNameService
) );
37 this.AddComponent("parser", typeof(IParser
), typeof(RookParser
) );
38 this.AddComponent("error", typeof(IErrorReport
), typeof(ErrorReport
) );
42 this.AddComponent("builder.skeleton.pass", typeof(CreateBuilderSkeleton
) );
43 this.AddComponent("emission.pass", typeof(Emission
) );
44 this.AddComponent("scope.pass", typeof(ScopePass
) );
45 this.AddComponent("typeresolution.pass", typeof(TypeResolutionPass
) );
48 public IErrorReport ErrorReportService
50 get { return this[typeof(IErrorReport)] as IErrorReport; }
53 public IParser ParserService
55 get { return this[typeof(IParser)] as IParser; }