Doxygen
Loading...
Searching...
No Matches
perlmodgen.cpp File Reference
#include <stdlib.h>
#include <stack>
#include "perlmodgen.h"
#include "docparser.h"
#include "docnode.h"
#include "message.h"
#include "doxygen.h"
#include "pagedef.h"
#include "memberlist.h"
#include "arguments.h"
#include "config.h"
#include "groupdef.h"
#include "classdef.h"
#include "classlist.h"
#include "filename.h"
#include "membername.h"
#include "namespacedef.h"
#include "membergroup.h"
#include "section.h"
#include "util.h"
#include "htmlentity.h"
#include "emoji.h"
#include "dir.h"
#include "portable.h"
#include "moduledef.h"
#include "construct.h"
#include "cite.h"
Include dependency graph for perlmodgen.cpp:

Go to the source code of this file.

Classes

class  PerlModOutputStream
class  PerlModOutput
class  PerlModDocVisitor
 Concrete visitor implementation for PerlMod output. More...
class  PerlModGenerator

Macros

#define PERLOUTPUT_MAX_INDENTATION   40

Functions

static void addTemplateArgumentList (const ArgumentList &al, PerlModOutput &output, const QCString &)
static void addTemplateList (const ClassDef *cd, PerlModOutput &output)
static void addTemplateList (const ConceptDef *cd, PerlModOutput &output)
static void addPerlModDocBlock (PerlModOutput &output, const QCString &name, const QCString &fileName, int lineNr, const Definition *scope, const MemberDef *md, const QCString &text)
static const char * getProtectionName (Protection prot)
static const char * getVirtualnessName (Specifier virt)
void setPerlModDoxyfile (const QCString &qs)
void generatePerlMod ()

Variables

static QCString pathDoxyfile
static QCString pathDoxyExec

Macro Definition Documentation

◆ PERLOUTPUT_MAX_INDENTATION

#define PERLOUTPUT_MAX_INDENTATION   40

Definition at line 46 of file perlmodgen.cpp.

Referenced by PerlModOutput::decIndent(), and PerlModOutput::incIndent().

Function Documentation

◆ addPerlModDocBlock()

void addPerlModDocBlock ( PerlModOutput & output,
const QCString & name,
const QCString & fileName,
int lineNr,
const Definition * scope,
const MemberDef * md,
const QCString & text )
static

Definition at line 1370 of file perlmodgen.cpp.

1377{
1378 QCString stext = text.stripWhiteSpace();
1379 if (stext.isEmpty())
1380 {
1381 output.addField(name).add("{}");
1382 }
1383 else
1384 {
1385 auto parser { createDocParser() };
1386 auto ast { validatingParseDoc(*parser.get(),
1387 fileName,lineNr,scope,md,stext,FALSE,FALSE,
1388 QCString(),FALSE,FALSE) };
1389 output.openHash(name);
1390 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
1391 if (astImpl)
1392 {
1393 PerlModDocVisitor visitor(output);
1394 std::visit(visitor,astImpl->root);
1395 visitor.finish();
1396 }
1397 output.closeHash();
1398 }
1399}
Class representing the abstract syntax tree of a documentation block.
Definition docnode.h:1466
Concrete visitor implementation for PerlMod output.
PerlModOutput & add(char c)
PerlModOutput & addField(const QCString &s)
PerlModOutput & openHash(const QCString &s=QCString())
PerlModOutput & closeHash()
This is an alternative implementation of QCString.
Definition qcstring.h:101
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
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)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55
#define FALSE
Definition qcstring.h:34

References PerlModOutput::add(), PerlModOutput::addField(), PerlModOutput::closeHash(), createDocParser(), FALSE, PerlModDocVisitor::finish(), QCString::isEmpty(), PerlModOutput::openHash(), QCString::stripWhiteSpace(), and validatingParseDoc().

Referenced by PerlModGenerator::generatePerlModForClass(), PerlModGenerator::generatePerlModForConcept(), PerlModGenerator::generatePerlModForFile(), PerlModGenerator::generatePerlModForGroup(), PerlModGenerator::generatePerlModForMember(), PerlModGenerator::generatePerlModForModule(), PerlModGenerator::generatePerlModForNamespace(), and PerlModGenerator::generatePerlModForPage().

◆ addTemplateArgumentList()

void addTemplateArgumentList ( const ArgumentList & al,
PerlModOutput & output,
const QCString &  )
static

Definition at line 1341 of file perlmodgen.cpp.

1342{
1343 if (!al.hasParameters()) return;
1344 output.openList("template_parameters");
1345 for (const Argument &a : al)
1346 {
1347 output.openHash();
1348 if (!a.type.isEmpty())
1349 output.addFieldQuotedString("type", a.type);
1350 if (!a.name.isEmpty())
1351 output.addFieldQuotedString("declaration_name", a.name)
1352 .addFieldQuotedString("definition_name", a.name);
1353 if (!a.defval.isEmpty())
1354 output.addFieldQuotedString("default", a.defval);
1355 output.closeHash();
1356 }
1357 output.closeList();
1358}
bool hasParameters() const
Definition arguments.h:76
PerlModOutput & closeList()
PerlModOutput & addFieldQuotedString(const QCString &field, const QCString &content)
PerlModOutput & openList(const QCString &s=QCString())
This class contains the information about the argument of a function or template.
Definition arguments.h:27

References PerlModOutput::addFieldQuotedString(), PerlModOutput::closeHash(), PerlModOutput::closeList(), ArgumentList::hasParameters(), PerlModOutput::openHash(), and PerlModOutput::openList().

Referenced by addTemplateList(), and addTemplateList().

◆ addTemplateList() [1/2]

void addTemplateList ( const ClassDef * cd,
PerlModOutput & output )
static

Definition at line 1360 of file perlmodgen.cpp.

1361{
1363}
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual const QCString & name() const =0
static void addTemplateArgumentList(const ArgumentList &al, PerlModOutput &output, const QCString &)

References addTemplateArgumentList(), Definition::name(), and ClassDef::templateArguments().

Referenced by PerlModGenerator::generatePerlModForClass(), and PerlModGenerator::generatePerlModForConcept().

◆ addTemplateList() [2/2]

void addTemplateList ( const ConceptDef * cd,
PerlModOutput & output )
static

Definition at line 1365 of file perlmodgen.cpp.

1366{
1368}
virtual ArgumentList getTemplateParameterList() const =0

References addTemplateArgumentList(), ConceptDef::getTemplateParameterList(), and Definition::name().

◆ generatePerlMod()

void generatePerlMod ( )

Definition at line 2953 of file perlmodgen.cpp.

2954{
2955 PerlModGenerator pmg(Config_getBool(PERLMOD_PRETTY));
2956 pmg.generate();
2957}
#define Config_getBool(name)
Definition config.h:33

References Config_getBool, and PerlModGenerator::generate().

Referenced by generateOutput().

◆ getProtectionName()

const char * getProtectionName ( Protection prot)
static

Definition at line 1401 of file perlmodgen.cpp.

1402{
1403 return to_string_lower(prot);
1404}
static const char * to_string_lower(Protection prot)
Definition types.h:50

References to_string_lower().

Referenced by PerlModGenerator::addListOfAllMembers(), PerlModGenerator::generatePerlModForClass(), and PerlModGenerator::generatePerlModForMember().

◆ getVirtualnessName()

const char * getVirtualnessName ( Specifier virt)
static

◆ setPerlModDoxyfile()

void setPerlModDoxyfile ( const QCString & qs)

Definition at line 1414 of file perlmodgen.cpp.

1415{
1416 pathDoxyfile = qs;
1418}
static std::string currentDirPath()
Definition dir.cpp:342
static QCString pathDoxyExec
static QCString pathDoxyfile

References Dir::currentDirPath(), pathDoxyExec, and pathDoxyfile.

Referenced by readConfiguration().

Variable Documentation

◆ pathDoxyExec

QCString pathDoxyExec
static

Definition at line 1412 of file perlmodgen.cpp.

Referenced by PerlModGenerator::generateDoxyRules(), and setPerlModDoxyfile().

◆ pathDoxyfile

QCString pathDoxyfile
static

Definition at line 1411 of file perlmodgen.cpp.

Referenced by PerlModGenerator::generateDoxyRules(), and setPerlModDoxyfile().