1 //===--- CommentBriefParser.h - Dumb comment parser -------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines a very simple Doxygen comment parser.
11 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_AST_COMMENTBRIEFPARSER_H
15 #define LLVM_CLANG_AST_COMMENTBRIEFPARSER_H
17 #include "clang/AST/CommentLexer.h"
22 /// A very simple comment parser that extracts "a brief description".
24 /// Due to a variety of comment styles, it considers the following as "a brief
25 /// description", in order of priority:
26 /// \li a \or \\short command,
27 /// \li the first paragraph,
28 /// \li a \\result or \\return or \\returns paragraph.
32 const CommandTraits &Traits;
34 /// Current lookahead token.
37 SourceLocation ConsumeToken() {
38 SourceLocation Loc = Tok.getLocation();
44 BriefParser(Lexer &L, const CommandTraits &Traits);
46 /// Return the best "brief description" we can find.
50 } // end namespace comments
51 } // end namespace clang