clang  6.0.0svn
Public Types | Public Member Functions | Friends | List of all members
clang::RawComment Class Reference

#include "clang/AST/RawCommentList.h"

Public Types

enum  CommentKind {
  RCK_Invalid, RCK_OrdinaryBCPL, RCK_OrdinaryC, RCK_BCPLSlash,
  RCK_BCPLExcl, RCK_JavaDoc, RCK_Qt, RCK_Merged
}
 

Public Member Functions

 RawComment ()
 
 RawComment (const SourceManager &SourceMgr, SourceRange SR, bool Merged, bool ParseAllComments)
 
CommentKind getKind () const LLVM_READONLY
 
bool isInvalid () const LLVM_READONLY
 
bool isMerged () const LLVM_READONLY
 
bool isAttached () const LLVM_READONLY
 Is this comment attached to any declaration? More...
 
void setAttached ()
 
bool isTrailingComment () const LLVM_READONLY
 Returns true if it is a comment that should be put after a member: More...
 
bool isAlmostTrailingComment () const LLVM_READONLY
 Returns true if it is a probable typo: More...
 
bool isOrdinary () const LLVM_READONLY
 Returns true if this comment is not a documentation comment. More...
 
bool isDocumentation () const LLVM_READONLY
 Returns true if this comment any kind of a documentation comment. More...
 
bool isParseAllComments () const LLVM_READONLY
 Returns whether we are parsing all comments. More...
 
StringRef getRawText (const SourceManager &SourceMgr) const
 Returns raw comment text with comment markers. More...
 
SourceRange getSourceRange () const LLVM_READONLY
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
const char * getBriefText (const ASTContext &Context) const
 
comments::FullCommentparse (const ASTContext &Context, const Preprocessor *PP, const Decl *D) const
 Parse the comment, assuming it is attached to decl D. More...
 

Friends

class ASTReader
 

Detailed Description

Definition at line 28 of file RawCommentList.h.

Member Enumeration Documentation

◆ CommentKind

Enumerator
RCK_Invalid 

Invalid comment.

RCK_OrdinaryBCPL 

Any normal BCPL comments.

RCK_OrdinaryC 

Any normal C comment.

RCK_BCPLSlash 
/// stuff
RCK_BCPLExcl 
//! stuff
RCK_JavaDoc 
/** stuff */
RCK_Qt 
/*! stuff */

, also used by HeaderDoc

RCK_Merged 

Two or more documentation comments merged together.

Definition at line 30 of file RawCommentList.h.

Constructor & Destructor Documentation

◆ RawComment() [1/2]

clang::RawComment::RawComment ( )
inline

Definition at line 41 of file RawCommentList.h.

◆ RawComment() [2/2]

RawComment::RawComment ( const SourceManager SourceMgr,
SourceRange  SR,
bool  Merged,
bool  ParseAllComments 
)

Member Function Documentation

◆ getBriefText()

const char* clang::RawComment::getBriefText ( const ASTContext Context) const
inline

Definition at line 114 of file RawCommentList.h.

◆ getKind()

CommentKind clang::RawComment::getKind ( ) const
inline

Definition at line 46 of file RawCommentList.h.

Referenced by clang::Sema::ActOnComment().

◆ getLocEnd()

SourceLocation clang::RawComment::getLocEnd ( ) const
inline

Definition at line 112 of file RawCommentList.h.

◆ getLocStart()

SourceLocation clang::RawComment::getLocStart ( ) const
inline

◆ getRawText()

StringRef clang::RawComment::getRawText ( const SourceManager SourceMgr) const
inline

Returns raw comment text with comment markers.

Definition at line 101 of file RawCommentList.h.

Referenced by parse(), and RawComment().

◆ getSourceRange()

SourceRange clang::RawComment::getSourceRange ( ) const
inline

Definition at line 110 of file RawCommentList.h.

Referenced by clang::ASTContext::addComment(), and parse().

◆ isAlmostTrailingComment()

bool clang::RawComment::isAlmostTrailingComment ( ) const
inline

Returns true if it is a probable typo:

//< stuff
/*< stuff */

Definition at line 80 of file RawCommentList.h.

Referenced by clang::Sema::ActOnComment().

◆ isAttached()

bool clang::RawComment::isAttached ( ) const
inline

Is this comment attached to any declaration?

Definition at line 59 of file RawCommentList.h.

◆ isDocumentation()

bool clang::RawComment::isDocumentation ( ) const
inline

Returns true if this comment any kind of a documentation comment.

Definition at line 91 of file RawCommentList.h.

References isInvalid().

◆ isInvalid()

bool clang::RawComment::isInvalid ( ) const
inline

Definition at line 50 of file RawCommentList.h.

◆ isMerged()

bool clang::RawComment::isMerged ( ) const
inline

Definition at line 54 of file RawCommentList.h.

◆ isOrdinary()

bool clang::RawComment::isOrdinary ( ) const
inline

Returns true if this comment is not a documentation comment.

Definition at line 85 of file RawCommentList.h.

◆ isParseAllComments()

bool clang::RawComment::isParseAllComments ( ) const
inline

Returns whether we are parsing all comments.

Definition at line 96 of file RawCommentList.h.

◆ isTrailingComment()

bool clang::RawComment::isTrailingComment ( ) const
inline

Returns true if it is a comment that should be put after a member:

///< stuff
//!< stuff
/**< stuff */
/*!< stuff */

Definition at line 72 of file RawCommentList.h.

◆ parse()

comments::FullComment * RawComment::parse ( const ASTContext Context,
const Preprocessor PP,
const Decl D 
) const

◆ setAttached()

void clang::RawComment::setAttached ( )
inline

Definition at line 63 of file RawCommentList.h.

Friends And Related Function Documentation

◆ ASTReader

friend class ASTReader
friend

Definition at line 160 of file RawCommentList.h.


The documentation for this class was generated from the following files: