Doxygen
Loading...
Searching...
No Matches
docparser.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2022 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#ifndef DOCPARSER_H
17#define DOCPARSER_H
18
19#include <stdio.h>
20#include <memory>
21
22#include "dstring.h"
23#include "construct.h"
24#include "types.h"
25#include "docoptions.h"
26
27class MemberDef;
28class Definition;
29
30//---------------------------------------------------------------------------
31
32//! @brief opaque parser interface
34{
35 public:
37};
38
39//! @brief pointer to parser interface
40using IDocParserPtr = std::unique_ptr<IDocParser>;
41
42//! @brief factory function to create a parser
44
45//---------------------------------------------------------------------------
46
47//! @brief opaque representation of the abstract syntax tree (AST)
49{
50 public:
52
53 virtual bool empty() const = 0;
54};
55
56using IDocNodeASTPtr = std::unique_ptr<IDocNodeAST>;
57
58
59/*! Main entry point for the comment block parser.
60 * @param parserIntf The parser object created via createDocParser()
61 * @param fileName File in which the documentation block is found (or the
62 * name of the example file in case isExample is true).
63 * @param startLine Line at which the documentation block is found.
64 * @param ctx Class or namespace to which this block belongs.
65 * @param md Member definition to which the documentation belongs.
66 * Can be 0.
67 * @param input String representation of the documentation block.
68 * @param options Optional parameters.
69 * @returns An object representing the abstract syntax tree. Ownership of the
70 * pointer is handed over to the caller.
71 */
73 IDocParser &parserIntf,
74 const DString &fileName,
75 int startLine,
76 const Definition *ctx,
77 const MemberDef *md,
78 const DString &input,
79 const DocOptions &options);
80
81/*! Main entry point for parsing simple text fragments. These
82 * fragments are limited to words, whitespace and symbols.
83 */
85
86
87/*! Main entry point for parsing titles. These allow limited markup commands */
88IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf,const DString &fileName,int lineNr,
89 const DString &input);
90
91
92IDocNodeASTPtr createRef(IDocParser &parser,const DString &target,const DString &context, const DString &srcFile = "", int srcLine = -1);
93
94//--------------------------------------------------------------------------------
95
96/*! Searches for section and anchor commands in the input
97 * Sections found will be added to the SectionManager.
98 */
99void docFindSections(const DString &input,
100 const Definition *d,
101 const DString &fileName);
102
103DString parseCommentAsText(const Definition *scope,const MemberDef *md,
104 const DString &doc,const DString &fileName,int lineNr);
105DString parseCommentAsHtml(const Definition *scope,const MemberDef *member,
106 const DString &doc,const DString &fileName,int lineNr);
107
108#endif
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:89
The common base class of all entity definitions found in the sources.
Definition definition.h:77
opaque representation of the abstract syntax tree (AST)
Definition docparser.h:49
virtual bool empty() const =0
opaque parser interface
Definition docparser.h:34
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
Definition construct.h:20
DString parseCommentAsText(const Definition *scope, const MemberDef *md, const DString &doc, const DString &fileName, int lineNr)
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const DString &fileName, int lineNr, const DString &input)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:59
DString parseCommentAsHtml(const Definition *scope, const MemberDef *member, const DString &doc, const DString &fileName, int lineNr)
IDocNodeASTPtr createRef(IDocParser &parserIntf, const DString &target, const DString &context, const DString &srcFile, int srcLine)
IDocNodeASTPtr validatingParseText(IDocParser &parserIntf, const DString &input)
void docFindSections(const DString &input, const Definition *d, const DString &fileName)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &input, const DocOptions &options)
std::unique_ptr< IDocNodeAST > IDocNodeASTPtr
Definition docparser.h:56
std::unique_ptr< IDocParser > IDocParserPtr
pointer to parser interface
Definition docparser.h:40
Definition dstring.h:918
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
This file contains a number of basic enums and types.