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,
1388 lineNr,
1389 scope,
1390 md,
1391 stext,
1392 DocOptions())
1393 };
1394 output.openHash(name);
1395 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
1396 if (astImpl)
1397 {
1398 PerlModDocVisitor visitor(output);
1399 std::visit(visitor,astImpl->root);
1400 visitor.finish();
1401 }
1402 output.closeHash();
1403 }
1404}
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:163
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:55

References PerlModOutput::add(), PerlModOutput::addField(), PerlModOutput::closeHash(), createDocParser(), 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 2958 of file perlmodgen.cpp.

2959{
2960 PerlModGenerator pmg(Config_getBool(PERLMOD_PRETTY));
2961 pmg.generate();
2962}
#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 1406 of file perlmodgen.cpp.

1407{
1408 return to_string_lower(prot);
1409}
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 1419 of file perlmodgen.cpp.

1420{
1421 pathDoxyfile = qs;
1423}
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 1417 of file perlmodgen.cpp.

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

◆ pathDoxyfile

QCString pathDoxyfile
static

Definition at line 1416 of file perlmodgen.cpp.

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