void ScanTags(WrenchTarget wt) { foreach (KeyValuePair <string, SingleValue <TargetBuilder> > kvp in wt.Tags) { int tagid = gb.GetTagId(kvp.Key); if (tagid < 0) { throw ExHelp.Argument("tag", "Invalid tag name {0}", kvp.Key); } List <int> list; if (tag_items.ContainsKey(tagid)) { list = tag_items[tagid]; } else { list = new List <int> (); tag_items[tagid] = list; } list.Add(wt.Id); list.Add(CompileSingleValue(kvp.Value)); } }
static void WriteTargetTags(GraphBuilder gb, WrenchTarget wt, XmlTextWriter tw) { foreach (KeyValuePair <string, SingleValue <int> > kvp in wt.IdTags) { int tagid = gb.GetTagId(kvp.Key); if (tagid < 0) { throw ExHelp.Argument("tag", "Invalid tag name {0}", kvp.Key); } if (kvp.Value.IsResult) { tw.WriteStartElement("rt"); tw.WriteAttributeString("id", tagid.ToString()); ((Result)kvp.Value).ExportXml(tw, "r"); } else { tw.WriteStartElement("tt"); tw.WriteAttributeString("id", tagid.ToString()); tw.WriteAttributeString("target", ((int)kvp.Value).ToString()); } tw.WriteEndElement(); } }
protected override TargetBuilder CreateTarget(string name) { WrenchTarget wt = new WrenchTarget(this, name, next_target_id++); targids[name] = wt.Id; return(wt); }
protected override TargetBuilder CreateTarget (string name) { WrenchTarget wt = new WrenchTarget (this, name, next_target_id++); targids[name] = wt.Id; return wt; }
int WriteNameForTarget(BinaryGraphSerializer bsg, int lowid, int offset) { WrenchTarget tb = targids[lowid]; byte[] data = bsg.enc.GetBytes(tb.Name); bsg.bw.Write(data); return(data.Length); }
bool WriteTarget(string elt, int aid, WrenchTarget targ) { tw.WriteStartElement(elt); if (aid >= 0) { tw.WriteAttributeString("arg", aid.ToString()); } tw.WriteAttributeString("id", targ.Id.ToString()); tw.WriteEndElement(); return(false); }
void StartTarget(string name) { if (CheckTargetName(name)) { return; } cur_targ = (WrenchTarget)wp.DefineTarget(name, log); // FIXME: if the fails we log an error but the rest of the code // will nullref almost instantly. Gets the job done, but ugly. cur_arg_name = null; }
int WriteDepsForTarget(BinaryGraphSerializer bsg, int tid, int offset) { WrenchTarget tb = targids[tid]; int nwritten = 0; DepsCollector dc = new DepsCollector(bsg); tb.VisitDependencies(dc); nwritten = dc.Write(); return(nwritten); }
public void WriteProviderData(BinaryGraphSerializer bsg) { bsg.bw.Write(dep_offsets.Length); bsg.bw.Write(pb.Basis); bsg.bw.Write(pb.DeclarationLoc); bsg.bw.Write(dep_chunk_len); BinaryHelper.WriteRaw(bsg.bw, dep_offsets); bsg.bw.Write(name_chunk_len); BinaryHelper.WriteRaw(bsg.bw, name_offsets); for (int i = 0; i < dep_offsets.Length; i++) { WrenchTarget tb = targids[i]; BinaryHelper.WriteRaw(bsg.bw, bsg.RegisterType(tb.RuleType)); bsg.ScanTags(tb); // For later ... } }
void FinishTarget() { cur_targ = null; cur_arg_name = null; }
bool WriteTarget (string elt, int aid, WrenchTarget targ) { tw.WriteStartElement (elt); if (aid >= 0) tw.WriteAttributeString ("arg", aid.ToString ()); tw.WriteAttributeString ("id", targ.Id.ToString ()); tw.WriteEndElement (); return false; }
static void WriteTargetTags (GraphBuilder gb, WrenchTarget wt, XmlTextWriter tw) { foreach (KeyValuePair<string,SingleValue<int>> kvp in wt.IdTags) { int tagid = gb.GetTagId (kvp.Key); if (tagid < 0) throw ExHelp.Argument ("tag", "Invalid tag name {0}", kvp.Key); if (kvp.Value.IsResult) { tw.WriteStartElement ("rt"); tw.WriteAttributeString ("id", tagid.ToString ()); ((Result) kvp.Value).ExportXml (tw, "r"); } else { tw.WriteStartElement ("tt"); tw.WriteAttributeString ("id", tagid.ToString ()); tw.WriteAttributeString ("target", ((int) kvp.Value).ToString ()); } tw.WriteEndElement (); } }
void ScanTags (WrenchTarget wt) { foreach (KeyValuePair<string,SingleValue<TargetBuilder>> kvp in wt.Tags) { int tagid = gb.GetTagId (kvp.Key); if (tagid < 0) throw ExHelp.Argument ("tag", "Invalid tag name {0}", kvp.Key); List<int> list; if (tag_items.ContainsKey (tagid)) list = tag_items[tagid]; else { list = new List<int> (); tag_items[tagid] = list; } list.Add (wt.Id); list.Add (CompileSingleValue (kvp.Value)); } }
void FinishTarget () { cur_targ = null; cur_arg_name = null; }
void StartTarget (string name) { if (CheckTargetName (name)) return; cur_targ = (WrenchTarget) wp.DefineTarget (name, log); // FIXME: if the fails we log an error but the rest of the code // will nullref almost instantly. Gets the job done, but ugly. cur_arg_name = null; }