-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
docparser.h
101 lines (84 loc) · 3.96 KB
/
docparser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/******************************************************************************
*
* Copyright (C) 1997-2022 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef DOCPARSER_H
#define DOCPARSER_H
#include <stdio.h>
#include <memory>
#include "qcstring.h"
#include "growvector.h"
class MemberDef;
class Definition;
//---------------------------------------------------------------------------
//! @brief opaque parser interface
class IDocParser
{
public:
virtual ~IDocParser() = default;
};
//! @brief pointer to parser interface
using IDocParserPtr = std::unique_ptr<IDocParser>;
//! @brief factory function to create a parser
IDocParserPtr createDocParser();
//---------------------------------------------------------------------------
//! @brief opaque representation of the abstract syntax tree (AST)
class IDocNodeAST
{
public:
virtual ~IDocNodeAST() = default;
virtual bool isEmpty() const = 0;
};
using IDocNodeASTPtr = std::unique_ptr<IDocNodeAST>;
/*! Main entry point for the comment block parser.
* @param parserIntf The parser object created via createDocParser()
* @param fileName File in which the documentation block is found (or the
* name of the example file in case isExample is TRUE).
* @param startLine Line at which the documentation block is found.
* @param ctx Class or namespace to which this block belongs.
* @param md Member definition to which the documentation belongs.
* Can be 0.
* @param input String representation of the documentation block.
* @param indexWords Indicates whether or not words should be put in the
* search index.
* @param isExample TRUE if the documentation belongs to an example.
* @param exampleName Base name of the example file (0 if isExample is FALSE).
* @param singleLine Output should be presented on a single line, so without
* starting a new paragraph at the end.
* @param linkFromIndex TRUE if the documentation is generated from an
* index page. In this case context is not used to determine
* the relative path when making a link.
* @param markdownSupport TRUE if the input needs to take markdown markup into
* account.
* @returns An object representing the abstract syntax tree. Ownership of the
* pointer is handed over to the caller.
*/
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf,const QCString &fileName,int startLine,
const Definition *ctx, const MemberDef *md,
const QCString &input,bool indexWords,
bool isExample,const QCString &exampleName,
bool singleLine,bool linkFromIndex,
bool markdownSupport);
/*! Main entry point for parsing simple text fragments. These
* fragments are limited to words, whitespace and symbols.
*/
IDocNodeASTPtr validatingParseText(IDocParser &parser,const QCString &input);
IDocNodeASTPtr createRef(IDocParser &parser,const QCString &target,const QCString &context, const QCString &srcFile = "", int srcLine = -1);
//--------------------------------------------------------------------------------
/*! Searches for section and anchor commands in the input
* Sections found will be added to the SectionManager.
*/
void docFindSections(const QCString &input,
const Definition *d,
const QCString &fileName);
#endif