summaryrefslogtreecommitdiffstats
path: root/src/perlmodgen.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2014-02-08 19:46:56 (GMT)
committeralbert-github <albert.tests@gmail.com>2014-02-08 19:46:56 (GMT)
commit1bd64ac0e925ba2ff069ec64c026ea3c32f85600 (patch)
tree0a4663d5a76502ceb35b774ac9dc491763d978b7 /src/perlmodgen.cpp
parent0178674db5f4391e41c389d21f42656684939167 (diff)
downloadDoxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.zip
Doxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.tar.gz
Doxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.tar.bz2
Recognize all HTML4 special character entities
In doxygen a limited number of HTML4 special character entities are recognized, with this patch the full list of HTML4 special character entities (see http://www.w3.org/TR/html4/sgml/entities.html) is supported (as far as they can be represented in the output format). - doxygen_manual.tex - latexgen.cpp Added wasysym package to support per thousand sign (perthousand command from textcomp didn't work properly) Added option for textcomp package so currency symbol would work properly - htmlcmds.doc Adjusted documentation, listing all entities - compound.xsd - xmlgen.cpp Removed in xsd file all references for special HTML4 character entities and placed placeholder so doxygen (in xmlgen.cpp)can automatically add the right element names. - util.cpp - util.h Define all entities with their representation for all output formats. Define access routines to the different representations Mapping (for recognition of the entities) based on running through the list of available entities, after validation of the order of the entities. A few entities contain now besides letters also numbers at the end. - docparser.h Define symbols for all entities as well as a helper struct and enum. The member m_letter is not used anymore and thus removed. All existing symbols were renamed so no confusion (i.e. errors when forgetting to rename some symbols) can occur. Obsolete references to letter removed, all letters with accents etc. are explicitly defined and not through the generic accent name plus an extra letter. - docparser.cpp Adjust used symbols to their new names. Remove references to letter (as used for accents etc.) Replace list of explicitly supported entities with call to symbol code access routine. - docbookvisitor.cpp - htmldocvisitor.cpp - latexdocvisitor.cpp - mandocvisitor.cpp - perlmodgen.cpp - printdocvisitor.h - rtfdocvisitor.cpp - textdocvisitor.cpp - xmldocvisitor.cpp Replace list of explicitly supported entities with call to access routine and use returned value to output.
Diffstat (limited to 'src/perlmodgen.cpp')
-rw-r--r--src/perlmodgen.cpp191
1 files changed, 59 insertions, 132 deletions
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index 237cb8f..573400d 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -41,6 +41,7 @@
#include "namespacedef.h"
#include "membergroup.h"
#include "section.h"
+#include "util.h"
#define PERLOUTPUT_MAX_INDENTATION 40
@@ -540,140 +541,66 @@ void PerlModDocVisitor::visit(DocWhiteSpace *)
void PerlModDocVisitor::visit(DocSymbol *sy)
{
- char c = 0;
- const char *s = 0;
- const char *accent = 0;
- const char *symbol = 0;
- switch(sy->symbol())
+ const DocSymbol::PerlSymb *res = get_symbol_perl(sy->symbol());
+ const char *accent;
+ if (res-> symb)
{
- case DocSymbol::At: c = '@'; break;
- case DocSymbol::Less: c = '<'; break;
- case DocSymbol::Greater: c = '>'; break;
- case DocSymbol::Amp: c = '&'; break;
- case DocSymbol::Dollar: c = '$'; break;
- case DocSymbol::Hash: c = '#'; break;
- case DocSymbol::DoubleColon: s = "::"; break;
- case DocSymbol::Percent: c = '%'; break;
- case DocSymbol::Pipe: c = '|'; break;
- case DocSymbol::Quot: c = '"'; break;
- case DocSymbol::Lsquo: s = "\\\'"; break;
- case DocSymbol::Rsquo: s = "\\\'"; break;
- case DocSymbol::Ldquo: c = '"'; break;
- case DocSymbol::Rdquo: c = '"'; break;
- case DocSymbol::Ndash: c = '-'; break;
- case DocSymbol::Mdash: s = "--"; break;
- case DocSymbol::Nbsp: c = ' '; break;
- case DocSymbol::Uml: accent = "umlaut"; break;
- case DocSymbol::Acute: accent = "acute"; break;
- case DocSymbol::Grave: accent = "grave"; break;
- case DocSymbol::Circ: accent = "circ"; break;
- case DocSymbol::Slash: accent = "slash"; break;
- case DocSymbol::Tilde: accent = "tilde"; break;
- case DocSymbol::Cedil: accent = "cedilla"; break;
- case DocSymbol::Ring: accent = "ring"; break;
- case DocSymbol::BSlash: s = "\\\\"; break;
- case DocSymbol::Copy: symbol = "copyright"; break;
- case DocSymbol::Tm: symbol = "trademark"; break;
- case DocSymbol::Reg: symbol = "registered"; break;
- case DocSymbol::Szlig: symbol = "szlig"; break;
- case DocSymbol::Apos: s = "\\\'"; break;
- case DocSymbol::Aelig: symbol = "aelig"; break;
- case DocSymbol::AElig: symbol = "AElig"; break;
- case DocSymbol::GrkGamma: symbol = "Gamma"; break;
- case DocSymbol::GrkDelta: symbol = "Delta"; break;
- case DocSymbol::GrkTheta: symbol = "Theta"; break;
- case DocSymbol::GrkLambda: symbol = "Lambda"; break;
- case DocSymbol::GrkXi: symbol = "Xi"; break;
- case DocSymbol::GrkPi: symbol = "Pi"; break;
- case DocSymbol::GrkSigma: symbol = "Sigma"; break;
- case DocSymbol::GrkUpsilon: symbol = "Upsilon"; break;
- case DocSymbol::GrkPhi: symbol = "Phi"; break;
- case DocSymbol::GrkPsi: symbol = "Psi"; break;
- case DocSymbol::GrkOmega: symbol = "Omega"; break;
- case DocSymbol::Grkalpha: symbol = "alpha"; break;
- case DocSymbol::Grkbeta: symbol = "beta"; break;
- case DocSymbol::Grkgamma: symbol = "gamma"; break;
- case DocSymbol::Grkdelta: symbol = "delta"; break;
- case DocSymbol::Grkepsilon: symbol = "epsilon"; break;
- case DocSymbol::Grkzeta: symbol = "zeta"; break;
- case DocSymbol::Grketa: symbol = "eta"; break;
- case DocSymbol::Grktheta: symbol = "theta"; break;
- case DocSymbol::Grkiota: symbol = "iota"; break;
- case DocSymbol::Grkkappa: symbol = "kappa"; break;
- case DocSymbol::Grklambda: symbol = "lambda"; break;
- case DocSymbol::Grkmu: symbol = "mu"; break;
- case DocSymbol::Grknu: symbol = "nu"; break;
- case DocSymbol::Grkxi: symbol = "xi"; break;
- case DocSymbol::Grkpi: symbol = "pi"; break;
- case DocSymbol::Grkrho: symbol = "rho"; break;
- case DocSymbol::Grksigma: symbol = "sigma"; break;
- case DocSymbol::Grktau: symbol = "tau"; break;
- case DocSymbol::Grkupsilon: symbol = "upsilon"; break;
- case DocSymbol::Grkphi: symbol = "phi"; break;
- case DocSymbol::Grkchi: symbol = "chi"; break;
- case DocSymbol::Grkpsi: symbol = "psi"; break;
- case DocSymbol::Grkomega: symbol = "omega"; break;
- case DocSymbol::Grkvarsigma: symbol = "sigma"; break;
- case DocSymbol::Section: symbol = "sect"; break;
- case DocSymbol::Degree: symbol = "deg"; break;
- case DocSymbol::Prime: s = "\\\'"; break;
- case DocSymbol::DoublePrime: c = '"'; break;
- case DocSymbol::Infinity: symbol = "inf"; break;
- case DocSymbol::EmptySet: symbol = "empty"; break;
- case DocSymbol::PlusMinus: s = "+/-"; break;
- case DocSymbol::Times: c = '*'; break;
- case DocSymbol::Minus: c = '-'; break;
- case DocSymbol::CenterDot: c = '.'; break;
- case DocSymbol::Partial: symbol = "partial"; break;
- case DocSymbol::Nabla: symbol = "nabla"; break;
- case DocSymbol::SquareRoot: symbol = "sqrt"; break;
- case DocSymbol::Perpendicular: symbol = "perp"; break;
- case DocSymbol::Sum: symbol = "sum"; break;
- case DocSymbol::Integral: symbol = "int"; break;
- case DocSymbol::Product: symbol = "prod"; break;
- case DocSymbol::Similar: c = '~'; break;
- case DocSymbol::Approx: symbol = "approx"; break;
- case DocSymbol::NotEqual: s = "!="; break;
- case DocSymbol::Equivalent: symbol = "equiv"; break;
- case DocSymbol::Proportional: symbol = "propto"; break;
- case DocSymbol::LessEqual: s = "<="; break;
- case DocSymbol::GreaterEqual: s = ">="; break;
- case DocSymbol::LeftArrow: s = "<-"; break;
- case DocSymbol::RightArrow: s = "->"; break;
- case DocSymbol::SetIn: symbol = "in"; break;
- case DocSymbol::SetNotIn: symbol = "notin"; break;
- case DocSymbol::LeftCeil: symbol = "lceil"; break;
- case DocSymbol::RightCeil: symbol = "rceil"; break;
- case DocSymbol::LeftFloor: symbol = "lfloor"; break;
- case DocSymbol::RightFloor: symbol = "rfloor"; break;
- case DocSymbol::Unknown: err("unknown symbol found\n");
- break;
- }
- if (c != 0)
- {
- enterText();
- m_output.add(c);
- }
- else if (s != 0)
- {
- enterText();
- m_output.add(s);
- }
- else if (symbol != 0)
- {
- leaveText();
- openItem("symbol");
- m_output.addFieldQuotedString("symbol", symbol);
- closeItem();
- }
- else if (accent != 0)
+ switch (res->type)
+ {
+ case DocSymbol::Perl_string:
+ enterText();
+ m_output.add(res->symb);
+ break;
+ case DocSymbol::Perl_char:
+ enterText();
+ m_output.add(res->symb[0]);
+ break;
+ case DocSymbol::Perl_symbol:
+ leaveText();
+ openItem("symbol");
+ m_output.addFieldQuotedString("symbol", res->symb);
+ closeItem();
+ break;
+ default:
+ switch(res->type)
+ {
+ case DocSymbol::Perl_umlaut:
+ accent = "umlaut";
+ break;
+ case DocSymbol::Perl_acute:
+ accent = "acute";
+ break;
+ case DocSymbol::Perl_grave:
+ accent = "grave";
+ break;
+ case DocSymbol::Perl_circ:
+ accent = "circ";
+ break;
+ case DocSymbol::Perl_slash:
+ accent = "slash";
+ break;
+ case DocSymbol::Perl_tilde:
+ accent = "tilde";
+ break;
+ case DocSymbol::Perl_cedilla:
+ accent = "cedilla";
+ break;
+ case DocSymbol::Perl_ring:
+ accent = "ring";
+ break;
+ }
+ leaveText();
+ openItem("accent");
+ m_output
+ .addFieldQuotedString("accent", accent)
+ .addFieldQuotedChar("letter", res->symb[0]);
+ closeItem();
+ break;
+ }
+ }
+ else
{
- leaveText();
- openItem("accent");
- m_output
- .addFieldQuotedString("accent", accent)
- .addFieldQuotedChar("letter", sy->letter());
- closeItem();
+ err("perl: non supported HTML-entity found: &%s;\n",get_symbol_item(sy->symbol()));
}
}