-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathServiceCollectionExtensions.cs
More file actions
37 lines (28 loc) · 1.75 KB
/
ServiceCollectionExtensions.cs
File metadata and controls
37 lines (28 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using HydraScript.Application.StaticAnalysis.Impl;
using HydraScript.Application.StaticAnalysis.Visitors;
using HydraScript.Domain.FrontEnd.Parser;
using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations;
using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded;
using Microsoft.Extensions.DependencyInjection;
namespace HydraScript.Application.StaticAnalysis;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddStaticAnalysis(this IServiceCollection services)
{
services.AddSingleton<IFunctionWithUndefinedReturnStorage, FunctionWithUndefinedReturnStorage>();
services.AddSingleton<IMethodStorage, MethodStorage>();
services.AddSingleton<ISymbolTableStorage, SymbolTableStorage>();
services.AddSingleton<IComputedTypesStorage, ComputedTypesStorage>();
services.AddSingleton<ITypeDeclarationsResolver, TypeDeclarationsResolver>();
services.AddSingleton<IStandardLibraryProvider, StandardLibraryProvider>();
services.AddSingleton<IHydraScriptTypesService, HydraScriptTypesService>();
services.AddSingleton<IAmbiguousInvocationStorage, AmbiguousInvocationStorage>();
services.AddSingleton<IVisitor<TypeValue, Type>, TypeBuilder>();
services.AddSingleton<IVisitor<FunctionDeclaration, ReturnAnalyzerResult>, ReturnAnalyzer>();
services.AddSingleton<IVisitor<IAbstractSyntaxTreeNode>, SymbolTableInitializer>();
services.AddSingleton<IVisitor<IAbstractSyntaxTreeNode>, TypeSystemLoader>();
services.AddSingleton<IVisitor<IAbstractSyntaxTreeNode>, DeclarationVisitor>();
services.AddSingleton<IVisitor<IAbstractSyntaxTreeNode, Type>, SemanticChecker>();
return services;
}
}