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 "qcstring.h"
23#include "growvector.h"
24#include "construct.h"
25#include "types.h"
26#include "config.h"
27
28class MemberDef;
29class Definition;
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 isEmpty() const = 0;
55};
56
57using IDocNodeASTPtr = std::unique_ptr<IDocNodeAST>;
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 indexWords Indicates whether or not words should be put in the
69 * search index.
70 * @param isExample TRUE if the documentation belongs to an example.
71 * @param exampleName Base name of the example file (0 if isExample is FALSE).
72 * @param singleLine Output should be presented on a single line, so without
73 * starting a new paragraph at the end.
74 * @param linkFromIndex TRUE if the documentation is generated from an
75 * index page. In this case context is not used to determine
76 * the relative path when making a link.
77 * @param markdownSupport TRUE if the input needs to take markdown markup into
78 * account.
79 * @param autolinkSupport TRUE if the input need to perform auto linking of words
80 * @returns An object representing the abstract syntax tree. Ownership of the
81 * pointer is handed over to the caller.
82 */
83IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf,const QCString &fileName,int startLine,
84 const Definition *ctx, const MemberDef *md,
85 const QCString &input,bool indexWords,
86 bool isExample,const QCString &exampleName,
87 bool singleLine,bool linkFromIndex,
88 bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT),
89 bool autolinkSupport = Config_getBool(AUTOLINK_SUPPORT));
90
91/*! Main entry point for parsing simple text fragments. These
92 * fragments are limited to words, whitespace and symbols.
93 */
95
96IDocNodeASTPtr createRef(IDocParser &parser,const QCString &target,const QCString &context, const QCString &srcFile = "", int srcLine = -1);
97
98//--------------------------------------------------------------------------------
99
100/*! Searches for section and anchor commands in the input
101 * Sections found will be added to the SectionManager.
102 */
103void docFindSections(const QCString &input,
104 const Definition *d,
105 const QCString &fileName);
106
107#endif
The common base class of all entity definitions found in the sources.
Definition definition.h:76
opaque representation of the abstract syntax tree (AST)
Definition docparser.h:50
virtual bool isEmpty() const =0
opaque parser interface
Definition docparser.h:35
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
This is an alternative implementation of QCString.
Definition qcstring.h:101
#define Config_getBool(name)
Definition config.h:33
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
Definition construct.h:20
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
IDocNodeASTPtr validatingParseText(IDocParser &parserIntf, const QCString &input)
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, bool autolinkSupport)
IDocNodeASTPtr createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
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:55
This file contains a number of basic enums and types.