// Returns null and logs an error if the provider at the given // basis has already been defined. public ProviderBuilder DefineProvider(string basis, string decl_loc, IWarningLogger log) { if (providers.ContainsKey(basis)) { log.Error(2043, "Trying to redefine the provider at " + basis, null); return(null); } ProviderBuilder pb = CreateProvider(basis); pb.Claim(decl_loc); providers[basis] = pb; return(pb); }
// Defines the target within a provider, but NOT // the provider itself. public TargetBuilder DefineTarget(string fullname, IWarningLogger log) { string basis, basename; basename = ParseFullName(fullname, out basis); ProviderBuilder pb = providers[basis]; if (pb == null) { return(null); } return(pb.DefineTarget(basename, log)); }
// Throws an exception if the target or its provider is // not yet defined; this function should only be called // if the target is known to exist. public TargetBuilder GetTarget(string fullname) { string basis, basename; basename = ParseFullName(fullname, out basis); ProviderBuilder pb = providers[basis]; if (pb == null) { throw ExHelp.Argument("fullname", "The target `{0}' should exist by " + "now but does not", fullname); } return(pb.GetTarget(basename)); }
protected TargetBuilder(ProviderBuilder pb) { this.pb = pb; }
public BuildfileLoader (string buildfile, ProviderBuilder pb, IWarningLogger log) { parser = BuildfileParser.CreateForFile (buildfile, pb, log); // Console.WriteLine ("Parsing `{0}\' ... ", buildfile); errors = parser.Parse (); }