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()

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

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

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

Definition at line 1328 of file perlmodgen.cpp.

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

1348{
1350}
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 1352 of file perlmodgen.cpp.

1353{
1355}
virtual ArgumentList getTemplateParameterList() const =0

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

◆ generatePerlMod()

void generatePerlMod ( )

Definition at line 2940 of file perlmodgen.cpp.

2941{
2942 PerlModGenerator pmg(Config_getBool(PERLMOD_PRETTY));
2943 pmg.generate();
2944}

References Config_getBool, and PerlModGenerator::generate().

Referenced by generateOutput().

◆ getProtectionName()

const char * getProtectionName ( Protection prot)
static

Definition at line 1388 of file perlmodgen.cpp.

1389{
1390 return to_string_lower(prot);
1391}
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 1401 of file perlmodgen.cpp.

1402{
1403 pathDoxyfile = qs;
1405}
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 1399 of file perlmodgen.cpp.

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

◆ pathDoxyfile

QCString pathDoxyfile
static

Definition at line 1398 of file perlmodgen.cpp.

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