2 // The ecmaspec provider is for ECMA specifications
5 // John Luke (jluke@cfl.rr.com)
6 // Ben Maurer (bmaurer@users.sourceforge.net)
9 // mono assembler.exe --ecmaspec DIRECTORY --out name
17 using System.Xml.Linq;
18 using System.Collections.Generic;
20 using Lucene.Net.Index;
21 using Lucene.Net.Documents;
26 namespace Monodoc.Providers
28 public class EcmaProvider : Provider
30 HashSet<string> directories = new HashSet<string> ();
32 public EcmaProvider ()
36 public EcmaProvider (string baseDir)
38 AddDirectory (baseDir);
41 public void AddDirectory (string directory)
43 if (string.IsNullOrEmpty (directory))
44 throw new ArgumentNullException ("directory");
46 directories.Add (directory);
49 public override void PopulateTree (Tree tree)
51 var storage = tree.HelpSource.Storage;
52 var nsSummaries = new Dictionary<string, XElement> ();
55 foreach (var asm in directories) {
56 var indexFilePath = Path.Combine (asm, "index.xml");
57 if (!File.Exists (indexFilePath)) {
58 Console.Error.WriteLine ("Warning: couldn't process directory `{0}' as it has no index.xml file", asm);
62 EcmaDoc.PopulateTreeFromIndexFile (indexFilePath, EcmaHelpSource.EcmaPrefix, tree, storage, nsSummaries, _ => resID++.ToString ());
65 foreach (var summary in nsSummaries)
66 storage.Store ("xml.summary." + summary.Key, summary.Value.ToString ());
68 var masterSummary = new XElement ("elements",
70 .SelectMany (d => Directory.EnumerateFiles (d, "ns-*.xml"))
71 .Select (ExtractNamespaceSummary));
72 storage.Store ("mastersummary.xml", masterSummary.ToString ());
75 XElement ExtractNamespaceSummary (string nsFile)
77 using (var reader = XmlReader.Create (nsFile)) {
78 reader.ReadToFollowing ("Namespace");
79 var name = reader.GetAttribute ("Name");
80 reader.ReadToFollowing ("summary");
81 var summary = reader.ReadInnerXml ();
82 reader.ReadToFollowing ("remarks");
83 var remarks = reader.ReadInnerXml ();
85 return new XElement ("namespace",
86 new XAttribute ("ns", name ?? string.Empty),
87 new XElement ("summary", new XCData (summary)),
88 new XElement ("remarks", new XCData (remarks)));
92 public override void CloseTree (HelpSource hs, Tree tree)
95 AddExtensionMethods (hs);
98 void AddEcmaXml (HelpSource hs)
100 var xmls = directories
101 .SelectMany (Directory.EnumerateDirectories) // Assemblies
102 .SelectMany (Directory.EnumerateDirectories) // Namespaces
103 .SelectMany (Directory.EnumerateFiles)
104 .Where (f => f.EndsWith (".xml")); // Type XML files
107 foreach (var xml in xmls)
108 using (var file = File.OpenRead (xml))
109 hs.Storage.Store ((resID++).ToString (), file);
112 void AddImages (HelpSource hs)
114 var imgs = directories
115 .SelectMany (Directory.EnumerateDirectories)
116 .Select (d => Path.Combine (d, "_images"))
117 .Where (Directory.Exists)
118 .SelectMany (Directory.EnumerateFiles);
120 foreach (var img in imgs)
121 using (var file = File.OpenRead (img))
122 hs.Storage.Store (Path.GetFileName (img), file);
125 void AddExtensionMethods (HelpSource hs)
127 var extensionMethods = directories
128 .SelectMany (Directory.EnumerateDirectories)
129 .Select (d => Path.Combine (d, "index.xml"))
132 using (var file = File.OpenRead (f)) {
133 var reader = XmlReader.Create (file);
134 reader.ReadToFollowing ("ExtensionMethods");
135 return reader.ReadInnerXml ();
138 .DefaultIfEmpty (string.Empty);
140 hs.Storage.Store ("ExtensionMethods.xml",
141 "<ExtensionMethods>" + extensionMethods.Aggregate (string.Concat) + "</ExtensionMethods>");
144 IEnumerable<string> GetEcmaXmls ()
147 .SelectMany (Directory.EnumerateDirectories) // Assemblies
148 .SelectMany (Directory.EnumerateDirectories) // Namespaces
149 .SelectMany (Directory.EnumerateFiles)
150 .Where (f => f.EndsWith (".xml")); // Type XML files
154 public class EcmaHelpSource : HelpSource
156 internal const string EcmaPrefix = "ecma:";
157 LRUCache<string, Node> cache = new LRUCache<string, Node> (4);
159 public EcmaHelpSource (string base_file, bool create) : base (base_file, create)
163 protected EcmaHelpSource () : base ()
167 protected override string UriPrefix {
173 public override bool CanHandleUrl (string url)
175 if (url.Length > 2 && url[1] == ':') {
188 return base.CanHandleUrl (url);
191 // Clean the extra paramers in the id
192 public override Stream GetHelpStream (string id)
194 var idParts = id.Split ('?');
195 return base.GetHelpStream (idParts[0]);
198 public override Stream GetCachedHelpStream (string id)
200 var idParts = id.Split ('?');
201 return base.GetCachedHelpStream (idParts[0]);
204 public override DocumentType GetDocumentTypeForId (string id)
206 return DocumentType.EcmaXml;
209 public override string GetPublicUrl (Node node)
211 string url = string.Empty;
212 var type = EcmaDoc.GetNodeType (node);
213 //Console.WriteLine ("GetPublicUrl {0} : {1} [{2}]", node.Element, node.Caption, type.ToString ());
215 case EcmaNodeType.Namespace:
216 return node.Element; // A namespace node has already a well formated internal url
217 case EcmaNodeType.Type:
218 return MakeTypeNodeUrl (node);
219 case EcmaNodeType.Meta:
220 return MakeTypeNodeUrl (GetNodeTypeParent (node)) + GenerateMetaSuffix (node);
221 case EcmaNodeType.Member:
222 var typeChar = EcmaDoc.GetNodeMemberTypeChar (node);
223 var parentNode = GetNodeTypeParent (node);
224 var typeNode = MakeTypeNodeUrl (parentNode).Substring (2);
225 return typeChar + ":" + typeNode + MakeMemberNodeUrl (typeChar, node);
231 string MakeTypeNodeUrl (Node node)
233 // A Type node has a Element property of the form: 'ecma:{number}#{typename}/'
234 var hashIndex = node.Element.IndexOf ('#');
235 var typeName = node.Element.Substring (hashIndex + 1, node.Element.Length - hashIndex - 2);
236 return "T:" + node.Parent.Caption + '.' + typeName.Replace ('.', '+');
239 string MakeMemberNodeUrl (char typeChar, Node node)
241 // We clean inner type ctor name which may contain the outer type name
242 var caption = node.Caption;
244 // Sanitize constructor caption of inner types
245 if (typeChar == 'C') {
247 for (int i = 0; i < caption.Length && caption[i] != '('; i++)
248 lastDot = caption[i] == '.' ? i : lastDot;
249 return lastDot == -1 ? '.' + caption : caption.Substring (lastDot);
252 /* We handle type conversion operator by checking if the name contains " to "
253 * (as in 'foo to bar') and we generate a corresponding conversion signature
255 if (typeChar == 'O' && caption.IndexOf (" to ") != -1) {
256 var parts = caption.Split (' ');
257 return "." + node.Parent.Caption + "(" + parts[0] + ", " + parts[2] + ")";
260 /* The goal here is to treat method which are explicit interface definition
261 * such as 'void IDisposable.Dispose ()' for which the caption is a dot
262 * expression thus colliding with the ecma parser.
263 * If the first non-alpha character in the caption is a dot then we have an
264 * explicit member implementation (we assume the interface has namespace)
266 var firstNonAlpha = caption.FirstOrDefault (c => !char.IsLetterOrDigit (c));
267 if (firstNonAlpha == '.')
268 return "$" + caption;
270 return "." + caption;
273 Node GetNodeTypeParent (Node node)
275 // Type nodes are always at level 2 so we just need to get there
276 while (node != null && node.Parent != null && !node.Parent.Parent.Element.StartsWith ("root:/", StringComparison.OrdinalIgnoreCase))
281 string GenerateMetaSuffix (Node node)
283 string suffix = string.Empty;
284 // A meta node has always a type element to begin with
285 while (EcmaDoc.GetNodeType (node) != EcmaNodeType.Type) {
286 suffix = '/' + node.Element + suffix;
292 public override string GetInternalIdForUrl (string url, out Node node, out Dictionary<string, string> context)
294 var id = string.Empty;
298 if (!url.StartsWith (UriPrefix, StringComparison.OrdinalIgnoreCase)) {
299 node = MatchNode (url);
302 id = node.GetInternalUrl ();
306 id = GetInternalIdForInternalUrl (id, out hash);
307 context = EcmaDoc.GetContextForEcmaNode (hash, SourceID.ToString (), node);
312 public string GetInternalIdForInternalUrl (string internalUrl, out string hash)
314 var id = internalUrl;
315 if (id.StartsWith (UriPrefix, StringComparison.OrdinalIgnoreCase))
316 id = id.Substring (UriPrefix.Length);
317 else if (id.StartsWith ("N:", StringComparison.OrdinalIgnoreCase))
318 id = "xml.summary." + id.Substring ("N:".Length);
320 var hashIndex = id.IndexOf ('#');
322 if (hashIndex != -1) {
323 hash = id.Substring (hashIndex + 1);
324 id = id.Substring (0, hashIndex);
330 public override Node MatchNode (string url)
333 if ((node = cache.Get (url)) == null) {
334 node = EcmaDoc.MatchNodeWithEcmaUrl (url, Tree);
336 cache.Put (url, node);
341 public override void PopulateIndex (IndexMaker index_maker)
343 foreach (Node ns_node in Tree.RootNode.Nodes){
344 foreach (Node type_node in ns_node.Nodes){
345 string typename = type_node.Caption.Substring (0, type_node.Caption.IndexOf (' '));
346 string full = ns_node.Caption + "." + typename;
348 string doc_tag = GetKindFromCaption (type_node.Caption);
349 string url = type_node.PublicUrl;
352 // Add MonoMac/MonoTouch [Export] attributes, those live only in classes
354 XDocument type_doc = null;
355 ILookup<string, XElement> prematchedMembers = null;
356 bool hasExports = doc_tag == "Class" && (ns_node.Caption.StartsWith ("MonoTouch") || ns_node.Caption.StartsWith ("MonoMac"));
360 var id = GetInternalIdForInternalUrl (type_node.GetInternalUrl (), out hash);
361 type_doc = XDocument.Load (GetHelpStream (id));
362 prematchedMembers = type_doc.Root.Element ("Members").Elements ("Member").ToLookup (n => (string)n.Attribute ("MemberName"), n => n);
363 } catch (Exception e) {
364 Console.WriteLine ("Problem processing {0} for MonoTouch/MonoMac exports\n\n{0}", e);
369 if (doc_tag == "Class" || doc_tag == "Structure" || doc_tag == "Interface"){
370 index_maker.Add (type_node.Caption, typename, url);
371 index_maker.Add (full + " " + doc_tag, full, url);
373 foreach (Node c in type_node.Nodes){
376 index_maker.Add (" constructors", typename+"0", url + "/C");
379 index_maker.Add (" fields", typename+"1", url + "/F");
382 index_maker.Add (" events", typename+"2", url + "/E");
385 index_maker.Add (" properties", typename+"3", url + "/P");
388 index_maker.Add (" methods", typename+"4", url + "/M");
391 index_maker.Add (" operators", typename+"5", url + "/O");
397 // Now repeat, but use a different sort key, to make sure we come after
398 // the summary data above, start the counter at 6
400 string keybase = typename + "6.";
402 foreach (Node c in type_node.Nodes){
403 var type = c.Caption[0];
405 foreach (Node nc in c.Nodes) {
406 string res = nc.Caption;
407 string nurl = nc.PublicUrl;
410 if (hasExports && (type == 'C' || type == 'M' || type == 'P')) {
412 var member = GetMemberFromCaption (type_doc, type == 'C' ? ".ctor" : res, false, prematchedMembers);
413 var exports = member.Descendants ("AttributeName").Where (a => a.Value.Contains ("Foundation.Export"));
414 foreach (var exportNode in exports) {
415 var parts = exportNode.Value.Split ('"');
416 if (parts.Length != 3) {
417 Console.WriteLine ("Export attribute not found or not usable in {0}", exportNode);
419 var export = parts[1];
420 index_maker.Add (export + " selector", export, nurl);
423 } catch (Exception e) {
424 Console.WriteLine ("Problem processing {0}/{1} for MonoTouch/MonoMac exports\n\n{2}", nurl, res, e);
432 index_maker.Add (String.Format ("{0}.{1} field", typename, res),
433 keybase + res, nurl);
434 index_maker.Add (String.Format ("{0} field", res), res, nurl);
437 index_maker.Add (String.Format ("{0}.{1} event", typename, res),
438 keybase + res, nurl);
439 index_maker.Add (String.Format ("{0} event", res), res, nurl);
442 index_maker.Add (String.Format ("{0}.{1} property", typename, res),
443 keybase + res, nurl);
444 index_maker.Add (String.Format ("{0} property", res), res, nurl);
447 index_maker.Add (String.Format ("{0}.{1} method", typename, res),
448 keybase + res, nurl);
449 index_maker.Add (String.Format ("{0} method", res), res, nurl);
452 index_maker.Add (String.Format ("{0}.{1} operator", typename, res),
453 keybase + res, nurl);
458 } else if (doc_tag == "Enumeration"){
460 // Enumerations: add the enumeration values
462 index_maker.Add (type_node.Caption, typename, url);
463 index_maker.Add (full + " " + doc_tag, full, url);
465 // Now, pull the values.
467 var id = GetInternalIdForInternalUrl (type_node.GetInternalUrl (), out hash);
468 var xdoc = XDocument.Load (GetHelpStream (id));
472 var members = xdoc.Root.Element ("Members").Elements ("Members");
476 foreach (var member_node in members){
477 string enum_value = member_node.Attribute ("MemberName").Value;
478 string caption = enum_value + " value";
479 index_maker.Add (caption, caption, url);
481 } else if (doc_tag == "Delegate"){
482 index_maker.Add (type_node.Caption, typename, url);
483 index_maker.Add (full + " " + doc_tag, full, url);
490 public override void PopulateSearchableIndex (IndexWriter writer)
492 StringBuilder text = new StringBuilder ();
493 SearchableDocument searchDoc = new SearchableDocument ();
495 foreach (Node ns_node in Tree.RootNode.Nodes) {
496 foreach (Node type_node in ns_node.Nodes) {
497 string typename = type_node.Caption.Substring (0, type_node.Caption.IndexOf (' '));
498 string full = ns_node.Caption + "." + typename;
499 string url = type_node.PublicUrl;
500 string doc_tag = GetKindFromCaption (type_node.Caption);
502 var id = GetInternalIdForInternalUrl (type_node.GetInternalUrl (), out hash);
503 var xdoc = XDocument.Load (GetHelpStream (id));
506 if (string.IsNullOrEmpty (doc_tag))
509 // For classes, structures or interfaces add a doc for the overview and
510 // add a doc for every constructor, method, event, ...
511 // doc_tag == "Class" || doc_tag == "Structure" || doc_tag == "Interface"
512 if (doc_tag[0] == 'C' || doc_tag[0] == 'S' || doc_tag[0] == 'I') {
513 // Adds a doc for every overview of every type
514 SearchableDocument doc = searchDoc.Reset ();
515 doc.Title = type_node.Caption;
516 doc.HotText = typename;
518 doc.FullTitle = full;
520 var node_sel = xdoc.Root.Element ("Docs");
522 GetTextFromNode (node_sel, text);
523 doc.Text = text.ToString ();
526 GetExamples (node_sel, text);
527 doc.Examples = text.ToString ();
529 writer.AddDocument (doc.LuceneDoc);
530 var exportParsable = doc_tag[0] == 'C' && (ns_node.Caption.StartsWith ("MonoTouch") || ns_node.Caption.StartsWith ("MonoMac"));
532 //Add docs for contructors, methods, etc.
533 foreach (Node c in type_node.Nodes) { // c = Constructors || Fields || Events || Properties || Methods || Operators
534 if (c.Element == "*")
536 const float innerTypeBoost = 0.2f;
538 IEnumerable<Node> ncnodes = c.Nodes;
539 // The rationale is that we need to properly handle method overloads
540 // so for those method node which have children, flatten them
541 if (c.Caption == "Methods") {
543 .Where (n => n.Nodes == null || n.Nodes.Count == 0)
544 .Concat (ncnodes.Where (n => n.Nodes.Count > 0).SelectMany (n => n.Nodes));
545 } else if (c.Caption == "Operators") {
547 .Where (n => !n.Caption.EndsWith ("Conversion"))
548 .Concat (ncnodes.Where (n => n.Caption.EndsWith ("Conversion")).SelectMany (n => n.Nodes));
551 var prematchedMembers = xdoc.Root.Element ("Members").Elements ("Member").ToLookup (n => (string)n.Attribute ("MemberName"), n => n);
553 foreach (Node nc in ncnodes) {
554 XElement docsNode = null;
556 docsNode = GetDocsFromCaption (xdoc, c.Caption[0] == 'C' ? ".ctor" : nc.Caption, c.Caption[0] == 'O', prematchedMembers);
558 if (docsNode == null) {
559 Console.Error.WriteLine ("Problem: {0}", nc.PublicUrl);
563 SearchableDocument doc_nod = searchDoc.Reset ();
564 doc_nod.Title = LargeName (nc) + " " + EcmaDoc.EtcKindToCaption (c.Caption[0]);
565 doc_nod.FullTitle = ns_node.Caption + '.' + typename + "::" + nc.Caption;
566 doc_nod.HotText = string.Empty;
568 /* Disable constructors hottext indexing as it's often "polluting" search queries
569 because it has the same hottext than standard types */
570 if (c.Caption != "Constructors") {
571 //dont add the parameters to the hottext
572 int ppos = nc.Caption.IndexOf ('(');
573 doc_nod.HotText = ppos != -1 ? nc.Caption.Substring (0, ppos) : nc.Caption;
576 var urlnc = nc.PublicUrl;
580 GetTextFromNode (docsNode, text);
581 doc_nod.Text = text.ToString ();
584 GetExamples (docsNode, text);
585 doc_nod.Examples = text.ToString ();
587 Document lucene_doc = doc_nod.LuceneDoc;
588 lucene_doc.Boost = innerTypeBoost;
589 writer.AddDocument (lucene_doc);
591 // Objective-C binding specific parsing of [Export] attributes
592 if (exportParsable) {
594 var exports = docsNode.Parent.Elements ("Attributes").Elements ("Attribute").Elements ("AttributeName")
595 .Select (a => (string)a).Where (txt => txt.Contains ("Foundation.Export"));
597 foreach (var exportNode in exports) {
598 var parts = exportNode.Split ('"');
599 if (parts.Length != 3) {
600 Console.WriteLine ("Export attribute not found or not usable in {0}", exportNode);
604 var export = parts[1];
605 var export_node = searchDoc.Reset ();
606 export_node.Title = export + " Export";
607 export_node.FullTitle = ns_node.Caption + '.' + typename + "::" + export;
608 export_node.Url = urlnc;
609 export_node.HotText = export;
610 export_node.Text = string.Empty;
611 export_node.Examples = string.Empty;
612 lucene_doc = export_node.LuceneDoc;
613 lucene_doc.Boost = innerTypeBoost;
614 writer.AddDocument (lucene_doc);
616 } catch (Exception e){
617 Console.WriteLine ("Problem processing {0} for MonoTouch/MonoMac exports\n\n{0}", e);
622 // doc_tag == "Enumeration"
623 } else if (doc_tag[0] == 'E'){
624 var members = xdoc.Root.Element ("Members").Elements ("Member");
629 foreach (var member_node in members) {
630 string enum_value = (string)member_node.Attribute ("MemberName");
631 text.Append (enum_value);
633 GetTextFromNode (member_node.Element ("Docs"), text);
637 SearchableDocument doc = searchDoc.Reset ();
640 GetExamples (xdoc.Root.Element ("Docs"), text);
641 doc.Examples = text.ToString ();
643 doc.Title = type_node.Caption;
644 doc.HotText = (string)xdoc.Root.Attribute ("Name");
645 doc.FullTitle = full;
647 doc.Text = text.ToString();
648 writer.AddDocument (doc.LuceneDoc);
649 // doc_tag == "Delegate"
650 } else if (doc_tag[0] == 'D'){
651 SearchableDocument doc = searchDoc.Reset ();
652 doc.Title = type_node.Caption;
653 doc.HotText = (string)xdoc.Root.Attribute ("Name");
654 doc.FullTitle = full;
657 var node_sel = xdoc.Root.Element ("Docs");
660 GetTextFromNode (node_sel, text);
661 doc.Text = text.ToString();
664 GetExamples (node_sel, text);
665 doc.Examples = text.ToString();
667 writer.AddDocument (doc.LuceneDoc);
673 string GetKindFromCaption (string s)
675 int p = s.LastIndexOf (' ');
677 return s.Substring (p + 1);
681 // Extract the interesting text from the docs node
682 void GetTextFromNode (XElement n, StringBuilder sb)
684 // Include the text content of the docs
685 sb.AppendLine (n.Value);
686 foreach (var tag in n.Descendants ())
687 //include the url to which points the see tag and the name of the parameter
688 if ((tag.Name.LocalName.Equals ("see", StringComparison.Ordinal) || tag.Name.LocalName.Equals ("paramref", StringComparison.Ordinal))
689 && tag.HasAttributes)
690 sb.AppendLine ((string)tag.Attributes ().First ());
693 // Extract the code nodes from the docs
694 void GetExamples (XElement n, StringBuilder sb)
696 foreach (var code in n.Descendants ("code"))
697 sb.Append ((string)code);
700 // Extract a large name for the Node
701 static string LargeName (Node matched_node)
703 string[] parts = matched_node.GetInternalUrl ().Split('/', '#');
704 if (parts.Length == 3 && parts[2] != String.Empty) //List of Members, properties, events, ...
705 return parts[1] + ": " + matched_node.Caption;
706 else if(parts.Length >= 4) //Showing a concrete Member, property, ...
707 return parts[1] + "." + matched_node.Caption;
709 return matched_node.Caption;
712 XElement GetMemberFromCaption (XDocument xdoc, string caption, bool isOperator, ILookup<string, XElement> prematchedMembers)
716 var doc = xdoc.Root.Element ("Members").Elements ("Member");
719 // The first case are explicit and implicit conversion operators which are grouped specifically
720 if (caption.IndexOf (" to ") != -1) {
721 var convArgs = caption.Split (new[] { " to " }, StringSplitOptions.None);
723 .First (n => (AttrEq (n, "MemberName", "op_Explicit") || AttrEq (n, "MemberName", "op_Implicit"))
724 && ((string)n.Element ("ReturnValue").Element ("ReturnType")).Equals (convArgs[1], StringComparison.Ordinal)
725 && AttrEq (n.Element ("Parameters").Element ("Parameter"), "Type", convArgs[0]));
727 return doc.First (m => AttrEq (m, "MemberName", "op_" + caption));
731 TryParseCaption (caption, out name, out args);
733 if (!string.IsNullOrEmpty (name)) { // Filter member by name
734 var prematched = prematchedMembers[name];
735 doc = prematched.Any () ? prematched : doc.Where (m => AttrEq (m, "MemberName", name));
737 if (args != null && args.Count > 0) // Filter member by its argument list
738 doc = doc.Where (m => m.Element ("Parameters").Elements ("Parameter").Attributes ("Type").Select (a => (string)a).SequenceEqual (args));
743 XElement GetDocsFromCaption (XDocument xdoc, string caption, bool isOperator, ILookup<string, XElement> prematchedMembers)
745 return GetMemberFromCaption (xdoc, caption, isOperator, prematchedMembers).Element ("Docs");
748 // A simple stack-based parser to detect single type definition separated by commas
749 IEnumerable<string> ExtractArguments (string rawArgList)
751 var sb = new System.Text.StringBuilder ();
752 int genericDepth = 0;
755 for (int i = 0; i < rawArgList.Length; i++) {
756 char c = rawArgList[i];
759 if (genericDepth == 0 && arrayDepth == 0) {
760 yield return sb.ToString ();
781 yield return sb.ToString ();
784 void TryParseCaption (string caption, out string name, out IList<string> argList)
788 int parenIdx = caption.IndexOf ('(');
789 // In case of simple name, there is no need for processing
790 if (parenIdx == -1) {
794 name = caption.Substring (0, parenIdx);
795 // Now we gather the argument list if there is any
796 var rawArgList = caption.Substring (parenIdx + 1, caption.Length - parenIdx - 2); // Only take what's inside the parens
797 if (string.IsNullOrEmpty (rawArgList))
800 argList = ExtractArguments (rawArgList).Select (arg => arg.Trim ()).ToList ();
803 bool AttrEq (XElement element, string attributeName, string expectedValue)
805 return ((string)element.Attribute (attributeName)).Equals (expectedValue, StringComparison.Ordinal);