| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | #ifndef LLVM_CLANG_AST_COMMENTSEMA_H |
| 14 | #define |
| 15 | |
| 16 | #include "clang/AST/Comment.h" |
| 17 | #include "clang/Basic/Diagnostic.h" |
| 18 | #include "clang/Basic/SourceLocation.h" |
| 19 | #include "llvm/ADT/ArrayRef.h" |
| 20 | #include "llvm/ADT/StringMap.h" |
| 21 | #include "llvm/ADT/StringRef.h" |
| 22 | #include "llvm/Support/Allocator.h" |
| 23 | |
| 24 | namespace clang { |
| 25 | class Decl; |
| 26 | class SourceMgr; |
| 27 | class Preprocessor; |
| 28 | |
| 29 | namespace comments { |
| 30 | class CommandTraits; |
| 31 | |
| 32 | class { |
| 33 | Sema(const Sema &) = delete; |
| 34 | void operator=(const Sema &) = delete; |
| 35 | |
| 36 | |
| 37 | llvm::BumpPtrAllocator &; |
| 38 | |
| 39 | |
| 40 | const SourceManager &; |
| 41 | |
| 42 | DiagnosticsEngine &; |
| 43 | |
| 44 | CommandTraits &; |
| 45 | |
| 46 | const Preprocessor *; |
| 47 | |
| 48 | |
| 49 | DeclInfo *; |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | llvm::StringMap<TParamCommandComment *> ; |
| 56 | |
| 57 | |
| 58 | const BlockCommandComment *BriefCommand; |
| 59 | |
| 60 | |
| 61 | const BlockCommandComment *HeaderfileCommand; |
| 62 | |
| 63 | DiagnosticBuilder (SourceLocation Loc, unsigned DiagID) { |
| 64 | return Diags.Report(Loc, DiagID); |
| 65 | } |
| 66 | |
| 67 | |
| 68 | |
| 69 | SmallVector<HTMLStartTagComment *, 8> ; |
| 70 | |
| 71 | public: |
| 72 | Sema(llvm::BumpPtrAllocator &Allocator, const SourceManager &SourceMgr, |
| 73 | DiagnosticsEngine &Diags, CommandTraits &Traits, |
| 74 | const Preprocessor *PP); |
| 75 | |
| 76 | void (const Decl *D); |
| 77 | |
| 78 | |
| 79 | template<typename T> |
| 80 | ArrayRef<T> (ArrayRef<T> Source) { |
| 81 | if (!Source.empty()) |
| 82 | return Source.copy(Allocator); |
| 83 | return None; |
| 84 | } |
| 85 | |
| 86 | ParagraphComment *( |
| 87 | ArrayRef<InlineContentComment *> Content); |
| 88 | |
| 89 | BlockCommandComment *actOnBlockCommandStart(SourceLocation LocBegin, |
| 90 | SourceLocation LocEnd, |
| 91 | unsigned CommandID, |
| 92 | CommandMarkerKind CommandMarker); |
| 93 | |
| 94 | void actOnBlockCommandArgs(BlockCommandComment *Command, |
| 95 | ArrayRef<BlockCommandComment::Argument> Args); |
| 96 | |
| 97 | void actOnBlockCommandFinish(BlockCommandComment *Command, |
| 98 | ParagraphComment *Paragraph); |
| 99 | |
| 100 | ParamCommandComment *actOnParamCommandStart(SourceLocation LocBegin, |
| 101 | SourceLocation LocEnd, |
| 102 | unsigned CommandID, |
| 103 | CommandMarkerKind CommandMarker); |
| 104 | |
| 105 | void actOnParamCommandDirectionArg(ParamCommandComment *Command, |
| 106 | SourceLocation ArgLocBegin, |
| 107 | SourceLocation ArgLocEnd, |
| 108 | StringRef Arg); |
| 109 | |
| 110 | void actOnParamCommandParamNameArg(ParamCommandComment *Command, |
| 111 | SourceLocation ArgLocBegin, |
| 112 | SourceLocation ArgLocEnd, |
| 113 | StringRef Arg); |
| 114 | |
| 115 | void actOnParamCommandFinish(ParamCommandComment *Command, |
| 116 | ParagraphComment *Paragraph); |
| 117 | |
| 118 | TParamCommandComment *actOnTParamCommandStart(SourceLocation LocBegin, |
| 119 | SourceLocation LocEnd, |
| 120 | unsigned CommandID, |
| 121 | CommandMarkerKind CommandMarker); |
| 122 | |
| 123 | void actOnTParamCommandParamNameArg(TParamCommandComment *Command, |
| 124 | SourceLocation ArgLocBegin, |
| 125 | SourceLocation ArgLocEnd, |
| 126 | StringRef Arg); |
| 127 | |
| 128 | void actOnTParamCommandFinish(TParamCommandComment *Command, |
| 129 | ParagraphComment *Paragraph); |
| 130 | |
| 131 | InlineCommandComment *actOnInlineCommand(SourceLocation CommandLocBegin, |
| 132 | SourceLocation CommandLocEnd, |
| 133 | unsigned CommandID); |
| 134 | |
| 135 | InlineCommandComment *actOnInlineCommand(SourceLocation CommandLocBegin, |
| 136 | SourceLocation CommandLocEnd, |
| 137 | unsigned CommandID, |
| 138 | SourceLocation ArgLocBegin, |
| 139 | SourceLocation ArgLocEnd, |
| 140 | StringRef Arg); |
| 141 | |
| 142 | InlineContentComment *actOnUnknownCommand(SourceLocation LocBegin, |
| 143 | SourceLocation LocEnd, |
| 144 | StringRef CommandName); |
| 145 | |
| 146 | InlineContentComment *actOnUnknownCommand(SourceLocation LocBegin, |
| 147 | SourceLocation LocEnd, |
| 148 | unsigned CommandID); |
| 149 | |
| 150 | TextComment *(SourceLocation LocBegin, |
| 151 | SourceLocation LocEnd, |
| 152 | StringRef Text); |
| 153 | |
| 154 | VerbatimBlockComment *(SourceLocation Loc, |
| 155 | unsigned CommandID); |
| 156 | |
| 157 | VerbatimBlockLineComment *(SourceLocation Loc, |
| 158 | StringRef Text); |
| 159 | |
| 160 | void (VerbatimBlockComment *Block, |
| 161 | SourceLocation CloseNameLocBegin, |
| 162 | StringRef CloseName, |
| 163 | ArrayRef<VerbatimBlockLineComment *> Lines); |
| 164 | |
| 165 | VerbatimLineComment *(SourceLocation LocBegin, |
| 166 | unsigned CommandID, |
| 167 | SourceLocation TextBegin, |
| 168 | StringRef Text); |
| 169 | |
| 170 | HTMLStartTagComment *(SourceLocation LocBegin, |
| 171 | StringRef TagName); |
| 172 | |
| 173 | void (HTMLStartTagComment *Tag, |
| 174 | ArrayRef<HTMLStartTagComment::Attribute> Attrs, |
| 175 | SourceLocation GreaterLoc, |
| 176 | bool IsSelfClosing); |
| 177 | |
| 178 | HTMLEndTagComment *(SourceLocation LocBegin, |
| 179 | SourceLocation LocEnd, |
| 180 | StringRef TagName); |
| 181 | |
| 182 | FullComment *(ArrayRef<BlockContentComment *> Blocks); |
| 183 | |
| 184 | void checkBlockCommandEmptyParagraph(BlockCommandComment *Command); |
| 185 | |
| 186 | void checkReturnsCommand(const BlockCommandComment *Command); |
| 187 | |
| 188 | |
| 189 | |
| 190 | void checkBlockCommandDuplicate(const BlockCommandComment *Command); |
| 191 | |
| 192 | void checkDeprecatedCommand(const BlockCommandComment *); |
| 193 | |
| 194 | void checkFunctionDeclVerbatimLine(const BlockCommandComment *); |
| 195 | |
| 196 | void checkContainerDeclVerbatimLine(const BlockCommandComment *); |
| 197 | |
| 198 | void checkContainerDecl(const BlockCommandComment *); |
| 199 | |
| 200 | |
| 201 | |
| 202 | void resolveParamCommandIndexes(const FullComment *FC); |
| 203 | |
| 204 | bool (); |
| 205 | bool (); |
| 206 | |
| 207 | |
| 208 | |
| 209 | bool (); |
| 210 | |
| 211 | |
| 212 | |
| 213 | bool (); |
| 214 | bool (); |
| 215 | bool (); |
| 216 | bool (); |
| 217 | bool (); |
| 218 | bool (); |
| 219 | bool (); |
| 220 | bool (); |
| 221 | bool (); |
| 222 | bool (); |
| 223 | bool (); |
| 224 | bool (); |
| 225 | |
| 226 | ArrayRef<const ParmVarDecl *> (); |
| 227 | |
| 228 | |
| 229 | |
| 230 | void (); |
| 231 | |
| 232 | |
| 233 | unsigned (StringRef Name, |
| 234 | ArrayRef<const ParmVarDecl *> ParamVars); |
| 235 | |
| 236 | |
| 237 | |
| 238 | unsigned (StringRef Typo, |
| 239 | ArrayRef<const ParmVarDecl *> ParamVars); |
| 240 | |
| 241 | bool (StringRef Name, |
| 242 | const TemplateParameterList *TemplateParameters, |
| 243 | SmallVectorImpl<unsigned> *Position); |
| 244 | |
| 245 | StringRef ( |
| 246 | StringRef Typo, |
| 247 | const TemplateParameterList *TemplateParameters); |
| 248 | |
| 249 | InlineCommandComment::RenderKind |
| 250 | getInlineCommandRenderKind(StringRef Name) const; |
| 251 | }; |
| 252 | |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | #endif |
| 257 | |
| 258 | |