/// <summary> /// Initializes a new instance of the <see cref="Linker"/> class. /// </summary> /// <param name="rules">Resolving rule dictionary</param> /// <param name="linkedLibrary">Resolving class</param> public Linker(IDictionary<IResolverType,IEnumerable<IResolver>> rules, ILinkedLibrary linkedLibrary) { if (linkedLibrary == null) { throw new ArgumentNullException(nameof(linkedLibrary)); } if (rules == null) { throw new ArgumentNullException(nameof(rules)); } Rules = rules .Select(pair => new ResolverSyntaxRewriter(pair.Key, pair.Value, linkedLibrary)); }
public IResolvedTerm Resolve(IDeclarationTerm term, IEnumerable<ISyntacticNode> children, ILinkedLibrary linkedLibrary) => linkedLibrary.FindFunction((IFunctionDeclarationTerm)term);
/// <summary> /// Initializes a new instance of the <see cref="ResolverSyntaxRewriter"/> class. /// </summary> /// <param name="resolverType">Declaration term type for resolving</param> /// <param name="resolvers">List of resolvers</param> /// <param name="linkedLibrary">Resolving class</param> public ResolverSyntaxRewriter(IResolverType resolverType, IEnumerable<IResolver> resolvers, ILinkedLibrary linkedLibrary) { ResolverType = resolverType; Resolvers = resolvers; LinkedLibrary = linkedLibrary; }