//===--- Comment.h - Comment AST nodes --------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines comment AST nodes. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_COMMENT_H #define LLVM_CLANG_AST_COMMENT_H #include "clang/AST/CommentCommandTraits.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Type.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" namespace clang { class Decl; class ParmVarDecl; class TemplateParameterList; namespace comments { class FullComment; enum class InlineCommandRenderKind; enum class ParamCommandPassDirection; /// Describes the syntax that was used in a documentation command. /// /// Exact values of this enumeration are important because they used to select /// parts of diagnostic messages. Audit diagnostics before changing or adding /// a new value. enum CommandMarkerKind { … }; enum class CommentKind { … }; /// Any part of the comment. /// Abstract class. class Comment { … }; /// Inline content (contained within a block). /// Abstract class. class InlineContentComment : public Comment { … }; /// Plain text. class TextComment : public InlineContentComment { … }; /// The most appropriate rendering mode for this command, chosen on command /// semantics in Doxygen. enum class InlineCommandRenderKind { … }; /// A command with word-like arguments that is considered inline content. class InlineCommandComment : public InlineContentComment { … }; /// Abstract class for opening and closing HTML tags. HTML tags are always /// treated as inline content (regardless HTML semantics). class HTMLTagComment : public InlineContentComment { … }; /// An opening HTML tag with attributes. class HTMLStartTagComment : public HTMLTagComment { … }; /// A closing HTML tag. class HTMLEndTagComment : public HTMLTagComment { … }; /// Block content (contains inline content). /// Abstract class. class BlockContentComment : public Comment { … }; /// A single paragraph that contains inline content. class ParagraphComment : public BlockContentComment { … }; /// A command that has zero or more word-like arguments (number of word-like /// arguments depends on command name) and a paragraph as an argument /// (e. g., \\brief). class BlockCommandComment : public BlockContentComment { … }; enum class ParamCommandPassDirection { … }; /// Doxygen \\param command. class ParamCommandComment : public BlockCommandComment { … }; /// Doxygen \\tparam command, describes a template parameter. class TParamCommandComment : public BlockCommandComment { … }; /// A line of text contained in a verbatim block. class VerbatimBlockLineComment : public Comment { … }; /// A verbatim block command (e. g., preformatted code). Verbatim block has an /// opening and a closing command and contains multiple lines of text /// (VerbatimBlockLineComment nodes). class VerbatimBlockComment : public BlockCommandComment { … }; /// A verbatim line command. Verbatim line has an opening command, a single /// line of text (up to the newline after the opening command) and has no /// closing command. class VerbatimLineComment : public BlockCommandComment { … }; /// Information about the declaration, useful to clients of FullComment. struct DeclInfo { … }; /// A full comment attached to a declaration, contains block content. class FullComment : public Comment { … }; } // end namespace comments } // end namespace clang #endif