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 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 45 of file perlmodgen.cpp.

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

Function Documentation

◆ addPerlModDocBlock()

static 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 1356 of file perlmodgen.cpp.

1363{
1364 QCString stext = text.stripWhiteSpace();
1365 if (stext.isEmpty())
1366 {
1367 output.addField(name).add("{}");
1368 }
1369 else
1370 {
1371 auto parser { createDocParser() };
1372 auto ast { validatingParseDoc(*parser.get(),
1373 fileName,lineNr,scope,md,stext,FALSE,FALSE,
1374 QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
1375 output.openHash(name);
1376 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
1377 if (astImpl)
1378 {
1379 PerlModDocVisitor visitor(output);
1380 std::visit(visitor,astImpl->root);
1381 visitor.finish();
1382 }
1383 output.closeHash();
1384 }
1385}
Class representing the abstract syntax tree of a documentation block.
Definition docnode.h:1460
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
#define Config_getBool(name)
Definition config.h:33
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
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)
#define FALSE
Definition qcstring.h:34

References PerlModOutput::add(), PerlModOutput::addField(), PerlModOutput::closeHash(), Config_getBool, 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()

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

Definition at line 1327 of file perlmodgen.cpp.

1328{
1329 if (!al.hasParameters()) return;
1330 output.openList("template_parameters");
1331 for (const Argument &a : al)
1332 {
1333 output.openHash();
1334 if (!a.type.isEmpty())
1335 output.addFieldQuotedString("type", a.type);
1336 if (!a.name.isEmpty())
1337 output.addFieldQuotedString("declaration_name", a.name)
1338 .addFieldQuotedString("definition_name", a.name);
1339 if (!a.defval.isEmpty())
1340 output.addFieldQuotedString("default", a.defval);
1341 output.closeHash();
1342 }
1343 output.closeList();
1344}
bool hasParameters() const
Definition arguments.h:69
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]

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

Definition at line 1346 of file perlmodgen.cpp.

1347{
1349}
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]

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

Definition at line 1351 of file perlmodgen.cpp.

1352{
1354}
virtual ArgumentList getTemplateParameterList() const =0

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

◆ generatePerlMod()

void generatePerlMod ( )

Definition at line 2952 of file perlmodgen.cpp.

2953{
2954 PerlModGenerator pmg(Config_getBool(PERLMOD_PRETTY));
2955 pmg.generate();
2956}

References Config_getBool, and PerlModGenerator::generate().

Referenced by generateOutput().

◆ getProtectionName()

static const char * getProtectionName ( Protection prot)
static

Definition at line 1387 of file perlmodgen.cpp.

1388{
1389 switch (prot)
1390 {
1391 case Protection::Public: return "public";
1392 case Protection::Protected: return "protected";
1393 case Protection::Private: return "private";
1394 case Protection::Package: return "package";
1395 }
1396 return nullptr;
1397}
@ Package
Definition types.h:26
@ Public
Definition types.h:26
@ Private
Definition types.h:26
@ Protected
Definition types.h:26

References Package, Private, Protected, and Public.

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

◆ getVirtualnessName()

static const char * getVirtualnessName ( Specifier virt)
static

Definition at line 1399 of file perlmodgen.cpp.

1400{
1401 switch(virt)
1402 {
1403 case Specifier::Normal: return "non_virtual";
1404 case Specifier::Virtual: return "virtual";
1405 case Specifier::Pure: return "pure_virtual";
1406 }
1407 return nullptr;
1408}
@ Virtual
Definition types.h:29
@ Normal
Definition types.h:29
@ Pure
Definition types.h:29

References Normal, Pure, and Virtual.

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

◆ setPerlModDoxyfile()

void setPerlModDoxyfile ( const QCString & qs)

Definition at line 1413 of file perlmodgen.cpp.

1414{
1415 pathDoxyfile = qs;
1417}
static std::string currentDirPath()
Definition dir.cpp:340
static QCString pathDoxyExec
static QCString pathDoxyfile

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

Referenced by readConfiguration().

Variable Documentation

◆ pathDoxyExec

QCString pathDoxyExec
static

Definition at line 1411 of file perlmodgen.cpp.

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

◆ pathDoxyfile

QCString pathDoxyfile
static

Definition at line 1410 of file perlmodgen.cpp.

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