Inheritance: CiDocBlock
Example #1
0
        protected override void Write(CiDocPara para, bool many)
        {
            if (many)
            {
                WriteLine();
                StartDocLine();
                WriteLine();
                StartDocLine();
            }
            foreach (CiDocInline inline in para.Children)
            {
                switch (inline)
                {
                case CiDocText text:
                    WriteDoc(text.Text);
                    break;

                case CiDocCode code:
                    Write('`');
                    WriteDoc(code.Text);
                    Write('`');
                    break;

                default:
                    throw new ArgumentException(inline.GetType().Name);
                }
            }
        }
Example #2
0
        protected virtual void Write(CiDocPara para, bool many)
        {
            if (many)
            {
                WriteLine();
                Write(" * <p>");
            }
            foreach (CiDocInline inline in para.Children)
            {
                switch (inline)
                {
                case CiDocText text:
                    WriteXmlDoc(text.Text);
                    break;

                case CiDocCode code:;
                    Write("<code>");
                    WriteXmlDoc(code.Text);
                    Write("</code>");
                    break;

                default:
                    throw new ArgumentException(inline.GetType().Name);
                }
            }
        }
Example #3
0
        void Write(CiDocPara para)
        {
            foreach (CiDocInline inline in para.Children)
            {
                switch (inline)
                {
                case CiDocText text:
                    WriteDoc(text.Text);
                    break;

                case CiDocCode code:
                    switch (code.Text)
                    {
                    case "true":
                    case "false":
                    case "null":
                        Write("<see langword=\"");
                        Write(code.Text);
                        Write("\" />");
                        break;

                    default:
                        Write("<c>");
                        WriteDoc(code.Text);
                        Write("</c>");
                        break;
                    }
                    break;

                default:
                    throw new ArgumentException(inline.GetType().Name);
                }
            }
        }
Example #4
0
        void Write(CiDocPara para)
        {
            foreach (CiDocInline inline in para.Children)
            {
                CiDocText text = inline as CiDocText;
                if (text != null)
                {
                    WriteDoc(text.Text);
                    continue;
                }
                CiDocCode code = inline as CiDocCode;
                if (code != null)
                {
                    switch (code.Text)
                    {
                    case "true": Write("<see langword=\"true\" />"); break;

                    case "false": Write("<see langword=\"false\" />"); break;

                    case "null": Write("<see langword=\"null\" />"); break;

                    default:
                        Write("<c>");
                        WriteDoc(code.Text);
                        Write("</c>");
                        break;
                    }
                    continue;
                }
                throw new ArgumentException(inline.GetType().Name);
            }
        }
Example #5
0
        public CiCodeDoc ParseCodeDoc()
        {
            CiDocPara         summary = ParsePara();
            List <CiDocBlock> details = new List <CiDocBlock>();

            if (Eat(CiDocToken.Period))
            {
                while (!See(CiDocToken.EndOfFile))
                {
                    details.Add(ParseBlock());
                }
            }
            return(new CiCodeDoc {
                Summary = summary, Details = details.ToArray()
            });
        }
Example #6
0
        protected override void Write(CiDocPara para, bool many)
        {
            if (many)
            {
                WriteLine();
                Write("/// <para>");
            }
            foreach (CiDocInline inline in para.Children)
            {
                switch (inline)
                {
                case CiDocText text:
                    WriteXmlDoc(text.Text);
                    break;

                case CiDocCode code:
                    switch (code.Text)
                    {
                    case "true":
                    case "false":
                    case "null":
                        Write("<see langword=\"");
                        Write(code.Text);
                        Write("\" />");
                        break;

                    default:
                        Write("<c>");
                        WriteXmlDoc(code.Text);
                        Write("</c>");
                        break;
                    }
                    break;

                default:
                    throw new ArgumentException(inline.GetType().Name);
                }
            }
            if (many)
            {
                Write("</para>");
            }
        }
Example #7
0
File: GenPerl5.cs Project: epi/cito
	void Write(CiDocPara para)
	{
		foreach (CiDocInline inline in para.Children) {
			CiDocText text = inline as CiDocText;
			if (text != null) {
				WriteDoc(text.Text);
				continue;
			}
			CiDocCode code = inline as CiDocCode;
			if (code != null) {
				Write("C<");
				WriteDoc(code.Text);
				Write('>');
				continue;
			}
			throw new ArgumentException(inline.GetType().Name);
		}
		WriteLine();
		WriteLine();
	}
Example #8
0
 void Write(CiDocPara para)
 {
     foreach (CiDocInline inline in para.Children)
     {
         CiDocText text = inline as CiDocText;
         if (text != null)
         {
             WriteDoc(text.Text);
             continue;
         }
         CiDocCode code = inline as CiDocCode;
         if (code != null)
         {
             Write("<code>");
             WriteDoc(code.Text);
             Write("</code>");
             continue;
         }
         throw new ArgumentException(inline.GetType().Name);
     }
 }
Example #9
0
        void Write(CiDocPara para)
        {
            foreach (CiDocInline inline in para.Children)
            {
                switch (inline)
                {
                case CiDocText text:
                    WriteDoc(text.Text);
                    break;

                case CiDocCode code:;
                    Write("<code>");
                    WriteDoc(code.Text);
                    Write("</code>");
                    break;

                default:
                    throw new ArgumentException(inline.GetType().Name);
                }
            }
        }
Example #10
0
 void Write(CiDocPara para)
 {
     foreach (CiDocInline inline in para.Children)
     {
         CiDocText text = inline as CiDocText;
         if (text != null)
         {
             WriteDoc(text.Text, false);
             continue;
         }
         // TODO: $(D_CODE x) pastes "<pre>x</pre>" -
         // find some better alternative
         CiDocCode code = inline as CiDocCode;
         if (code != null)
         {
             WriteDoc(code.Text, true);
             continue;
         }
         throw new ArgumentException(inline.GetType().Name);
     }
 }
Example #11
0
File: GenCs.cs Project: epi/cito
 void Write(CiDocPara para)
 {
     foreach (CiDocInline inline in para.Children) {
     CiDocText text = inline as CiDocText;
     if (text != null) {
         WriteDoc(text.Text);
         continue;
     }
     CiDocCode code = inline as CiDocCode;
     if (code != null) {
         switch (code.Text) {
         case "true": Write("<see langword=\"true\" />"); break;
         case "false": Write("<see langword=\"false\" />"); break;
         case "null": Write("<see langword=\"null\" />"); break;
         default:
             Write("<c>");
             WriteDoc(code.Text);
             Write("</c>");
             break;
         }
         continue;
     }
     throw new ArgumentException(inline.GetType().Name);
     }
 }
Example #12
0
File: GenD.cs Project: epi/cito
 void Write(CiDocPara para)
 {
     foreach (CiDocInline inline in para.Children) {
     CiDocText text = inline as CiDocText;
     if (text != null) {
         WriteDoc(text.Text, false);
         continue;
     }
     // TODO: $(D_CODE x) pastes "<pre>x</pre>" -
     // find some better alternative
     CiDocCode code = inline as CiDocCode;
     if (code != null) {
         WriteDoc(code.Text, true);
         continue;
     }
     throw new ArgumentException(inline.GetType().Name);
     }
 }