Esempio n. 1
0
 public override void visit(documentation_comment_section node)
 {
     if (node.text != null)
     {
         text = node.text;
     }
 }
 void connect(syntax_tree_node node)
 {
     if (node == null || node.source_context == null || documentation.ContainsKey(node))
     {
         return;
     }
     if (line_to_section.ContainsKey(node.source_context.begin_position.line_num))
     {
         documentation_comment_section dsc = line_to_section[node.source_context.begin_position.line_num];
         if (dsc.tags.Count == 0)
         {
             if (dsc.text != null)
             {
                 documentation.Add(node, dsc.text);
                 return;
             }
         }
         foreach (documentation_comment_tag dt in dsc.tags)
         {
             if (dt.name.ToLower() == "summary")
             {
                 documentation.Add(node, dt.text);
             }
         }
     }
 }
Esempio n. 3
0
        documentation_comment_section parse_section(string text)
        {
            documentation_comment_section dcs = new documentation_comment_section();

            if (text.StartsWith("////"))
            {
                return(dcs);
            }
            text = Regex.Replace(text, @"\r\n(\s)*///", "\r\n", RegexOptions.Compiled);
            text = Regex.Replace(text, @"(\s)*///", "", RegexOptions.Compiled);

            /*foreach (string section_name in sectionNames)
             * {
             *  string pattern = "<" + section_name + @"(\w+='\w+')*>" + "(.|\r\n)*" + "</" + section_name + ">";
             *  MatchCollection mc = Regex.Matches(text, pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
             *  foreach (Match m in mc)
             *  {
             *      documentation_comment_tag dt = new documentation_comment_tag();
             *      dt.name = section_name;
             *      string res = m.Value;
             *      int i = res.IndexOf('>');
             *      dt.text = res.Substring(i + 1, res.IndexOf("</" + section_name) - i - 1);
             *      dcs.tags.Add(dt);
             *  }
             * }*/
            dcs.text = text;
            return(dcs);
        }
Esempio n. 4
0
 public virtual void visit(documentation_comment_section _documentation_comment_section)
 {
     DefaultVisit(_documentation_comment_section);
 }
Esempio n. 5
0
		public override void visit(documentation_comment_section _documentation_comment_section)
		{
			DefaultVisit(_documentation_comment_section);
			pre_do_visit(_documentation_comment_section);
			for (int i = 0; i < tags.Count; i++)
				visit(documentation_comment_section.tags[i]);
			post_do_visit(_documentation_comment_section);
		}
Esempio n. 6
0
		public virtual void post_do_visit(documentation_comment_section _documentation_comment_section)
		{
		}
Esempio n. 7
0
 public virtual void visit(documentation_comment_section _documentation_comment_section)
 {
 }
Esempio n. 8
0
        public syntax_tree_node BuildTree(string FileName, string Text, ParseMode ParseMode, List <string> DefinesList = null)
        {
            MatchCollection            mc  = Regex.Matches(Text, @"(([\f\t\v\x85\p{Z}])*///.*\r\n)*([\f\t\v\x85\p{Z}])*///.*", RegexOptions.Compiled);
            syntax_tree_node           cu  = null;
            documentation_comment_list dcl = new documentation_comment_list();

            if (mc.Count > 0)
            {
                int i = 0;
                int mci = 0, curmindex = mc[0].Index;
                int line_num = 1;
                int col      = 1;
                documentation_comment_section dcs = null;
                int dcs_count  = 0;
                int dcs_length = 0;
                while (true)
                {
                    if (Text[i] == '\n')
                    {
                        line_num++;
                    }
                    if (dcs != null && dcs_count == dcs_length)
                    {
                        dcs.source_context = new SourceContext(dcs.source_context.begin_position.line_num, dcs.source_context.begin_position.column_num, line_num - 1, col);
                        dcs = null;
                    }
                    if (Text[i] == '\n')
                    {
                        col = 0;
                    }
                    if (curmindex == i)
                    {
                        dcs = parse_section(mc[mci].Value);
                        if (dcs.tags.Count > 0 || dcs.text != null)
                        {
                            dcs.source_context = new SourceContext(line_num, col, -1, -1);
                            dcl.sections.Add(dcs);
                            dcs_count  = 0;
                            dcs_length = mc[mci].Length;
                        }
                        mci++;
                        if (mci < mc.Count)
                        {
                            curmindex = mc[mci].Index;
                        }
                        else
                        {
                            curmindex = -1;
                        }
                    }
                    i++;
                    col++;
                    if (dcs != null)
                    {
                        dcs_count++;
                    }
                    if (i == Text.Length || (curmindex == -1 && dcs == null))
                    {
                        break;
                    }
                }
            }
            return(dcl);
        }
Esempio n. 9
0
 public override void visit(documentation_comment_section _documentation_comment_section)
 {
     throw new NotImplementedException();
 }
		public virtual void visit(documentation_comment_section _documentation_comment_section)
		{
			DefaultVisit(_documentation_comment_section);
		}
Esempio n. 11
0
 public override void visit(documentation_comment_section node)
 {
     prepare_collection(node.tags, "tags");
 }
Esempio n. 12
0
		public override void visit(documentation_comment_section _documentation_comment_section)
		{
			executer.visit(_documentation_comment_section);
			if (_documentation_comment_section.tags != null)
			foreach (dynamic x in _documentation_comment_section.tags)
				if(x != null)
					this.visit(x);
		}