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
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 isEmpty() const = 0;
54};
55
56using IDocNodeASTPtr = std::unique_ptr<IDocNodeAST>;
57
58/*! Main entry point for the comment block parser.
59 * @param parserIntf The parser object created via createDocParser()
60 * @param fileName File in which the documentation block is found (or the
61 * name of the example file in case isExample is TRUE).
62 * @param startLine Line at which the documentation block is found.
63 * @param ctx Class or namespace to which this block belongs.
64 * @param md Member definition to which the documentation belongs.
65 * Can be 0.
66 * @param input String representation of the documentation block.
67 * @param indexWords Indicates whether or not words should be put in the
68 * search index.
69 * @param isExample TRUE if the documentation belongs to an example.
70 * @param exampleName Base name of the example file (0 if isExample is FALSE).
71 * @param singleLine Output should be presented on a single line, so without
72 * starting a new paragraph at the end.
73 * @param linkFromIndex TRUE if the documentation is generated from an
74 * index page. In this case context is not used to determine
75 * the relative path when making a link.
76 * @param markdownSupport TRUE if the input needs to take markdown markup into
77 * account.
78 * @returns An object representing the abstract syntax tree. Ownership of the
79 * pointer is handed over to the caller.
80 */
81IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf,const QCString &fileName,int startLine,
82 const Definition *ctx, const MemberDef *md,
83 const QCString &input,bool indexWords,
84 bool isExample,const QCString &exampleName,
85 bool singleLine,bool linkFromIndex,
86 bool markdownSupport);
87
88/*! Main entry point for parsing simple text fragments. These
89 * fragments are limited to words, whitespace and symbols.
90 */
92
93IDocNodeASTPtr createRef(IDocParser &parser,const QCString &target,const QCString &context, const QCString &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 QCString &input,
101 const Definition *d,
102 const QCString &fileName);
103
104#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:49
virtual bool isEmpty() const =0
opaque parser interface
Definition docparser.h:34
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 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 createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
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)
std::unique_ptr< IDocNodeAST > IDocNodeASTPtr
Definition docparser.h:56
std::unique_ptr< IDocParser > IDocParserPtr
pointer to parser interface
Definition docparser.h:40
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
This file contains a number of basic enums and types.