Orb/Doxygen/src/perlmodgen.cpp
changeset 4 468f4c8d3d5b
parent 0 42188c7ea2d9
equal deleted inserted replaced
3:d8fccb2cd802 4:468f4c8d3d5b
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  *
     3  *
     4  *
     4  *
     5  *
     5  *
     6  * Copyright (C) 1997-2008 by Dimitri van Heesch.
     6  * Copyright (C) 1997-2010 by Dimitri van Heesch.
     7  * Authors: Dimitri van Heesch, Miguel Lobo.
     7  * Authors: Dimitri van Heesch, Miguel Lobo.
     8  *
     8  *
     9  * Permission to use, copy, modify, and distribute this software and its
     9  * Permission to use, copy, modify, and distribute this software and its
    10  * documentation under the terms of the GNU General Public License is hereby
    10  * documentation under the terms of the GNU General Public License is hereby
    11  * granted. No representations are made about the suitability of this software
    11  * granted. No representations are made about the suitability of this software
   532   const char *s = 0;
   532   const char *s = 0;
   533   const char *accent = 0;
   533   const char *accent = 0;
   534   const char *symbol = 0;
   534   const char *symbol = 0;
   535   switch(sy->symbol())
   535   switch(sy->symbol())
   536   {
   536   {
   537   case DocSymbol::At:      c = '@'; break;
   537     case DocSymbol::At:      c = '@'; break;
   538   case DocSymbol::Less:    c = '<'; break;
   538     case DocSymbol::Less:    c = '<'; break;
   539   case DocSymbol::Greater: c = '>'; break;
   539     case DocSymbol::Greater: c = '>'; break;
   540   case DocSymbol::Amp:     c = '&'; break;
   540     case DocSymbol::Amp:     c = '&'; break;
   541   case DocSymbol::Dollar:  c = '$'; break;
   541     case DocSymbol::Dollar:  c = '$'; break;
   542   case DocSymbol::Hash:    c = '#'; break;
   542     case DocSymbol::Hash:    c = '#'; break;
   543   case DocSymbol::Percent: c = '%'; break;
   543     case DocSymbol::Percent: c = '%'; break;
   544   case DocSymbol::Quot:    c = '"'; break;
   544     case DocSymbol::Quot:    c = '"'; break;
   545   case DocSymbol::Lsquo:   s = "\\\'"; break;
   545     case DocSymbol::Lsquo:   s = "\\\'"; break;
   546   case DocSymbol::Rsquo:   s = "\\\'"; break;
   546     case DocSymbol::Rsquo:   s = "\\\'"; break;
   547   case DocSymbol::Ldquo:   c = '"'; break;
   547     case DocSymbol::Ldquo:   c = '"'; break;
   548   case DocSymbol::Rdquo:   c = '"'; break;
   548     case DocSymbol::Rdquo:   c = '"'; break;
   549   case DocSymbol::Ndash:   c = '-'; break;
   549     case DocSymbol::Ndash:   c = '-'; break;
   550   case DocSymbol::Mdash:   s = "--"; break;
   550     case DocSymbol::Mdash:   s = "--"; break;
   551   case DocSymbol::Nbsp:    c = ' '; break;
   551     case DocSymbol::Nbsp:    c = ' '; break;
   552   case DocSymbol::Uml:     accent = "umlaut"; break;
   552     case DocSymbol::Uml:     accent = "umlaut"; break;
   553   case DocSymbol::Acute:   accent = "acute"; break;
   553     case DocSymbol::Acute:   accent = "acute"; break;
   554   case DocSymbol::Grave:   accent = "grave"; break;
   554     case DocSymbol::Grave:   accent = "grave"; break;
   555   case DocSymbol::Circ:    accent = "circ"; break;
   555     case DocSymbol::Circ:    accent = "circ"; break;
   556   case DocSymbol::Slash:   accent = "slash"; break;
   556     case DocSymbol::Slash:   accent = "slash"; break;
   557   case DocSymbol::Tilde:   accent = "tilde"; break;
   557     case DocSymbol::Tilde:   accent = "tilde"; break;
   558   case DocSymbol::Cedil:   accent = "cedilla"; break;
   558     case DocSymbol::Cedil:   accent = "cedilla"; break;
   559   case DocSymbol::Ring:    accent = "ring"; break;
   559     case DocSymbol::Ring:    accent = "ring"; break;
   560   case DocSymbol::BSlash:  s = "\\\\"; break;
   560     case DocSymbol::BSlash:  s = "\\\\"; break;
   561   case DocSymbol::Copy:    symbol = "copyright"; break;
   561     case DocSymbol::Copy:    symbol = "copyright"; break;
   562   case DocSymbol::Tm:      symbol = "trademark"; break;
   562     case DocSymbol::Tm:      symbol = "trademark"; break;
   563   case DocSymbol::Reg:     symbol = "registered"; break;
   563     case DocSymbol::Reg:     symbol = "registered"; break;
   564   case DocSymbol::Szlig:   symbol = "szlig"; break;
   564     case DocSymbol::Szlig:   symbol = "szlig"; break;
   565   case DocSymbol::Apos:    s = "\\\'"; break;
   565     case DocSymbol::Apos:    s = "\\\'"; break;
   566   case DocSymbol::Aelig:   symbol = "aelig"; break;
   566     case DocSymbol::Aelig:   symbol = "aelig"; break;
   567   case DocSymbol::AElig:   symbol = "AElig"; break;
   567     case DocSymbol::AElig:   symbol = "AElig"; break;
   568   case DocSymbol::Unknown:
   568     case DocSymbol::Unknown: err("Error: unknown symbol found\n");
   569     err("Error: unknown symbol found\n");
   569                              break;
   570     break;
   570   }
   571   }
   571   if (c != 0) 
   572   if (c != 0) {
   572   {
   573     enterText();
   573     enterText();
   574     m_output.add(c);
   574     m_output.add(c);
   575   } else if (s != 0) {
   575   } 
       
   576   else if (s != 0) 
       
   577   {
   576     enterText();
   578     enterText();
   577     m_output.add(s);
   579     m_output.add(s);
   578   } else if (symbol != 0) {
   580   } 
       
   581   else if (symbol != 0) 
       
   582   {
   579     leaveText();
   583     leaveText();
   580     openItem("symbol");
   584     openItem("symbol");
   581     m_output.addFieldQuotedString("symbol", symbol);
   585     m_output.addFieldQuotedString("symbol", symbol);
   582     closeItem();
   586     closeItem();
   583   } else if (accent != 0) {
   587   } 
       
   588   else if (accent != 0) 
       
   589   {
   584     leaveText();
   590     leaveText();
   585     openItem("accent");
   591     openItem("accent");
   586     m_output
   592     m_output
   587       .addFieldQuotedString("accent", accent)
   593       .addFieldQuotedString("accent", accent)
   588       .addFieldQuotedChar("letter", sy->letter());
   594       .addFieldQuotedChar("letter", sy->letter());
   803   case DocSimpleSect::Author:		type = "author"; break;
   809   case DocSimpleSect::Author:		type = "author"; break;
   804   case DocSimpleSect::Authors:		type = "authors"; break;
   810   case DocSimpleSect::Authors:		type = "authors"; break;
   805   case DocSimpleSect::Version:		type = "version"; break;
   811   case DocSimpleSect::Version:		type = "version"; break;
   806   case DocSimpleSect::Since:		type = "since"; break;
   812   case DocSimpleSect::Since:		type = "since"; break;
   807   case DocSimpleSect::Date:		type = "date"; break;
   813   case DocSimpleSect::Date:		type = "date"; break;
   808   case DocSimpleSect::Note:		type = "bug"; break;
   814   case DocSimpleSect::Note:		type = "note"; break;
   809   case DocSimpleSect::Warning:		type = "warning"; break;
   815   case DocSimpleSect::Warning:		type = "warning"; break;
   810   case DocSimpleSect::Pre:		type = "pre"; break;
   816   case DocSimpleSect::Pre:		type = "pre"; break;
   811   case DocSimpleSect::Post:		type = "post"; break;
   817   case DocSimpleSect::Post:		type = "post"; break;
   812   case DocSimpleSect::Invar:		type = "invariant"; break;
   818   case DocSimpleSect::Invar:		type = "invariant"; break;
   813   case DocSimpleSect::Remark:		type = "remark"; break;
   819   case DocSimpleSect::Remark:		type = "remark"; break;
   816   case DocSimpleSect::Rcs:		type = "rcs"; break;
   822   case DocSimpleSect::Rcs:		type = "rcs"; break;
   817   case DocSimpleSect::Unknown:
   823   case DocSimpleSect::Unknown:
   818     err("Error: unknown simple section found\n");
   824     err("Error: unknown simple section found\n");
   819     break;
   825     break;
   820   }
   826   }
       
   827   leaveText();
       
   828   m_output.openHash();
   821   openOther();
   829   openOther();
   822   openSubBlock(type);
   830   openSubBlock(type);
   823 }
   831 }
   824 
   832 
   825 void PerlModDocVisitor::visitPost(DocSimpleSect *)
   833 void PerlModDocVisitor::visitPost(DocSimpleSect *)
   826 {
   834 {
   827   closeSubBlock();
   835   closeSubBlock();
   828   closeOther();
   836   closeOther();
       
   837   m_output.closeHash();
   829 }
   838 }
   830 
   839 
   831 void PerlModDocVisitor::visitPre(DocTitle *)
   840 void PerlModDocVisitor::visitPre(DocTitle *)
   832 {
   841 {
   833   openItem("title");
   842   openItem("title");