Hello,

Here is a small patch to enable new[] on llvm::BumpPtrAllocator.

Please review.

Dmitri

On Tue, Jul 3, 2012 at 3:14 PM, Dmitri Gribenko <[email protected]> wrote:
> Hello,
>
> The proposed patch implements AST classes for comments, a real parser
> for Doxygen comments and a very simple semantic analysis that just
> builds the AST.  It also includes some minor changes for lexer to pick
> up source locations I didn't think about before.
>
> I decided to model the comments AST along the ideas of HTML AST: block
> and inline content.
>
> * Block content is a paragraph or a command that has a paragraph as an
> argument or verbatim command.
> * Inline content is placed within some block.  Inline content includes
> plain text, inline commands and HTML as tag soup.
>
> Here are the AST nodes:
>
> $ cat include/clang/Basic/CommentNodes.td
> class Comment<bit abstract = 0> {
>   bit Abstract = abstract;
> }
>
> class DComment<Comment base, bit abstract = 0> : Comment<abstract> {
>   Comment Base = base;
> }
>
> def InlineContentComment : Comment<1>;
>   def TextComment : DComment<InlineContentComment>;
>   def InlineCommandComment : DComment<InlineContentComment>;
>   def HTMLTagComment : DComment<InlineContentComment, 1>;
>     def HTMLOpenTagComment : DComment<HTMLTagComment>;
>     def HTMLCloseTagComment : DComment<HTMLTagComment>;
>
> def BlockContentComment : Comment<1>;
>   def ParagraphComment : DComment<BlockContentComment>;
>   def BlockCommandComment : DComment<BlockContentComment>;
>     def ParamCommandComment : DComment<BlockCommandComment>;
>     def VerbatimBlockComment : DComment<BlockCommandComment>;
>     def VerbatimLineComment : DComment<BlockCommandComment>;
>
> def VerbatimBlockLineComment : Comment;
>
> def FullComment : Comment;
>
> More example ASTs attached.
>
> Not implemented in this patch:
> * a real iterator for Comment child nodes (but do we need one?)
> * diagnostics during parsing and semantic analysis;
> * finding and resolving declaration references in comment text;
> * TableGen-based generation of Doxygen command properties.
>
> Please review.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/



-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/

Attachment: comments-parser-llvm-v1.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to