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 <cstdio>
20#include <memory>
21
22#include "construct.h"
23#include "docoptions.h"
24#include "dstring.h"
25#include "types.h"
26
27class DString;
28class Definition;
29class MemberDef;
30
31//---------------------------------------------------------------------------
32
33//! @brief opaque parser interface
35{
36 public:
38};
39
40//! @brief pointer to parser interface
41using IDocParserPtr = std::unique_ptr<IDocParser>;
42
43//! @brief factory function to create a parser
45
46//---------------------------------------------------------------------------
47
48//! @brief opaque representation of the abstract syntax tree (AST)
50{
51 public:
53
54 virtual bool empty() const = 0;
55};
56
57using IDocNodeASTPtr = std::unique_ptr<IDocNodeAST>;
58
59
60/*! Main entry point for the comment block parser.
61 * @param parserIntf The parser object created via createDocParser()
62 * @param fileName File in which the documentation block is found (or the
63 * name of the example file in case isExample is true).
64 * @param startLine Line at which the documentation block is found.
65 * @param ctx Class or namespace to which this block belongs.
66 * @param md Member definition to which the documentation belongs.
67 * Can be 0.
68 * @param input String representation of the documentation block.
69 * @param options Optional parameters.
70 * @returns An object representing the abstract syntax tree. Ownership of the
71 * pointer is handed over to the caller.
72 */
74 IDocParser &parserIntf,
75 const DString &fileName,
76 int startLine,
77 const Definition *ctx,
78 const MemberDef *md,
79 const DString &input,
80 const DocOptions &options);
81
82/*! Main entry point for parsing simple text fragments. These
83 * fragments are limited to words, whitespace and symbols.
84 */
86
87
88/*! Main entry point for parsing titles. These allow limited markup commands */
89IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf,const DString &fileName,int lineNr,
90 const DString &input);
91
92
93IDocNodeASTPtr createRef(IDocParser &parser,const DString &target,const DString &context, const DString &srcFile = "", int srcLine = -1);
94
95//--------------------------------------------------------------------------------
96
97/*! Searches for section and anchor commands in the input
98 * Sections found will be added to the SectionManager.
99 */
100void docFindSections(const DString &input,
101 const Definition *d,
102 const DString &fileName);
103
104DString parseCommentAsText(const Definition *scope,const MemberDef *md,
105 const DString &doc,const DString &fileName,int lineNr);
106DString parseCommentAsHtml(const Definition *scope,const MemberDef *member,
107 const DString &doc,const DString &fileName,int lineNr);
108
109#endif
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
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:50
virtual bool empty() const =0
opaque parser interface
Definition docparser.h:35
A model of a class/file/namespace member symbol.
Definition memberdef.h:45
#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)
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:57
std::unique_ptr< IDocParser > IDocParserPtr
pointer to parser interface
Definition docparser.h:41
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:59
Definition dstring.h:913
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
This file contains a number of basic enums and types.