13#include "filesystem/fileresolver.h"
15#include <QtCore/QCoreApplication>
16#include <QtCore/qglobalstatic.h>
17#include <QtCore/qhash.h>
18#include <QtCore/qstack.h>
19#include <QtCore/qstring.h>
31 void parse(
const QString &source,
DocPrivate *docPrivate,
const QSet<QString> &metaCommandSet,
32 const QSet<QString> &possibleTopics);
48 enum class ArgumentParsingOptions {
55 QString detailsUnknownCommand(
const QSet<QString> &metaCommandSet,
const QString &str);
56 void insertTarget(
const QString &target);
57 void insertKeyword(
const QString &keyword);
58 void include(
const QString &fileName,
const QString &identifier,
const QStringList ¶meters);
59 void startFormat(
const QString &format,
int cmd);
60 bool openCommand(
int cmd);
61 bool closeCommand(
int endCmd);
63 void endSection(
int unit,
int endCmd);
65 void appendAtom(
const Atom&);
67 void appendChar(QChar ch);
68 void appendWord(
const QString &word);
69 void appendToCode(
const QString &code);
70 void appendToCode(
const QString &code,
Atom::
AtomType defaultType);
75 void leaveValueList();
77 void quoteFromFile(
const QString& filename);
78 bool expandMacro(ArgumentParsingOptions options);
79 void expandMacro(
const QString &def,
const QStringList &args);
80 QString expandMacroToString(
const QString &name,
const Macro ¯o);
82 QString getArgument(ArgumentParsingOptions options = ArgumentParsingOptions::Default);
83 QString getBracedArgument(ArgumentParsingOptions options);
84 QString getBracketedArgument();
85 QStringList getMacroArguments(
const QString &name,
const Macro ¯o);
86 QString getOptionalArgument();
87 QString getRestOfLine();
88 QString getMetaCommandArgument(
const QString &cmdStr);
89 QString getUntilEnd(
int cmd);
90 QString getCode(
int cmd,
CodeMarker *marker,
const QString &argStr = QString());
92 inline bool isAutoLinkString(
const QString &word);
93 bool isAutoLinkString(
const QString &word, qsizetype &curPos);
95 bool isLeftBraceAhead();
96 bool isLeftBracketAhead();
97 void skipSpacesOnLine();
98 void skipSpacesOrOneEndl();
100 void skipToNextPreprocessorCommand();
101 static bool isCode(
const Atom *atom);
102 static bool isQuote(
const Atom *atom);
103 static void expandArgumentsInString(QString &str,
const QStringList &args);
105 QStack<qsizetype> m_openedInputs {};
108 qsizetype m_position {};
109 qsizetype m_backslashPosition {};
110 qsizetype m_endPosition {};
111 qsizetype m_inputLength {};
113 qsizetype m_cachedPosition {};
116 enum ParagraphState { OutsideParagraph, InSingleLineParagraph, InMultiLineParagraph };
117 ParagraphState m_paragraphState {};
118 bool m_inTableHeader {};
119 bool m_inTableRow {};
120 bool m_inTableItem {};
121 bool m_indexStartedParagraph {};
124 QString m_pendingParagraphString {};
128 QMap<QString, Location> m_targetMap {};
129 QMap<
int, QString> m_pendingFormats {};
130 QStack<
int> m_openedCommands {};
131 QStack<OpenedList> m_openedLists {};
133 Atom *m_lastAtom {
nullptr };
The Atom class is the fundamental unit for representing documents internally.
AtomType type() const
Return the type of this atom.
AtomType
\value AnnotatedList \value AutoLink \value BaseName \value BriefLeft \value BriefRight \value C \val...
const Atom * next() const
Return the next atom in the atom list.
The Config class contains the configuration variables for controlling how qdoc produces documentation...
static QString untabifyEtc(const QString &str)
static QStringList s_ignoreWords
void parse(const QString &source, DocPrivate *docPrivate, const QSet< QString > &metaCommandSet, const QSet< QString > &possibleTopics)
Parse the source string to build a Text data structure in docPrivate.
static QString dedent(int level, const QString &str)
static QString cmdName(int cmd)
static int endCmdFor(int cmd)
static int indentLevel(const QString &str)
static void initialize(const Config &config, FileResolver &file_resolver)
static QString endCmdName(int cmd)
QSet< QString > parameterNames() const
Text legaleseText() const
QList< Text > alsoList() const
const Location & location() const
Returns the starting location of a qdoc comment.
Doc & operator=(const Doc &doc)
Doc(const Location &start_loc, const Location &end_loc, const QString &source, const QSet< QString > &metaCommandSet, const QSet< QString > &topics)
Parse the qdoc comment source.
const QList< Atom * > & tableOfContents() const
static void quoteFromFile(const Location &location, Quoter "er, ResolvedFile resolved_file)
bool isInternal() const
Returns true if the set of metacommands used in the doc comment contains {internal}...
bool hasTableOfContents() const
const QList< Atom * > & keywords() const
const Text & body() const
static void initialize(FileResolver &file_resolver)
QStringList omitEnumItemNames() const
const QList< Atom * > & targets() const
QMultiMap< ComparisonCategory, Text > * comparesWithMap() const
const QList< int > & tableOfContentsLevels() const
Text trimmedBriefText(const QString &className) const
ArgList metaCommandArgs(const QString &metaCommand) const
Text briefText(bool inclusive=false) const
const Location & startLocation() const
Returns the starting location of a qdoc comment.
bool isMarkedReimp() const
Returns true if the set of metacommands used in the doc comment contains {reimp}.
static void terminate()
All the heap allocated variables are deleted.
TopicList topicsUsed() const
Returns a reference to the list of topic commands used in the current qdoc comment.
QStringMultiMap * metaTagMap() const
QSet< QString > metaCommandsUsed() const
void constructExtra() const
const QString & source() const
QStringList enumItemNames() const
Encapsulate the logic that QDoc uses to find files whose path is provided by the user and that are re...
The Location class provides a way to mark a location in a file.
int columnNo() const
Returns the current column number.
void dump() const
Prints a human-readable version of the contained atoms to stderr.
Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from=nullptr, bool inclusive=false) const
QMultiMap< QString, QString > QStringMultiMap
Combined button and popup list for selecting options.
QHash_QString_Macro macroHash
QHash_QString_int cmdHash
Simple structure used by the Doc and DocParser classes.
Represents a file that is reachable by QDoc based on its current configuration.