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 "docoptions.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
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 QCString &fileName,
76 int startLine,
77 const Definition *ctx,
78 const MemberDef *md,
79 const QCString &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 QCString &fileName,int lineNr,
90 const QCString &input);
91
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: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 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 validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocNodeASTPtr validatingParseText(IDocParser &parserIntf, const QCString &input)
IDocNodeASTPtr createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const QCString &fileName, int lineNr, const QCString &input)
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.