diff options
Diffstat (limited to 'src')
52 files changed, 425 insertions, 4465 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 9d9f041..f4b0c9a 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -485,6 +485,7 @@ void ClassDef::internalInsertMember(MemberDef *md, if (addToAllList) { + //printf("=======> adding member %s to class %s\n",md->name().data(),name().data()); MemberInfo *mi = new MemberInfo((MemberDef *)md, prot,md->virtualness(),FALSE); MemberNameInfo *mni=0; @@ -2505,6 +2506,7 @@ MemberDef *ClassDef::getMemberByName(const QCString &name) { MemberDef *xmd = 0; MemberNameInfo *mni = m_allMemberNameInfoSDict->find(name); + //printf("getMemberByName(%s)=%p\n",name.data(),mni); if (mni) { const int maxInheritanceDepth = 100000; @@ -2514,6 +2516,7 @@ MemberDef *ClassDef::getMemberByName(const QCString &name) for (mnii.toFirst();(mi=mnii.current());++mnii) { ClassDef *mcd=mi->memberDef->getClassDef(); + //printf("found member in %s\n",mcd->name().data()); int m=minClassDistance(this,mcd); if (m<mdist && mcd->isLinkable()) { diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index 449d467..0f9cb76 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -175,6 +175,9 @@ CommandMap htmlTagMap[] = { "h1", HTML_H1 }, { "h2", HTML_H2 }, { "h3", HTML_H3 }, + { "h4", HTML_H4 }, + { "h5", HTML_H5 }, + { "h6", HTML_H6 }, { 0, 0 } }; diff --git a/src/cmdmapper.h b/src/cmdmapper.h index e9dd096..ea765d4 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -131,7 +131,10 @@ enum HtmlTagType HTML_P = 24, HTML_H1 = 25, HTML_H2 = 26, - HTML_H3 = 27 + HTML_H3 = 27, + HTML_H4 = 28, + HTML_H5 = 29, + HTML_H6 = 30 }; class CmdMapper @@ -65,6 +65,7 @@ static const char * g_inputString; //!< the code fragment as text static int g_inputPosition; //!< read offset during parsing static int g_inputLines; //!< number of line in the code fragment static int g_yyLineNr; //!< current line number +static bool g_needsTermination; static bool g_exampleBlock; static QCString g_exampleName; @@ -923,7 +924,17 @@ static int countLines() const char *p=g_inputString; char c; int count=1; - while ((c=*p++)) if (c=='\n') count++; + while ((c=*p)) + { + p++ ; + if (c=='\n') count++; + } + if (p>g_inputString && *(p-1)!='\n') + { // last line does not end with a \n, so we add an extra + // line and explicitly terminate the line after parsing. + count++, + g_needsTermination=TRUE; + } return count; } @@ -1989,14 +2000,17 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s, g_inputString = s; g_inputPosition = 0; g_currentFontClass = 0; + g_needsTermination = FALSE; if (endLine!=-1) g_inputLines = endLine+1; else g_inputLines = countLines(); + if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + g_curlyCount = 0; g_bodyCurlyCount = 0; g_bracketCount = 0; @@ -2027,7 +2041,7 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s, codeYYrestart( codeYYin ); BEGIN( Body ); codeYYlex(); - if (g_inputLines==1) + if (g_needsTermination) { endFontClass(); g_code->endCodeLine(); diff --git a/src/defargs.l b/src/defargs.l index 7cdd523..7e08225 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -255,6 +255,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* if (*yytext==')' && g_curArgTypeName.stripWhiteSpace().isEmpty()) { g_curArgTypeName+=*yytext; + BEGIN(FuncQual); } else { diff --git a/src/doc.h b/src/doc.h deleted file mode 100644 index a88254a..0000000 --- a/src/doc.h +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * - * - * - * Copyright (C) 1997-2002 by Dimitri van Heesch. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software - * for any purpose. It is provided "as is" without express or implied warranty. - * See the GNU General Public License for more details. - * - * Documents produced by Doxygen are derivative works derived from the - * input used in their production; they are not affected by this license. - * - */ - -#ifndef DOC_H -#define DOC_H - -#include "qtbc.h" - -class OutputDocInterface; -class MemberDef; - -extern void parseDoc(OutputDocInterface &ol, - const char *fileName,int startLine, - const char *clName, MemberDef *md, - const QCString &docString); -extern void parseExample(OutputDocInterface &ol,const QCString &docString, - const char *fileName); -extern void parseText(OutputDocInterface &ol,const QCString &txtString); - -#endif diff --git a/src/doc.l b/src/doc.l deleted file mode 100644 index 2fe980f..0000000 --- a/src/doc.l +++ /dev/null @@ -1,3073 +0,0 @@ -/**************************************************************************** - * - * - * - * Copyright (C) 1997-2002 by Dimitri van Heesch. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software - * for any purpose. It is provided "as is" without express or implied warranty. - * See the GNU General Public License for more details. - * - * Documents produced by Doxygen are derivative works derived from the - * input used in their production; they are not affected by this license. - * - */ - -%{ - -/* - * includes - */ -#include <stdio.h> -#include <stdlib.h> -#include <assert.h> -#include <ctype.h> - -#include "qtbc.h" -#include <qarray.h> -#include <qstack.h> -#include <qregexp.h> - -// new experimental parser -#include "debug.h" - -#include "doc.h" -#include "code.h" -#include "message.h" -#include "doxygen.h" -#include "config.h" -#include "util.h" -#include "language.h" -#include "outputlist.h" -#include "reflist.h" -#include "page.h" - -#ifndef WIN32 -#include <unistd.h> -#endif - -#define YY_NEVER_INTERACTIVE 1 - -/* ----------------------------------------------------------------- - * - * scanner's state variables - */ -static MemberDef * memberDef; -static bool hasParamCommand; -static QDict<void> paramsFound; - -static OutputDocInterface * outDoc; -static bool insideArgumentList; -static QCString className; -static QCString linkRef; -static QCString linkText; -static QCString codeBlock; -static const char * inputString; -static int inputPosition; -static char yyFileName[4096] ; -static int yyLineNr = 1 ; -static bool exampleDoc; -static QCString exampleName; -static QCString htmlUrl,htmlText; -static QCString currentIncludeFile; -static int includeFileOffset = 0; -static int includeFileLength = 0; -static bool firstLine; -static bool inParamBlock; -static bool inRetValBlock; -static bool inExceptionBlock; -static bool inSeeBlock; -static bool inReturnBlock; -static bool inAuthorBlock; -static bool inDeprecatedBlock; -static bool inVersionBlock; -static bool inSinceBlock; -static bool inDateBlock; -static bool inBugBlock; -static bool inNoteBlock; -static bool inPreBlock; -static bool inPostBlock; -static bool inInvarBlock; -static bool inWarningBlock; -static bool inRemarkBlock; -static bool inAttentionBlock; -static bool inParBlock; -static bool insideHtmlLink; -static QCString sectionRef; -static bool insideVerbatim = FALSE; -static bool insidePre = FALSE; -static int depthIf; -static QCString curImageName; -static QCString curImageCaption; -static QCString curDotFileName; -static QCString curDotFileCaption; -static QCString internalRefFile; -static QCString internalRefAnchor; -static QCString caption; -static QCString refItemText; -static QCString addIndexWord; -static QStack<char> currentListIndent; // indent stack of all list items -static bool insideItemList = FALSE; - -struct DocLexerContext -{ - int rule; - int position; - const char *inputString; - YY_BUFFER_STATE lexerState; -}; - -static QStack<DocLexerContext> lexerStack; - -static void pushContext() -{ - DocLexerContext *ctx = new DocLexerContext; - ctx->rule = YY_START; - ctx->position = inputPosition; - ctx->inputString = inputString; - ctx->lexerState = YY_CURRENT_BUFFER; - lexerStack.push(ctx); - yy_switch_to_buffer(yy_create_buffer(docYYin, YY_BUF_SIZE)); -} - -static bool popContext() -{ - if (lexerStack.isEmpty()) return TRUE; - DocLexerContext *ctx = lexerStack.pop(); - inputPosition = ctx->position; - inputString = ctx->inputString; - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer(ctx->lexerState); - BEGIN(ctx->rule); - delete ctx; - return TRUE; -} - -static QCString copyDocString; -static QCString copyDocScope; -static QList<void> copyDocDefList; - -//----------------------------------------------------------------------------- - -static void initParser() -{ - insideArgumentList=FALSE; - className.resize(0); - linkRef.resize(0); - linkText.resize(0); - codeBlock.resize(0); - htmlUrl.resize(0); - htmlText.resize(0); - currentIncludeFile.resize(0); - includeFileOffset = 0; - includeFileLength = 0; - firstLine = TRUE; - inParamBlock = FALSE; - inRetValBlock = FALSE; - inExceptionBlock = FALSE; - inSeeBlock = FALSE; - inReturnBlock = FALSE; - inAuthorBlock = FALSE; - inDeprecatedBlock = FALSE; - inVersionBlock = FALSE; - inSinceBlock = FALSE; - inDateBlock = FALSE; - inBugBlock = FALSE; - inNoteBlock = FALSE; - inPreBlock = FALSE; - inPostBlock = FALSE; - inInvarBlock = FALSE; - inWarningBlock = FALSE; - inRemarkBlock = FALSE; - inAttentionBlock = FALSE; - inParBlock = FALSE; - insideHtmlLink = FALSE; -} - -//----------------------------------------------------------------------------- - -void scanString(const char *s); -void scanDoc(const char *s); -void internalParseDocument(const char *s); - -//----------------------------------------------------------------------------- - -class TableElem -{ - public: - TableElem(int r,int c); - ~TableElem(); - int getRow() { return row; } - int getCol() { return col; } - OutputDocInterface *outputDocInterface() { return od; } - - private: - OutputDocInterface *od; - int row; - int col; -}; - -TableElem::TableElem(int r,int c) -{ - //printf("TableElem::TableElem(%d,%d)\n",r,c); - od=outDoc->clone(); - outDoc=od; - row=r; - col=c; -} - -TableElem::~TableElem() -{ - //printf("TableElem::~TableElem(%d,%d)\n",row,col); - delete od; od=0; -} - -class Table -{ - public: - Table(); - ~Table(); - void newRow(); - void newElem(); - void setCaption(const char *s); - - private: - OutputDocInterface *m_parentDoc; - QList<TableElem> *m_elemList; - QCString m_caption; - int m_curRow; - int m_curCol; - int m_rows; - int m_cols; -}; - -Table::Table() -{ - m_parentDoc=outDoc; - m_elemList=new QList<TableElem>; - m_elemList->setAutoDelete(TRUE); - m_curRow=m_curCol=m_rows=m_cols=0; -} - -Table::~Table() -{ - //printf("Table::~Table()\n"); - // use elemList & cols & rows - if (m_cols>0 && m_rows>0) - { - m_parentDoc->startTable(!m_caption.isEmpty(),m_cols); - TableElem *e=m_elemList->first(); - while (e) - { - if (e->getRow()>0) - { - if (e->getCol()==0) - { - if (e->getRow()>1) m_parentDoc->endTableRow(); - m_parentDoc->nextTableRow(); - } - else - { - m_parentDoc->nextTableColumn(); - } - m_parentDoc->append(e->outputDocInterface()); - m_parentDoc->endTableColumn(); - } - e=m_elemList->next(); - } - if (!m_caption.isEmpty()) - { - m_parentDoc->startCaption(); - m_parentDoc->docify(m_caption); - m_parentDoc->endCaption(); - } - m_parentDoc->endTable(!m_caption.isEmpty()); - } - delete m_elemList; m_elemList=0; - outDoc=m_parentDoc; -} - -void Table::setCaption(const char *s) -{ - m_caption=s; -} - -void Table::newRow() -{ - //printf("Table::newRow()\n"); - m_curRow++; - if (m_curRow>m_rows) m_rows=m_curRow; - m_curCol=0; -} - -void Table::newElem() -{ - //printf("Table::newElem(%d,%d)\n",curRow,curCol); - TableElem *te = new TableElem(m_curRow,m_curCol); - m_elemList->append(te); - - m_curCol++; - if (m_curCol>m_cols) m_cols=m_curCol; -} - -static QStack<Table> tableStack; -static Table *curTable; - -static void startTable() -{ - //printf("startTable()\n"); - curTable=new Table; - tableStack.push(curTable); -} - -static void endTable() -{ - //printf("endTable()\n"); - delete tableStack.pop(); // the destructor adds the table to the stream! - curTable=tableStack.top(); -} - -static void forceEndTable() -{ - err("Error: More <table> tags found than </table> " - "tags in documentation block in file %s!\n",yyFileName); - while (!tableStack.isEmpty()) - { - endTable(); - } -} - -//----------------------------------------------------------------------------- - -static void includeFile(OutputDocInterface &od,const char *fileName,bool quiet) -{ - bool ambig; - FileDef *fd; - if ((fd=findFileDef(Doxygen::exampleNameDict,fileName,ambig))) - { - currentIncludeFile=fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")); - includeFileOffset=0; - includeFileLength=currentIncludeFile.length(); - OutputDocInterface *codeFrag = od.clone(); - parseCode(*codeFrag,0,currentIncludeFile,exampleDoc,exampleName); - if (!quiet) - { - od.startCodeFragment(); - od.append(codeFrag); - od.endCodeFragment(); - } - delete codeFrag; - } - else if (ambig) - { - QCString text; - text.sprintf("Include file name %s is ambigious.\n",fileName); - text+="Possible candidates:\n"; - text+=showFileDefMatches(Doxygen::exampleNameDict,fileName); - warn(yyFileName,yyLineNr,text); - } - else - { - warn(yyFileName,yyLineNr, - "Warning: example file %s is not found. " - "Check your EXAMPLE_PATH",fileName - ); - } -} - -static void verbIncludeFile(OutputDocInterface &od,const char *name) -{ - bool ambig; - FileDef *fd; - if ((fd=findFileDef(Doxygen::exampleNameDict,name,ambig))) - { - od.startCodeFragment(); - od.codify(fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES"))+"\n"); - od.endCodeFragment(); - } - else if (ambig) - { - QCString text; - text.sprintf("Include file name %s is ambigious.\n",name); - text+=("Possible candidates:\n"); - text+=showFileDefMatches(Doxygen::exampleNameDict,name); - warn(yyFileName,yyLineNr,text); - } - else - { - warn(yyFileName,yyLineNr, - "Warning: example file %s is not found. " - "Check your EXAMPLE_PATH",name); - } -} - -static void rawIncludeFile(OutputDocInterface &od,const char *name) -{ - bool ambig; - FileDef *fd; - if ((fd=findFileDef(Doxygen::exampleNameDict,name,ambig))) - { - od.writeString(fileToString(fd->absFilePath())); - } - else if (ambig) - { - QCString text; - text.sprintf("Include file name %s is ambigious.\n",name); - text+=("Possible candidates:\n"); - text+=showFileDefMatches(Doxygen::exampleNameDict,name); - warn(yyFileName,yyLineNr,text); - } - else - { - warn(yyFileName,yyLineNr, - "Warning: include file %s is not found. " - "Check your EXAMPLE_PATH",name); - } -} - - - -static QCString stripQuotes(const char *s) -{ - QCString name; - if (s==0 || *s==0) return name; - name=s; - if (name.at(0)=='"' && name.at(name.length()-1)=='"') - { - name=name.mid(1,name.length()-2); - } - return name; -} - -static QCString stripKnownExtensions(const char *text) -{ - QCString result=text; - if (result.right(4)==".tex") result=result.left(result.length()-4); - else if (result.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension) - { - result=result.left(result.length()-Doxygen::htmlFileExtension.length()); - } - //printf("%s stripKnowExtensions(%s)\n",result.data(),text); - return result; -} - -static void skipLine(OutputDocInterface &od,const char *key) -{ - bool found=FALSE; - while (!found) - { - QCString s; - char c; - while ( includeFileOffset<includeFileLength && - (c=currentIncludeFile[includeFileOffset++])!='\n' && c!=0 - ) s+=c; - if (s.find(key)!=-1) - { - found=TRUE; - od.writeString(" "); - parseCode(od,className,s,exampleDoc,exampleName); - //od.writeString("\n"); - } - else if (includeFileOffset==includeFileLength) found=TRUE; - } -} - -static void skipUntil(const char *key) -{ - bool found=FALSE; - while (!found) - { - QCString s; - int i=includeFileOffset; - char c; - while ( i<includeFileLength && - (c=currentIncludeFile[i++])!='\n' && c!=0 - ) s+=c; - if (s.find(key)!=-1 || i==includeFileLength) - { - found=TRUE; - } - else - { - includeFileOffset=i; - } - } -} - -static void showLine(OutputDocInterface &od,const char *key) -{ - QCString s; - char c; - bool found=FALSE; - while (!found) - { - while ( includeFileOffset<includeFileLength && - (c=currentIncludeFile[includeFileOffset++])!='\n' && c!=0 - ) s+=c; - if (!s.stripWhiteSpace().isEmpty() || - includeFileOffset==includeFileLength) found=TRUE; - } - if (s.find(key)!=-1) - { - od.writeString(" "); - parseCode(od,className,s,exampleDoc,exampleName); - //od.writeString("\n"); - } -} - -static void showUntil(OutputDocInterface &od,const char *key) -{ - bool found=FALSE; - while (!found) - { - QCString s; - char c; - while ( includeFileOffset<includeFileLength && - (c=currentIncludeFile[includeFileOffset++])!='\n' && c!=0 - ) s+=c; - if (!s.stripWhiteSpace().isEmpty()) - { - od.writeString(" "); - parseCode(od,className,s,exampleDoc,exampleName); - //od.writeString("\n"); - if (s.find(key)!=-1) found=TRUE; - } - if (includeFileOffset==includeFileLength) found=TRUE; - } -} - -//----------------------------------------------------------------- - -static bool inBlock() -{ - return inParamBlock || inRetValBlock || inSeeBlock || inReturnBlock || inAuthorBlock || - inVersionBlock || inSinceBlock || inDateBlock || inWarningBlock || inRemarkBlock || - inAttentionBlock || inBugBlock || inNoteBlock || - inParBlock || inExceptionBlock || inDeprecatedBlock || inPreBlock || - inPostBlock || inInvarBlock; -} - -static void endBlock() -{ - if (inParamBlock || inRetValBlock || inExceptionBlock) - { - outDoc->endDescTableData(); - outDoc->endDescTable(); - outDoc->endParamList(); - } - else - { - outDoc->endSimpleSect(); - } - currentListIndent.pop(); - inParamBlock=inRetValBlock=inSeeBlock=inReturnBlock=inAuthorBlock= - inVersionBlock=inSinceBlock=inDateBlock=inBugBlock=inNoteBlock=inWarningBlock= - inParBlock=inExceptionBlock=inDeprecatedBlock=inPreBlock=inPostBlock= - inInvarBlock=inRemarkBlock=inAttentionBlock=FALSE; -} - -//----------------------------------------------------------------- - -struct IndentInfo -{ - public: - IndentInfo(int i,bool e) : indent(i), enumerated(e) {}; - ~IndentInfo() {} - void startList() - { - if (enumerated) outDoc->startEnumList(); else outDoc->startItemList(); - } - void endList() - { - if (enumerated) outDoc->endEnumList(); else outDoc->endItemList(); - } - void writeItem() - { - outDoc->writeListItem(); - } - int indent; - bool enumerated; -}; - -static QStack<IndentInfo> listIndentStack; // indent stack of - items - -static int computeIndent(const char *str,int length) -{ - int i; - int indent=0; - int tabSize=Config_getInt("TAB_SIZE"); - for (i=0;i<length;i++) - { - //printf("Parsed[%d]=%d\n",i,marker[i]); - if (str[i]=='\t') - { - indent+=tabSize - (indent%tabSize); - } - else if (str[i]=='\n') - { - indent=0; - } - else - { - indent++; - } - } - return indent; -} - -static void addListItemMarker(const char *marker,int dashPos,bool enumerated) -{ - // find the actual position at which the bullet was found - int indent=computeIndent(marker,dashPos); - //printf("list marker found at column %d enumerated %d\n",indent,enumerated); - if (!insideItemList) - { - //printf("startListMarker indent=%d\n",indent); - currentListIndent.push(enumerated ? "O" : "U"); - listIndentStack.push(new IndentInfo(indent,enumerated)); - listIndentStack.top()->startList(); - listIndentStack.top()->writeItem(); - insideItemList=TRUE; - } - else - { - IndentInfo *pPrevInfo = listIndentStack.top(); - if (pPrevInfo->indent==indent && pPrevInfo->enumerated==enumerated) - // new item of same kind at the same indent level - { - pPrevInfo->writeItem(); - } - else if (pPrevInfo->indent==indent) - // new item of diffent kind at the same indent level - { - // switch to a diffent list type - pPrevInfo->endList(); - pPrevInfo->enumerated=enumerated; - pPrevInfo->startList(); - pPrevInfo->writeItem(); - } - else if (pPrevInfo->indent<indent) // start sub item list - { - //printf("startListMarker indent=%d\n",indent); - currentListIndent.push(enumerated ? "O" : "U"); - listIndentStack.push(new IndentInfo(indent,enumerated)); - listIndentStack.top()->startList(); - listIndentStack.top()->writeItem(); - } - else // end sub item list - { - while (pPrevInfo && pPrevInfo->indent>indent) - { - pPrevInfo->endList(); - listIndentStack.pop(); - currentListIndent.pop(); - delete pPrevInfo; - pPrevInfo = listIndentStack.top(); - } - // safe guard against wrong indenting - if (listIndentStack.isEmpty()) - { - insideItemList=FALSE; - warn(yyFileName,yyLineNr, - "Warning: list item with invalid indent found!"); - } - else - { - listIndentStack.top()->writeItem(); - } - } - } -} - -static void endListMarker(const char *marker,int dotPos) -{ - int indent=computeIndent(marker,dotPos); - //printf("endListMarker indent=%d " - // "insideItemList=%d listIndentStack.count()=%d\n", - // indent,insideItemList,listIndentStack.count()); - if (insideItemList && !listIndentStack.isEmpty()) - { - IndentInfo *ii = listIndentStack.top(); - while (ii && indent<=ii->indent) - { - ii->endList(); - listIndentStack.pop(); - currentListIndent.pop(); - delete ii; - ii = listIndentStack.top(); - //printf("ending list new indent=%d\n",ii ? ii->indent : -1); - } - if (listIndentStack.isEmpty()) - { - insideItemList=FALSE; - //printf("ending last list\n"); - } - } -} - -// end the current (nested) list regardless of the nesting level. -static void forceEndItemList() -{ - IndentInfo *info; - while ((info=listIndentStack.pop())!=0) - { - delete info; - } - while (!currentListIndent.isEmpty()) - { - char c=*currentListIndent.pop(); - switch(c) - { - case 'O': outDoc->endEnumList(); break; - case 'U': outDoc->endItemList(); break; - case 'D': outDoc->endDescription(); break; - case 'P': if (inBlock()) endBlock(); break; - default: - err("Unexpected list indent token `%c'\n",c); - } - } - insideItemList=FALSE; -} - -static void endArgumentList() -{ - if (insideArgumentList) - { - insideArgumentList=FALSE; - outDoc->endItemList(); - } -} - -//----------------------------------------------------------------- - -enum ImageTypes -{ - IT_Html, - IT_Latex, - IT_RTF -}; - -/*! search for an image in the imageNameDict and if found - * copies the image to the output directory (which is the - * html directory if type==0 or the latex directory if type==1) - */ -static QCString findAndCopyImage(const char *fileName,ImageTypes type) -{ - QCString result; - bool ambig; - FileDef *fd; - //printf("Search for %s\n",fileName); - if ((fd=findFileDef(Doxygen::imageNameDict,fileName,ambig))) - { - QFile inImage(QString(fd->absFilePath().data())); - if (inImage.open(IO_ReadOnly)) - { - result = fileName; - int i; - if ((i=result.findRev('/'))!=-1 || (i=result.findRev('\\'))!=-1) - { - result.right(result.length()-i-1); - } - QCString outputDir; - switch(type) - { - case IT_Html: - if (!Config_getBool("GENERATE_HTML")) return result; - outputDir = Config_getString("HTML_OUTPUT"); - break; - case IT_Latex: - if (!Config_getBool("GENERATE_LATEX")) return result; - outputDir = Config_getString("LATEX_OUTPUT"); - break; - case IT_RTF: - if (!Config_getBool("GENERATE_RTF")) return result; - outputDir = Config_getString("RTF_OUTPUT"); - break; - } - QCString outputFile = outputDir+"/"+result; - QFile outImage(QString(outputFile.data())); - if (outImage.open(IO_WriteOnly)) // copy the image - { - char *buffer = new char[inImage.size()]; - inImage.readBlock(buffer,inImage.size()); - outImage.writeBlock(buffer,inImage.size()); - outImage.flush(); - delete buffer; - } - else - { - warn(yyFileName,yyLineNr, - "Warning: could not write output image %s",outputFile.data()); - } - } - else - { - warn(yyFileName,yyLineNr, - "Warning: could not open image %s",fileName); - } - - if (type==IT_Latex && Config_getBool("USE_PDFLATEX") && - fd->name().right(4)==".eps" - ) - { // we have an .eps image in pdflatex mode => convert it to a pdf. - QCString outputDir = Config_getString("LATEX_OUTPUT"); - QCString baseName = fd->name().left(fd->name().length()-4); - QCString epstopdfArgs(4096); - epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"", - outputDir.data(), baseName.data(), - outputDir.data(), baseName.data()); - if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) - { - err("Error: Problems running epstopdf. Check your TeX installation!\n"); - } - return baseName; - } - } - else if (ambig) - { - QCString text; - text.sprintf("Warning: image file name %s is ambigious.\n",fileName); - text+="Possible candidates:\n"; - text+=showFileDefMatches(Doxygen::imageNameDict,fileName); - warn(yyFileName,yyLineNr,text); - } - else - { - result=fileName; - if (result.left(5)!="http:" && result.left(6)!="https:") - { - warn(yyFileName,yyLineNr, - "Warning: image file %s is not found in IMAGE_PATH: " - "assuming external image.",fileName - ); - } - } - return result; -} - - -void writeImage(ImageTypes it,const char *size) -{ - bool hasCaption=!curImageCaption.isEmpty(); - outDoc->pushGeneratorState(); - switch(it) - { - case IT_Latex: - { - outDoc->disableAllBut(OutputGenerator::Latex); - outDoc->startImage(curImageName,size,hasCaption); - if (hasCaption) - { - scanString(curImageCaption); - } - outDoc->endImage(hasCaption); - } - break; - case IT_Html: - { - outDoc->disableAllBut(OutputGenerator::Html); - outDoc->startImage(curImageName,0,hasCaption); - if (hasCaption) - { - scanString(curImageCaption); - } - outDoc->endImage(hasCaption); - } - break; - case IT_RTF: - { - outDoc->disableAllBut(OutputGenerator::RTF); - outDoc->startImage(curImageName,0,hasCaption); - if (hasCaption) - { - scanString(curImageCaption); - } - outDoc->endImage(hasCaption); - } - } - outDoc->popGeneratorState(); -} - -// search for a dot file in the dotFileNameDict, and if found -// generates the graph in the output directories. -static void writeDotFile(const char *fileName, const char *captionText) -{ - bool ambig; - FileDef *fd; - bool hasCaption = captionText!=0; - - if ((fd=findFileDef(Doxygen::dotFileNameDict,fileName,ambig))) - { - outDoc->startDotFile(fd->absFilePath(),hasCaption); - if (hasCaption) - { - scanString(captionText); - } - outDoc->endDotFile(hasCaption); - } - else if (ambig) - { - QCString text; - text.sprintf("Warning: dot file name %s is ambigious.\n",fileName); - text+="Possible candidates:\n"; - text+=showFileDefMatches(Doxygen::dotFileNameDict,fileName); - warn(yyFileName,yyLineNr,text); - } - else - { - warn(yyFileName,yyLineNr, - "Warning: dot file %s is not found in DOTFILE_DIRS! ",fileName - ); - } -} - -/* ----------------------------------------------------------------- */ - -static void checkArgName(const QCString &name,bool isParam) -{ - hasParamCommand=TRUE; - if (memberDef==0) return; // not a member - ArgumentList *al=memberDef->isDocsForDefinition() ? - memberDef->argumentList() : - memberDef->declArgumentList(); - if (al==0) return; // no argument list - if (!Config_getBool("WARN_IF_UNDOCUMENTED")) return; - - //printf("name=%s\n",name.data()); - static QRegExp re("[a-zA-Z0-9_]+\\.*"); - int p=0,i=0,l; - while ((i=re.match(name,p,&l))!=-1) - { - QCString aName=name.mid(i,l); - //printf("aName=%s\n",aName.data()); - ArgumentListIterator ali(*al); - Argument *a; - bool found=FALSE; - for (ali.toFirst();(a=ali.current());++ali) - { - QCString argName = memberDef->isDefine() ? a->type : a->name; - if (argName.right(3)=="...") argName=argName.left(argName.length()-3); - if (aName==argName) - { - //printf("adding `%s'\n",aName.data()); - paramsFound.insert(aName,(void *)(0x8)); - found=TRUE; - break; - } - } - if (!found && isParam) - { - //printf("member type=%d\n",memberDef->memberType()); - QCString scope=memberDef->getScopeString(); - if (!scope.isEmpty()) scope+="::"; else scope=""; - warn(memberDef->docFile(),memberDef->docLine(), - "Warning: argument `%s' of command @param " - "is not found in the argument list of %s%s%s", - aName.data(),scope.data(),memberDef->name().data(), - argListToString(al).data() - ); - } - p=i+l; - } -} - -/* ----------------------------------------------------------------- */ - -/*! Looks for a documentation block with name commandName in the current - * context (copyDocScope). The resulting documentation string is - * put in pDoc, the definition in which the documentation was found is - * put in pDef. - * @retval TRUE if name was found. - * @retval FALSE if name was not found. - */ -static bool findDocsForMemberOrCompound(const char *commandName, - QCString *pDoc, - Definition **pDef) -{ - pDoc->resize(0); - *pDef=0; - QCString cmdArg=commandName; - int l=cmdArg.length(); - if (l==0) return FALSE; - - int funcStart=cmdArg.find('('); - if (funcStart==-1) funcStart=l; - //int lastScopeStart=cmdArg.findRev("::",funcStart); - //int lastScopeEnd = lastScopeStart==-1 ? 0 : lastScopeStart+2; - //QCString scope=cmdArg.left(QMAX(lastScopeStart,0)); - //QCString name=cmdArg.mid(lastScopeEnd,funcStart-lastScopeEnd); - QCString name=cmdArg.left(funcStart); - QCString args=cmdArg.right(l-funcStart); - - // try if the link is to a member - MemberDef *md=0; - ClassDef *cd=0; - FileDef *fd=0; - NamespaceDef *nd=0; - GroupDef *gd=0; - PageInfo *pi=0; - bool found = getDefs(copyDocScope,name,args,md,cd,fd,nd,gd,FALSE,0,TRUE); - if (found && md) - { - *pDoc=md->documentation(); - *pDef=md; - return TRUE; - } - - - int scopeOffset=copyDocScope.length(); - do // for each scope - { - QCString fullName=cmdArg; - if (scopeOffset>0) - { - fullName.prepend(copyDocScope.left(scopeOffset)+"::"); - } - //printf("Trying fullName=`%s'\n",fullName.data()); - - // try class, namespace, group, page, file reference - cd = Doxygen::classSDict[fullName]; - if (cd) // class - { - *pDoc=cd->documentation(); - *pDef=cd; - return TRUE; - } - nd = Doxygen::namespaceSDict[fullName]; - if (nd) // namespace - { - *pDoc=nd->documentation(); - *pDef=nd; - return TRUE; - } - gd = Doxygen::groupSDict[cmdArg]; - if (gd) // group - { - *pDoc=gd->documentation(); - *pDef=gd; - return TRUE; - } - pi = Doxygen::pageSDict->find(cmdArg); - if (pi) // page - { - *pDoc=pi->doc; - *pDef=(Definition *)pi; - return TRUE; - } - bool ambig; - fd = findFileDef(Doxygen::inputNameDict,cmdArg,ambig); - if (fd && !ambig) // file - { - *pDoc=fd->documentation(); - *pDef=fd; - return TRUE; - } - - if (scopeOffset==0) - { - scopeOffset=-1; - } - else - { - scopeOffset = copyDocScope.findRev("::",scopeOffset-1); - if (scopeOffset==-1) scopeOffset=0; - } - } while (scopeOffset>=0); - - - return FALSE; -} - -/* ----------------------------------------------------------------- */ - -static void writeSpecialItem(const char *commandString) -{ - QCString cmd = commandString; // format "\test 20" or "\todo 4" - int sepPos=cmd.find(' '); - QCString listName = cmd.mid(1,cmd.length()-sepPos-1); // i.e. "test" or "todo" - RefList *refList = Doxygen::specialLists->find(cmd.mid(1,sepPos-1)); - ASSERT(refList!=0); - if (Config_getBool(refList->optionName())) - { - QCString numStr=cmd.right(cmd.length()-sepPos-1); // i.e. "20" or "4" - bool ok; int num = numStr.toUInt(&ok); - RefItem *item = refList->getRefItem(num); - ASSERT(item!=0); - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (inBlock()) endBlock(); - currentListIndent.push("P"); - outDoc->startSimpleSect(refList->sectionType(), - refList->listName(), - item->listAnchor, - refList->sectionTitle()+": " - ); - outDoc->writeDescItem(); - internalParseDocument(item->text); - outDoc->endSimpleSect(); - currentListIndent.pop(); - } -} - -/* ----------------------------------------------------------------- */ -#undef YY_INPUT -#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); - -static int yyread(char *buf,int max_size) -{ - int c=0; - while ( c < max_size && inputString[inputPosition] ) - { - *buf = inputString[inputPosition++] ; - //printf("%d (%c)\n",*buf,*buf); - c++; buf++; - } - return c; -} - - //LINKMASK [a-z_A-Z0-9:#.,~&*/\[\]<>()\-\+]+({B}*("const"|"volatile"))? - //ATTR ((({BN}+[^\>]+)/">")?) -%} - -CMD ("\\"|"@") -BN [ \t\n\r] -BL [ \t\r]*"\n" -BSEP [ \t\r]*([ \t\r]|"\n")({BL}{0,100}) -B [ \t] -BS ^(({B}*"//")?)(({B}*"*"+)?){B}* -FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+] -FILEECHAR [a-z_A-Z0-9\-\+] -FILEMASK {FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)+ -FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]+"\"") -ID [a-z_A-Z][a-z_A-Z0-9]* -SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) -SCOPEMASK {ID}?(("::"|"#")?(~)?{ID})+ -URLCHAR [a-z_A-Z0-9\!\~\:\;\'\$\?\@\&\%\#\.\-\+\/\=] -URLMASK (([a-z_A-Z][^\>\"\n]*{URLCHAR})|({URLCHAR}+))([({]{URLCHAR}*[)}])? -NONTERM [\{\}\[\]\`\~\@\|\-\+\#\$\/\\\!\%\^\&\*()a-z_A-Z<>0-9\x80-\xff] -WORD ({NONTERM}+([^\n\t ]*{NONTERM}+)?)|("\""[^\n\"]*"\"") -ATTR ({B}+[^>\n]*)? -A [aA] -BOLD [bB] -BODY [bB][oO][dD][yY] -BR [bB][rR] -EM [eE][mM] -CENTER [cC][eE][nN][tT][eE][rR] -CODE [cC][oO][dD][eE] -DL [dD][lL] -DD [dD][dD] -DT [dD][tT] -DFN [dD][fF][nN] -FORM [fF][oO][rR][mM] -H1 [hH]1 -H2 [hH]2 -H3 [hH][3-6] -HEAD [hH][eE][aA][dD] -HR [hH][rR] -HREF [hH][rR][eE][fF] -I [iI] -IMG [iI][mM][gG] -INPUT [iI][nN][pP][uU][tT] -KBD [kK][bB][dD] -LI [lL][iI] -META [mM][eE][tT][aA] -MULTICOL [mM][uU][lL][tT][iI][cC][oO][lL] -NAME [nN][aA][mM][eE] -OL [oO][lL] -P [pP] -PRE [pP][rR][eE] -SMALL [sS][mM][aA][lL][lL] -STRONG [sS][tT][rR][oO][nN][gG] -SUB [sS][uU][bB] -SUP [sS][uU][pP] -SRC [sS][rR][cC] -TABLE [tT][aA][bB][lL][eE] -CAPTION [cC][aA][pP][tT][iI][oO][nN] -TITLE [tT][iI][tT][lL][eE] -TD [tT][dD] -TR [tT][rR] -TT [tT][tT] -UL [uU][lL] -VAR [vV][aA][rR] -BLOCKQUOTE [bB][lL][oO][cC][kK][qQ][uU][oO][tT][eE] -DOCPARAM ("#")?([a-z_A-Z0-9:\!\<\~\>\^\&\=\.\-]+)|("\"".*"\"") -OPNEW {B}+"new"({B}*"[]")? -OPDEL {B}+"delete"({B}*"[]")? -OPARG "("[a-z_A-Z0-9,\<\> \t\*\&]*")" -OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" -OPCAST {B}+[^(\r\n.,]+ -OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) -LINKMASK [^ \t\n\r\\@<&$]+("("[^\n)]*")")?({B}*("const"|"volatile"))? - -%option noyywrap - -%x Text -%x DocScan -%x DocParam -%x DocException -%x DocHtmlScan -%x DocLatexScan -%x DocEmphasis -%x DocBold -%x DocCode -%x DocCodeBlock -%x DocInternal -%x DocLink -%x DocJavaLink -%x DocLinkText -%x DocJavaLinkText -%x DocSkipWord -%x DocInclude -%x DocDontInclude -%x DocHtmlLink -%x DocHtmlAnchor -%x DocHtmlHref -%x DocSkiplineKey -%x DocSkipKey -%x DocLineKey -%x DocUntilKey -%x DocKeyEnd -%x DocPar -%x DocRefName -%x DocVerbatim -%x DocVerbInc -%x DocHtmlInc -%x DocIndexWord -%x DocRefArg -%x DocRefArgStart -%x DocRefItem -%x DocRefItemName -%x DocInternalRef -%x DocInternalRefText -%x DocImage -%x DocCaption -%x DocHtmlImageName -%x DocHtmlImageOpt -%x DocLatexImageName -%x DocLatexImageOpt -%x DocRtfImageName -%x DocRtfImageOpt -%x DocDotFile -%x DocDotFileOpt -%x DocSkipLanguage -%x DocCopyFind -%x DocCopyArg -%x DocCopySkipVerb - -%% - -<*>\x0d -<DocScan>^{B}*(("//"{B}*)?)"*"*{B}*"-"("#")?{B}+ { /* found list item marker */ - QCString text=yytext; - int dashPos = text.findRev('-'); - //printf("dashPos=%d char='%c'\n",dashPos,text.at(dashPos+1)); - bool isEnumerated = text.at(dashPos+1)=='#'; - addListItemMarker(yytext,dashPos+1,isEnumerated); - } -<DocScan>^{B}*(("//"{B}*)?)"*"*{B}*"."{B}*/\n { /* found end list marker */ - QCString text=yytext; - int dotPos = text.findRev('.'); - endListMarker(yytext,dotPos+1); - } -<DocScan>\n{B}*(("//"{B}*)?)"*"*{B}*"-"("#")?{B}+ { /* found list item marker */ - QCString text=yytext; - int dashPos = text.findRev('-'); - //printf("dashPos=%d char='%c'\n",dashPos,text.at(dashPos+1)); - bool isEnumerated = text.at(dashPos+1)=='#'; - addListItemMarker(yytext+1,dashPos,isEnumerated); - } -<DocScan>\n{B}*(("//"{B}*)?)"*"*{B}*"."{B}*/\n { /* found end list marker */ - QCString text=yytext; - int dotPos = text.findRev('.'); - endListMarker(yytext+1,dotPos); - } -<DocScan,Text>"©" { outDoc->writeCopyright(); } -<DocScan,Text>"<" { outDoc->docify("<"); } -<DocScan,Text>">" { outDoc->docify(">"); } -<DocScan,Text>"&" { outDoc->docify("&"); } -<DocScan,Text>"'" { outDoc->docify("'"); } -<DocScan,Text>""" { outDoc->docify("\""); } -<DocScan,Text>"&"[AEIOUYaeiouy]"uml;" { outDoc->writeUmlaut(yytext[1]); } -<DocScan,Text>"&"[AEIOUYaeiouy]"acute;" { outDoc->writeAcute(yytext[1]); } -<DocScan,Text>"&"[AEIOUaeiou]"grave;" { outDoc->writeGrave(yytext[1]); } -<DocScan,Text>"&"[AEIOUaeiou]"circ;" { outDoc->writeCirc(yytext[1]); } -<DocScan,Text>"&"[ANOano]"tilde;" { outDoc->writeTilde(yytext[1]); } -<DocScan,Text>"ß" { outDoc->writeSharpS(); } -<DocScan,Text>"&"[cC]"cedil;" { outDoc->writeCCedil(yytext[1]); } -<DocScan,Text>"&"[aA]"ring;" { outDoc->writeRing(yytext[1]); } -<DocScan,Text>" " { outDoc->writeNonBreakableSpace(1); } -<DocScan,DocHtmlScan,DocLatexScan>"$("[a-z_A-Z]+")" { - QCString envvar=&yytext[2]; - envvar=envvar.left(envvar.length()-1); - outDoc->docify(getenv(envvar)); - } -<DocScan>{CMD}"htmlonly"/[^a-z_A-Z0-9] { - outDoc->startHtmlOnly(); - outDoc->pushGeneratorState(); - outDoc->disableAllBut(OutputGenerator::Html); - BEGIN(DocHtmlScan); - } -<DocHtmlScan>{CMD}"endhtmlonly"/[^a-z_A-Z0-9] { - outDoc->popGeneratorState(); - outDoc->endHtmlOnly(); - BEGIN(DocScan); - } -<DocScan>{CMD}"latexonly"/[^a-z_A-Z0-9] { - outDoc->startLatexOnly(); - outDoc->pushGeneratorState(); - outDoc->disableAllBut(OutputGenerator::Latex); - BEGIN(DocLatexScan); - } -<DocLatexScan>{CMD}"endlatexonly"/[^a-z_A-Z0-9] { - outDoc->popGeneratorState(); - outDoc->endLatexOnly(); - BEGIN(DocScan); - } -<DocHtmlScan,DocLatexScan>"//"|"/*"|"*/" { - outDoc->writeString(yytext); - } -<DocHtmlScan,DocLatexScan>.|\n { - outDoc->writeString(yytext); - } -<DocScan>"\\postheader"/{BN} -<DocScan>"\\functionindex"/{BN} { /* writeMemberList(*outDoc,FALSE);*/ } -<DocScan>"\\classhierarchy"/{BN} { /* writeClassHierarchy(*outDoc); */ } -<DocScan>"\\annotatedclasslist"/{BN} { /* writeAnnotatedClassList(*outDoc); */ } -<DocScan>"\\headerfilelist"/{BN} { /* writeHeaderFileList(*outDoc); */ } -<DocScan>"\\header"/{BN} { BEGIN( DocSkipWord ); } -<DocScan>"\\define"/{BN} { BEGIN( DocSkipWord ); } -<DocScan>{CMD}"verbinclude"/{BN} { BEGIN( DocVerbInc ); } -<DocVerbInc>{FILE} { - verbIncludeFile(*outDoc,stripQuotes(yytext)); - BEGIN( DocScan ); - } -<DocScan>{CMD}"htmlinclude"/{BN} { BEGIN( DocHtmlInc ); } -<DocHtmlInc>{FILE} { - outDoc->pushGeneratorState(); - outDoc->disableAllBut(OutputGenerator::Html); - rawIncludeFile(*outDoc,stripQuotes(yytext)); - outDoc->popGeneratorState(); - BEGIN( DocScan ); - } -<DocScan>{CMD}"verbatim"/[^a-z_A-Z0-9] { - outDoc->startVerbatimFragment(); - insideVerbatim=TRUE; - BEGIN(DocVerbatim); - } -<DocVerbatim>{CMD}"endverbatim"/[^a-z_A-Z0-9] { - outDoc->endVerbatimFragment(); - insideVerbatim=FALSE; - BEGIN(DocScan); - } -<DocVerbatim>[^\n\\\@]*"\n" { - //printf("docifying: %s\n",yytext); - outDoc->codify(yytext); - } -<DocVerbatim>"\n"|"//"|"/*"|"*/" { - outDoc->codify(yytext); - } -<DocVerbatim>. { - //printf("char %c\n",*yytext); - char c[2];c[0]=*yytext;c[1]='\0'; - outDoc->codify(c); - } -<DocScan>{CMD}"~"[a-z_A-Z0-9]*/{BN} { - if (yytext[2]) - { - if (theTranslator->idLanguage()!=&yytext[2]) // not current language - { - BEGIN(DocSkipLanguage); - } - } - } -<DocSkipLanguage>{CMD}"~"[a-z_A-Z0-9]*/{BN} { - if (yytext[2]) - { - if (theTranslator->idLanguage()==&yytext[2]) - { - BEGIN( DocScan ); // current language => include - } - } - else // back to "all language" processing. - { - BEGIN( DocScan ); - } - } -<DocSkipLanguage>[^\\\@\~\n]+ -<DocScan>{CMD}"internal"/{BN} { - outDoc->newParagraph(); - outDoc->startBold(); - scanString(theTranslator->trForInternalUseOnly()+"\n"); - outDoc->endBold(); - outDoc->newParagraph(); - } -<DocScan>"\\reimp"/{BN} { - outDoc->newParagraph(); - scanString(theTranslator->trReimplementedForInternalReasons()+"\n"); - } -<DocScan>{CMD}"link"/{BN} { BEGIN( DocLink ); } -<DocScan>"{"{CMD}"link"{BN}+ { BEGIN( DocJavaLink ); } -<DocSkipWord>[a-z_A-Z0-9.:()]+ { BEGIN( DocScan ); } -<DocLink>{LINKMASK} { // TODO: support operators as well! - linkRef = stripKnownExtensions(yytext); - linkText = ""; - BEGIN( DocLinkText ); - } -<DocJavaLink>{LINKMASK} { // TODO: support operators as well! - linkRef = yytext; - linkText = ""; - BEGIN( DocJavaLinkText ); - } -<DocJavaLinkText>"}" { - //printf("Trying to link `%s'\n",linkRef.data()); - if (!generateLink(*outDoc,className,linkRef,inSeeBlock,linkText.stripWhiteSpace())) - { - warn(yyFileName,yyLineNr,"Warning: link to unknown entity `%s' in the documentation of this entity!",linkRef.data()); - } - BEGIN( DocScan ); - } -<DocJavaLinkText,DocLinkText>. { linkText += *yytext; } -<DocJavaLinkText,DocLinkText>"\n" { linkText += " "; } -<DocLink,DocLinkText>{CMD}"endlink" { // <- needed for things like \endlink. - //printf("GenerateLink className=`%s' linkRef=`%s' linkText=`%s'\n", - // className.data(),linkRef.data(),linkText.data()); - if (!generateLink(*outDoc,className,linkRef,inSeeBlock,linkText.stripWhiteSpace())) - { - warn(yyFileName,yyLineNr,"Warning: link to unknown entity `%s' in the documentation of this entity!",linkRef.data()); - } - BEGIN( DocScan ); - } -<DocScan>{CMD}"endlink"/[^a-z_A-Z0-9] { warn(yyFileName,yyLineNr, - "Warning: \\endlink without \\link " - "in documentation of this entity." - ); - } -<DocScan>{CMD}"addindex"{B}+ { - addIndexWord.resize(0); - BEGIN(DocIndexWord); - } -<DocScan>"\\form#"[0-9]+ { - Formula *formula=Doxygen::formulaNameDict[yytext]; - if (formula) - { - QCString formName; - formName.sprintf("form_%d",formula->getId()); - outDoc->writeFormula(formName,formula->getFormulaText()); - } - } -<DocIndexWord>"\\&" { addIndexWord+='&'; } -<DocIndexWord>"\\>" { addIndexWord+='>'; } -<DocIndexWord>"\\<" { addIndexWord+='<'; } -<DocIndexWord>"\\@" { addIndexWord+='@'; } -<DocIndexWord>"\\$" { addIndexWord+='$'; } -<DocIndexWord>"\\#" { addIndexWord+='#'; } -<DocIndexWord>"\\\\" { addIndexWord+='\\'; } -<DocIndexWord>. { addIndexWord+=*yytext; } -<DocIndexWord>\n { - //printf("Adding %s to index\n",yytext); - outDoc->addIndexItem(addIndexWord,0); - BEGIN(DocScan); - } -<DocScan>{CMD}("arg"|"li")/{BN} { - if (insideItemList) - { - forceEndItemList(); - } - if (insideArgumentList) - { - outDoc->writeListItem(); - } - else - { - outDoc->startItemList(); - outDoc->writeListItem(); - insideArgumentList=TRUE; - } - } -<DocScan>(({B}*"\n"){2,}{B}*)?{CMD}"par"{B}* { - QCString t=yytext; - if (/*t.contains('\n')>1 &&*/ insideItemList) - { - forceEndItemList(); - } - BEGIN(DocPar); - } -<DocPar>[^\n]*{BSEP} { - QCString title=QCString(yytext).stripWhiteSpace(); - bool b = inBlock(); - if (!title.isEmpty()) - { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (b) endBlock(); - inParBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Par,0,0,title); - outDoc->writeDescItem(); - } - else - { - outDoc->newParagraph(); - } - BEGIN(DocScan); - } -<DocScan>{CMD}"warning"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inWarningBlock) - { - if (inBlock()) endBlock(); - inWarningBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Warning,0,0,theTranslator->trWarning()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"remark"[s]?{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inRemarkBlock) - { - if (inBlock()) endBlock(); - inRemarkBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Remark,0,0,theTranslator->trRemarks()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"attention"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inAttentionBlock) - { - if (inBlock()) endBlock(); - inAttentionBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Attention,0,0,theTranslator->trAttention()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"note"[s]?{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inNoteBlock) - { - if (inBlock()) endBlock(); - inNoteBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Note,0,0,theTranslator->trNote()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"pre"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inPreBlock) - { - if (inBlock()) endBlock(); - inPreBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Pre,0,0,theTranslator->trPrecondition()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"post"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inPostBlock) - { - if (inBlock()) endBlock(); - inPostBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Post,0,0,theTranslator->trPostcondition()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"invariant"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inInvarBlock) - { - if (inBlock()) endBlock(); - inInvarBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Invar,0,0,theTranslator->trInvariant()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"version"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inVersionBlock) - { - if (inBlock()) endBlock(); - inVersionBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Version,0,0,theTranslator->trVersion()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"since"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inSinceBlock) - { - if (inBlock()) endBlock(); - inSinceBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Since,0,0,theTranslator->trSince()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}"date"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inDateBlock) - { - if (inBlock()) endBlock(); - inDateBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Date,0,0,theTranslator->trDate()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } -<DocScan>"\\todo "[0-9]+ | /* generated labels */ -<DocScan>"\\test "[0-9]+ | -<DocScan>"\\bug "[0-9]+ | -<DocScan>"\\deprecated "[0-9]+ { - writeSpecialItem(yytext); - } - /* -<DocScan>{CMD}"deprecated"{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inDeprecatedBlock) - { - if (inBlock()) endBlock(); - inDeprecatedBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Deprecated,0,0,theTranslator->trDeprecated()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->writeDescItem(); - } - } - */ -<DocScan>"$"[a-zA-Z_0-9]+":"[^\n\$]+"$" { // RCS tag - QCString tagName(&yytext[1]); - int i=tagName.find(':'); - tagName=tagName.left(i); - QCString tagText=&yytext[i+2]; - tagText=tagText.left(tagText.length()-1); - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (inBlock()) endBlock(); - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::RCS,0,0,tagName+": "); - outDoc->writeDescItem(); - scanString(tagText); - outDoc->endSimpleSect(); - currentListIndent.pop(); - } -<DocScan>{CMD}"author"[s]?{BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inAuthorBlock) - { - if (inBlock()) endBlock(); - inAuthorBlock=TRUE; - currentListIndent.push("P"); - bool singular = ((QString)yytext).find('s')==-1; - outDoc->startSimpleSect(BaseOutputDocInterface::Author, - 0,0,theTranslator->trAuthor(TRUE,singular)+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->docify(", "); - } - } -<DocScan>{CMD}("return"([s])?|"result"){BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inReturnBlock) - { - if (inBlock()) endBlock(); - inReturnBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::Return,0,0,theTranslator->trReturns()+": "); - outDoc->writeDescItem(); - } - } -<DocScan>{CMD}("sa"|"see"){BSEP} { - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inSeeBlock) - { - if (inBlock()) endBlock(); - inSeeBlock=TRUE; - currentListIndent.push("P"); - outDoc->startSimpleSect(BaseOutputDocInterface::See,0,0,theTranslator->trSeeAlso()+": "); - outDoc->writeDescItem(); - } - else - { - outDoc->docify(", "); - } - } -<DocScan>(({B}*"\n"){2,}{B}*)?{CMD}"param"{BSEP} { - QCString t=yytext; - if (insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inParamBlock) - { - if (inBlock()) endBlock(); - inParamBlock=TRUE; - currentListIndent.push("P"); - outDoc->startParamList(BaseOutputDocInterface::Param,theTranslator->trParameters()+": "); - outDoc->writeDescItem(); - outDoc->startDescTable(); - } - else - { - outDoc->endDescTableData(); - } - BEGIN(DocParam); - } -<DocScan>(({B}*"\n"){2,}{B}*)?{CMD}"retval"{BSEP} { - QCString t=yytext; - if (/*t.contains('\n')>1 &&*/ insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inRetValBlock) - { - if (inBlock()) endBlock(); - inRetValBlock=TRUE; - currentListIndent.push("P"); - outDoc->startParamList(BaseOutputDocInterface::RetVal,theTranslator->trReturnValues()+": "); - outDoc->writeDescItem(); - outDoc->startDescTable(); - } - else - { - outDoc->endDescTableData(); - } - BEGIN(DocParam); - } -<DocScan>(({B}*"\n"){2,}{B}*)?{CMD}("exception"|"throw")s?{BSEP} { - QCString t=yytext; - if (/*t.contains('\n')>1 &&*/ insideItemList) - { - forceEndItemList(); - } - endArgumentList(); - if (!inExceptionBlock) - { - if (inBlock()) endBlock(); - inExceptionBlock=TRUE; - currentListIndent.push("P"); - outDoc->startParamList(BaseOutputDocInterface::Exception,theTranslator->trExceptions()+": "); - outDoc->writeDescItem(); - outDoc->startDescTable(); - } - else - { - outDoc->endDescTableData(); - } - BEGIN(DocException); - } -<DocScan>"\\capt".* -<DocParam>({DOCPARAM}{BN}*","{BN}*)*{DOCPARAM}{BSEP}* { - QCString argName = substitute(yytext,"\"","").stripWhiteSpace(); - if (inParamBlock) - { - checkArgName(argName,TRUE); - } - else if (inRetValBlock) - { - checkArgName(argName,FALSE); - } - outDoc->startDescTableTitle(); - scanDoc(argName); - outDoc->endDescTableTitle(); - outDoc->startDescTableData(); - BEGIN(DocScan); - } -<DocException>{SCOPENAME} { - outDoc->startDescTableTitle(); - generateRef(*outDoc,className,yytext,FALSE); - outDoc->endDescTableTitle(); - outDoc->startDescTableData(); - BEGIN(DocScan); - } -<DocScan>{CMD}"section "{ID}" " { - QCString secName=&yytext[9]; // skip "\section " - secName=secName.left(secName.length()-1); // remove \n - //printf("SectionName %s found\n",secName.data()); - SectionInfo *sec; - if ((sec=Doxygen::sectionDict[secName])) - { - //printf("Title %s\n",sec->title.data()); - outDoc->startSection(sec->label,sec->title,sec->type); - scanString(sec->title); - outDoc->endSection(sec->label,sec->type); - } - else - { - warn(yyFileName,yyLineNr,"Warning: reference to unknown section %s in the documentation of this entity!",yytext); - } - } -<DocScan>{CMD}"anchor "{ID}" " { - QCString secName=&yytext[8]; - secName=secName.left(secName.length()-1); - SectionInfo *sec; - //printf("secName=%s\n",secName.data()); - if ((sec=Doxygen::sectionDict[secName])) - { - //printf("writeAnchor %s_%s\n",sec->fileName.data(),sec->label.data()); - outDoc->writeAnchor(sec->fileName,sec->label); - } - else - { - //printf("Section %s not found!\n",secName.data()); - } - } -<DocScan>"\\_internalref"{B}+ { // for internal use only! - internalRefFile.resize(0); - internalRefAnchor.resize(0); - BEGIN(DocInternalRef); - } -<DocInternalRef>[A-Z_a-z0-9.:#\-\+]+ { - internalRefFile=yytext; - int i = internalRefFile.find('#'); - if (i!=-1) - { - internalRefAnchor=internalRefFile.right(internalRefFile.length()-i-1); - internalRefFile=internalRefFile.left(i); - } - //printf("InternalRef yytext=`%s' file=`%s' anchor=`%s'\n",yytext,internalRefFile.data(),internalRefAnchor.data()); - BEGIN(DocInternalRefText); - } -<DocInternalRefText>\"[^\n\"]*\" { - QCString text=substitute(yytext,"\"",""); - outDoc->writeObjectLink(0,internalRefFile,internalRefAnchor,text); - BEGIN(DocScan); - } -<DocScan>{CMD}"ref"/{BN} { - BEGIN(DocRefName); - } -<DocScan>{CMD}"secreflist"/{BN} { - outDoc->startSectionRefList(); - } -<DocScan>{CMD}"endsecreflist"/{BN} { - outDoc->endSectionRefList(); - } -<DocScan>{CMD}"refitem"/{BN} { - BEGIN(DocRefItem); - } - /* -<DocScan>{CMD}"if"/{BN} { - outDoc->pushGeneratorState(); - depthIf++; - BEGIN(DocIf); - } -<DocScan>{CMD}"endif"/[^a-z_A-Z0-9] { - if (--depthIf<0) - { - warn(yyFileName,yyLineNr, - "Warning: documentation block contains \\endif without " - "matching \\if found in documentation of this entity." - ); - } - else - { - outDoc->popGeneratorState(); - } - } -<DocIf>[^\n\t ]+ { - if (Config_getList("ENABLED_SECTIONS").find(yytext)==-1) - { - outDoc->disableAll(); - } - BEGIN(DocScan); - } - */ -<DocRefName>{SCOPENAME}|{FILE} { - QCString ref=yytext; - SectionInfo *sec; - //printf(">>> ref `%s'\n",yytext); - if ((sec=Doxygen::sectionDict[ref])) - { - //printf("Is a section!\n"); - QCString text; - if (sec->title.isEmpty()) - text=sec->label; - else - text=sec->title; - if (sec->type==SectionInfo::Anchor) - { - outDoc->writeObjectLink(sec->ref,sec->fileName,sec->label,text); - if (sec->ref.isEmpty()) - { - writePageRef(*outDoc,sec->label,0); - } - } - else - { - //printf(" ref sec=%p sec->fileName=%s text=%s\n",sec,sec->fileName.data(),text.data()); - outDoc->writeSectionRef(sec->ref,sec->fileName,sec->label,text); - } - } - else if (!generateLink(*outDoc,className,yytext,TRUE,0)) - { - warn(yyFileName,yyLineNr,"Warning: reference to unknown section %s in the documentation of this entity!",yytext); - } - BEGIN(DocScan); - } -<DocRefName>({SCOPENAME}|{FILE}){B}+/"\"" { - //printf(">>> ref `%s'\n",yytext); - sectionRef=yytext; - sectionRef=sectionRef.stripWhiteSpace(); - BEGIN(DocRefArgStart); - } -<DocRefArgStart>"\"" { - BEGIN(DocRefArg); - } -<DocRefArg>[^\"\n]+[\n\"] { - yytext[yyleng-1]='\0'; - QCString text=substitute(yytext,"\\\\","\\"); - SectionInfo *sec; - if ((sec=Doxygen::sectionDict[sectionRef])) - { - //printf("Is a section!\n"); - if (sec->type==SectionInfo::Anchor) - { - outDoc->writeObjectLink(sec->ref,sec->fileName,sec->label,text); - if (sec->ref.isEmpty()) - { - writePageRef(*outDoc,sec->label,0); - } - } - else - { - outDoc->writeSectionRef(sec->ref,sec->fileName,sec->label,text); - } - } - else if (!generateLink(*outDoc,className,sectionRef,TRUE,text)) - { - warn(yyFileName,yyLineNr,"Warning: reference to unknown section %s in the documentation of this entity!",sectionRef.data()); - outDoc->startBold(); - outDoc->writeString(" unknown reference! "); - outDoc->endBold(); - } - BEGIN(DocScan); - } -<DocRefItem>{ID} { - sectionRef=yytext; - refItemText.resize(0); - BEGIN(DocRefItemName); - } -<DocRefItemName>"\\&" { refItemText+='&'; } -<DocRefItemName>"\\>" { refItemText+='>'; } -<DocRefItemName>"\\<" { refItemText+='<'; } -<DocRefItemName>"\\@" { refItemText+='@'; } -<DocRefItemName>"\\$" { refItemText+='$'; } -<DocRefItemName>"\\#" { refItemText+='#'; } -<DocRefItemName>"\\\\" { refItemText+='\\'; } -<DocRefItemName>. { refItemText+=*yytext; } -<DocRefItemName>\n { - SectionInfo *sec; - if ((sec=Doxygen::sectionDict[sectionRef])) - { - outDoc->writeSectionRefItem(sec->fileName,sec->label,refItemText.stripWhiteSpace()); - } - else - { - warn(yyFileName,yyLineNr,"Warning: reference to unknown section %s in the documentation of this entity!",sectionRef.data()); - outDoc->startBold(); - outDoc->writeString(" unknown reference! "); - outDoc->endBold(); - } - BEGIN(DocScan); - } -<DocScan>{CMD}"image"{B}+ { - BEGIN(DocImage); - } -<DocImage>[hH][tT][mM][lL] { - BEGIN(DocHtmlImageName); - } -<DocImage>[lL][aA][tT][eE][xX] { - BEGIN(DocLatexImageName); - } -<DocImage>[rR][tT][fF] { - BEGIN(DocRtfImageName); - } -<DocHtmlImageName>[^ \t\n]+ { - curImageName = findAndCopyImage(stripQuotes(yytext),IT_Html); - curImageCaption.resize(0); - if (curImageName.isEmpty()) - { - BEGIN(DocScan); - } - else - { - BEGIN(DocHtmlImageOpt); - } - } -<DocHtmlImageOpt>\n { - writeImage(IT_Html,0); - BEGIN(DocScan); - } -<DocHtmlImageOpt>\"[^\n"]*\" { - curImageCaption=stripQuotes(yytext); - } -<DocRtfImageName>{FILE} { - curImageName = findAndCopyImage(stripQuotes(yytext),IT_RTF); - curImageCaption.resize(0); - if (curImageName.isEmpty()) - { - BEGIN(DocScan); - } - else - { - BEGIN(DocRtfImageOpt); - } - } -<DocRtfImageOpt>\n { - writeImage(IT_RTF,0); - BEGIN(DocScan); - } -<DocRtfImageOpt>\"[^\n"]*\" { - curImageCaption=stripQuotes(yytext); - } -<DocLatexImageName>{FILE} { - curImageName = findAndCopyImage(stripQuotes(yytext),IT_Latex); - curImageCaption.resize(0); - if (curImageName.isEmpty()) - BEGIN(DocScan); - else - BEGIN(DocLatexImageOpt); - } -<DocLatexImageOpt>\n { // no width specified - writeImage(IT_Latex,0); - BEGIN(DocScan); - } -<DocLatexImageOpt>\"[^\n"]*\" { - curImageCaption=stripQuotes(yytext); - } -<DocLatexImageOpt>("width"{B}*"="{B}*)(([0-9\.]+({B}*{ID})?)|("\\"{ID})) { - writeImage(IT_Latex,yytext); - BEGIN(DocScan); - } -<DocLatexImageOpt>("height"{B}*"="{B}*)(([0-9\.]+({B}*{ID})?)|("\\"{ID})) { - writeImage(IT_Latex,yytext); - BEGIN(DocScan); - } -<DocImage>[a-z_A-Z0-9\.\-]+ { - warn(yyFileName,yyLineNr,"Warning: %s is an unsupported output format for \\image in the documentation of the entity",yytext); - } -<DocImage,DocHtmlImageName,DocLatexImageName>\n { - warn(yyFileName,yyLineNr,"Warning: invalid \\image command found in the documentation of this entity!"); - outDoc->enableAll(); - BEGIN(DocScan); - } -<DocScan>{CMD}"dotfile"{B}* { - BEGIN(DocDotFile); - } -<DocDotFile>{FILE} { - curDotFileName = stripQuotes(yytext); - curDotFileCaption.resize(0); - if (curDotFileName.isEmpty()) - { - BEGIN(DocScan); - } - else - { - BEGIN(DocDotFileOpt); - } - } -<DocDotFileOpt>\n { - writeDotFile(curDotFileName,curDotFileCaption); - BEGIN(DocScan); - } -<DocDotFileOpt>\"[^\n"]*\" { - curDotFileCaption = stripQuotes(yytext); - writeDotFile(curDotFileName,curDotFileCaption); - BEGIN(DocScan); - } -<DocScan>{CMD}"code"({BN}*"\n"|{B}*) { - outDoc->startCodeFragment(); - codeBlock.resize(0); - BEGIN( DocCodeBlock ); - } -<DocScan>{CMD}"endcode"/[^a-z_A-Z0-9] { - warn(yyFileName,yyLineNr,"Warning: \\endcode without \\code " - "in the documentation of this entity."); - } - -<DocScan,DocRefName>{ID}"<"[^>\ \t\n]*">"("::"{ID})+"("?[a-z_A-Z0-9,:\<\> \t\*\&]*")"? { - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - BEGIN(DocScan); - } -<DocScan,DocRefName>{SCOPEMASK}"("[a-z_A-Z0-9,:\<\> \t\*\&]+")"({B}*("const"|"volatile"))? { - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - BEGIN(DocScan); - } -<DocScan,DocRefName>{SCOPEMASK}("()"({B}*("const"|"volatile"))?)? { - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - BEGIN(DocScan); - } -<DocScan,DocRefName>({SCOPEMASK}"::")?"operator"{OPMASK} { - QCString oName=yytext; - if (!insideHtmlLink) - { - generateRef(*outDoc,className, - removeRedundantWhiteSpace(oName),inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - BEGIN(DocScan); - } -<DocScan>("http:"|"https:"|"ftp:"|"file:"){URLMASK} { outDoc->startHtmlLink(yytext); - outDoc->docify(yytext); - outDoc->endHtmlLink(); - } -<DocScan>[a-zA-Z_0-9\.\-]+"@"[0-9a-z_A-Z\.\-]+ { outDoc->writeMailLink(yytext); } -<DocScan>{FILESCHAR}*{FILEECHAR}+/".\\n" { // special exception that is otherwise matches by FILEMASK - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - } -<DocScan>{FILEMASK} { - if (!insideHtmlLink) - { - generateFileRef(*outDoc,yytext); - } - else - { - outDoc->docify(yytext); - } - } -<DocCodeBlock>{BN}*{CMD}"endcode"/[^a-z_A-Z0-9] { // needed to match things like \endcode. (note the dot) - codeBlock+="\n"; - parseCode(*outDoc,className,codeBlock,exampleDoc,exampleName); - //printf("Code block\n-------------\n%s\n--------------\n",codeBlock.data()); - outDoc->endCodeFragment(); - BEGIN( DocScan ); - } -<DocScan>{CMD}("e"|"em"|"a"){BN}+ { BEGIN( DocEmphasis ); } -<DocScan>{CMD}"b"{BN}+ { BEGIN( DocBold ); } -<DocScan>{CMD}("c"|"p"){BN}+ { BEGIN( DocCode ); } -<DocScan>{CMD}"l"{BN}+ -<DocScan>"\\n"/[^a-z_A-Z0-9] { outDoc->lineBreak(); } -<DocScan>{CMD}"include"{BN}+ { BEGIN( DocInclude ); } -<DocScan>{CMD}"dontinclude"{BN}+ { BEGIN( DocDontInclude ); } -<DocScan>{CMD}"skip"{BN}+ { BEGIN( DocSkipKey ); } -<DocScan>{CMD}"skipline"{BN}+ { BEGIN( DocSkiplineKey ); firstLine=TRUE; } -<DocScan>{CMD}"line"{BN}+ { BEGIN( DocLineKey ); firstLine=TRUE; } -<DocScan>{CMD}"until"{BN}+ { BEGIN( DocUntilKey ); firstLine=TRUE; } -<DocSkipKey>[^\r\n]+ { - if (includeFileLength>0) - { - QCString pattern=yytext; - skipUntil(pattern.stripWhiteSpace()); - } - BEGIN( DocScan ); - } -<DocLineKey>[^\r\n]+ { - if (includeFileLength>0) - { - QCString pattern=yytext; - if (firstLine) outDoc->startCodeFragment(); - firstLine=FALSE; - showLine(*outDoc,pattern.stripWhiteSpace()); - BEGIN( DocKeyEnd ); - } - else - { - BEGIN( DocScan ); - } - } -<DocSkiplineKey>[^\r\n]+ { - if (includeFileLength>0) - { - QCString pattern=yytext; - if (firstLine) outDoc->startCodeFragment(); - firstLine=FALSE; - skipLine(*outDoc,pattern.stripWhiteSpace()); - BEGIN( DocKeyEnd ); - } - else - { - BEGIN( DocScan ); - } - } -<DocUntilKey>[^\r\n]+ { - if (includeFileLength>0) - { - QCString pattern=yytext; - if (firstLine) outDoc->startCodeFragment(); - firstLine=FALSE; - showUntil(*outDoc,pattern.stripWhiteSpace()); - BEGIN( DocKeyEnd ); - } - else - { - BEGIN( DocScan ); - } - } -<DocKeyEnd>{CMD}"line"{BN}+ { BEGIN(DocLineKey); } -<DocKeyEnd>{CMD}"until"{BN}+ { BEGIN(DocUntilKey); } -<DocKeyEnd>{CMD}"skipline"{BN}+ { BEGIN(DocSkiplineKey); } -<DocKeyEnd>\n -<DocKeyEnd><<EOF>> { - if (!firstLine) outDoc->endCodeFragment(); - yyterminate(); - } -<DocKeyEnd>. { - unput(*yytext); - if (!firstLine) outDoc->endCodeFragment(); - BEGIN( DocScan ); - } -<DocScan>"<"{MULTICOL}{ATTR}">" -<DocScan>"</"{MULTICOL}{ATTR}">" -<DocScan>"<"{STRONG}{ATTR}">" { outDoc->startBold(); } -<DocScan>"</"{STRONG}{ATTR}">" { outDoc->endBold(); } -<DocScan>"<"{CENTER}{ATTR}">" { outDoc->startCenter(); } -<DocScan>"</"{CENTER}{ATTR}">" { outDoc->endCenter(); } -<DocScan>"<"{TABLE}{ATTR}">" { startTable(); } -<DocScan>"</"{TABLE}{ATTR}">" { endTable(); } -<DocScan>"<"{CAPTION}{ATTR}">" { caption.resize(0); - BEGIN( DocCaption ); - } -<DocCaption>[^\n\<\>\/]+ { - caption+=yytext; - } -<DocCaption>\n { caption+=" "; } -<DocCaption>. { caption+=*yytext; } -<DocCaption>"</"{CAPTION}{ATTR}">" { if (curTable) - { - curTable->setCaption(caption); - } - BEGIN( DocScan ); - } -<DocScan>"<"{INPUT}{ATTR}">" -<DocScan>"<"{SMALL}{ATTR}">" { outDoc->startSmall(); } -<DocScan>"</"{SMALL}{ATTR}">" { outDoc->endSmall(); } -<DocScan>"<"{META}{ATTR}">" -<DocScan>"<"{FORM}{ATTR}">" -<DocScan>"</"{FORM}{ATTR}">" -<DocScan>"<"{HEAD}{ATTR}">" -<DocScan>"</"{HEAD}{ATTR}">" -<DocScan>"<"{BODY}{ATTR}">" -<DocScan>"</"{BODY}{ATTR}">" -<DocScan>"<"{BLOCKQUOTE}{ATTR}">" -<DocScan>"</"{BLOCKQUOTE}{ATTR}">" -<DocScan>"<"{CODE}{ATTR}">" { outDoc->startTypewriter(); } -<DocScan>"</"{CODE}{ATTR}">" { outDoc->endTypewriter(); } -<DocScan>"<"{DFN}{ATTR}">" { outDoc->startTypewriter(); } -<DocScan>"</"{DFN}{ATTR}">" { outDoc->endTypewriter(); } -<DocScan>"<"{VAR}{ATTR}">" { outDoc->startEmphasis(); } -<DocScan>"</"{VAR}{ATTR}">" { outDoc->endEmphasis(); } -<DocScan>"<"{IMG}{ATTR}">" { - /*storeOutputListState();*/ - outDoc->pushGeneratorState(); - outDoc->disableAllBut(OutputGenerator::Html); - outDoc->writeString(yytext); - /*restoreOutputListState();*/ - outDoc->popGeneratorState(); - } -<DocScan>"<"{PRE}{ATTR}">" { - if (insidePre) - { - warn(yyFileName,yyLineNr,"Warning in the documentation of this entity:\nNested <pre> found in the documentation of this entity!"); - } - outDoc->startPreFragment(); - insidePre=TRUE; - } -<DocScan>"</"{PRE}{ATTR}">" { - outDoc->endPreFragment(); - insidePre=FALSE; - } -<DocScan>"<"{SUB}{ATTR}">" { outDoc->startSubscript(); } -<DocScan>"</"{SUB}{ATTR}">" { outDoc->endSubscript(); } -<DocScan>"<"{SUP}{ATTR}">" { outDoc->startSuperscript(); } -<DocScan>"</"{SUP}{ATTR}">" { outDoc->endSuperscript(); } -<DocScan>"<"{TR}{ATTR}">" { if (curTable) curTable->newRow(); } -<DocScan>"</"{TR}{ATTR}">" -<DocScan>"<"{TD}{ATTR}">" { if (curTable) curTable->newElem(); } -<DocScan>"</"{TD}{ATTR}">" -<DocScan>"<"{OL}{ATTR}">"{BN}* { outDoc->startEnumList(); - currentListIndent.push("O"); - } -<DocScan>"</"{OL}{ATTR}">"{BN}* { - if (currentListIndent.isEmpty()) - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nMore </ol> tags than <ol> tags in the documentation of this entity." - ); - } - else if (*currentListIndent.top()!='O') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe </ol> tag does not end a <ol> tag." - ); - } - else - { - outDoc->endEnumList(); - currentListIndent.pop(); - } - } -<DocScan>"<"{UL}{ATTR}">"{BN}* { outDoc->startItemList(); - currentListIndent.push("U"); - } -<DocScan>"</"{UL}{ATTR}">"{BN}* { - if (currentListIndent.isEmpty()) - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nMore </ul> tags than <ul> tags." - ); - } - else if (*currentListIndent.top()!='U') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe </ul> tag does not end a <ul> tag." - ); - } - else - { - outDoc->endItemList(); - currentListIndent.pop(); - } - } -<DocScan>"<"{LI}{ATTR}">" { - if (/*currentListIndent.isEmpty() ||*/ //DvH: I removed this check because I use this in the manual (the <ul> is in a \htmlonly block!) - !currentListIndent.isEmpty() && *currentListIndent.top()=='D') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe <li> tag can only be used inside a <ul> ... </ul> or a <ol> ... </ol> block." - ); - } - else - { - outDoc->writeListItem(); - } - } -<DocScan>"</"{LI}{ATTR}">" -<DocScan>"<"{TT}{ATTR}">" { outDoc->startTypewriter(); } -<DocScan>"</"{TT}{ATTR}">" { outDoc->endTypewriter(); } -<DocScan>"<"{KBD}{ATTR}">" { outDoc->startTypewriter(); } -<DocScan>"</"{KBD}{ATTR}">" { outDoc->endTypewriter(); } -<DocScan>"<"{EM}{ATTR}">" { outDoc->startEmphasis(); } -<DocScan>"</"{EM}{ATTR}">" { outDoc->endEmphasis(); } -<DocScan>"<"{HR}{ATTR}">" { outDoc->writeRuler(); } -<DocScan>"<"{DL}{ATTR}">" { outDoc->startDescription(); - currentListIndent.push("D"); - } -<DocScan>"</"{DL}{ATTR}">" { - if (currentListIndent.isEmpty()) - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nMore </dl> tags than <dl> tags in the documentation." - ); - } - else if (*currentListIndent.top()!='D') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe </dl> tag does not end a <dl> tag in the documentation." - ); - } - else - { - outDoc->endDescription(); - currentListIndent.pop(); - } - } -<DocScan>"<"{DT}{ATTR}">" { - if (currentListIndent.isEmpty() || - *currentListIndent.top()!='D') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe <dt> tag can only be used inside a <dl> ... </dl> block." - ); - } - else - { - outDoc->startDescItem(); - } - } -<DocScan>"</"{DT}{ATTR}">" -<DocScan>"<"{DD}{ATTR}">" { - if (currentListIndent.isEmpty() || - *currentListIndent.top()!='D') - { - warn(yyFileName,yyLineNr, - "Warning in the documentation of this entity:\nThe <dd> tag can only be used inside a <dl> ... </dl> block." - ); - } - else - { - outDoc->endDescItem(); - } - } -<DocScan>"</"{DD}{ATTR}">" -<DocScan>"<"{BR}{ATTR}">" { outDoc->lineBreak(); } -<DocScan>"<"{I}{ATTR}">" { outDoc->startEmphasis(); } -<DocScan>"</"{I}{ATTR}">" { outDoc->endEmphasis(); } -<DocScan>"</"{A}{ATTR}">" { if (insideHtmlLink) - { - outDoc->endHtmlLink(); - insideHtmlLink=FALSE; - } - } -<DocScan>"<"{A}{BN}+ { BEGIN(DocHtmlLink); } -<DocScan>"<"{BOLD}{ATTR}">" { outDoc->startBold(); } -<DocScan>"</"{BOLD}{ATTR}">" { outDoc->endBold(); } -<DocScan>"<"{P}{ATTR}">" { - if (inBlock()) endBlock(); - outDoc->newParagraph(); } -<DocScan>"</"{P}{ATTR}">" -<DocScan>"<"{H1}{ATTR}">" { outDoc->startTitle(); } -<DocScan>"</"{H1}{ATTR}">" { outDoc->endTitle(); } -<DocScan>"<"{H2}{ATTR}">" { outDoc->startSubsection(); } -<DocScan>"</"{H2}{ATTR}">" { outDoc->endSubsection(); } -<DocScan>"<"{H3}{ATTR}">" { outDoc->startSubsubsection(); } -<DocScan>"</"{H3}{ATTR}">" { outDoc->endSubsubsection(); } -<DocHtmlLink>{NAME}{BN}*"="{BN}*("\""?) { BEGIN(DocHtmlAnchor); } -<DocHtmlAnchor>[a-z_A-Z0-9.\-\+\/]+ { outDoc->writeAnchor(0,yytext); } -<DocHtmlLink>{HREF}{BN}*"="{BN}*("\""?) { - htmlUrl.resize(0); - htmlText.resize(0); - BEGIN(DocHtmlHref); - } -<DocHtmlHref>{URLMASK} { - htmlUrl=yytext; - } -<DocHtmlHref>">" { - outDoc->startHtmlLink(htmlUrl); - insideHtmlLink=TRUE; - BEGIN(DocScan); - } -<DocHtmlLink,DocHtmlAnchor>">" { BEGIN(DocScan); } -<DocScan>{CMD}("\\"|"@"|"<"|">"|"&"|"$"|"#"|"%") { - outDoc->docify(&yytext[1]); - } -<DocScan,DocEmphasis,DocBold,DocCode>"%"[a-z_A-Z][a-z_A-Z0-9:\-]* { - outDoc->docify(yytext+1); - } -<DocEmphasis>{FILEMASK} { - outDoc->startEmphasis(); - if (!insideHtmlLink) - { - generateFileRef(*outDoc,yytext); - } - else - { - outDoc->docify(yytext); - } - outDoc->endEmphasis(); - BEGIN( DocScan ); - } -<DocEmphasis>[a-z_A-Z][a-z_A-Z:0-9<>&\-=^%~!\[\]()|\*/]*"("[a-z_A-Z0-9,:\<\> \t\*\&]*")" { - outDoc->startEmphasis(); - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - outDoc->endEmphasis(); - BEGIN( DocScan ); - } -<DocEmphasis>{WORD} { - outDoc->startEmphasis(); - if (!insideHtmlLink) - { - linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE); - } - else - { - outDoc->docify(yytext); - } - outDoc->endEmphasis(); - BEGIN( DocScan ); - } -<DocBold>{FILEMASK} { - outDoc->startBold(); - if (!insideHtmlLink) - { - generateFileRef(*outDoc,yytext); - } - else - { - outDoc->docify(yytext); - } - outDoc->endBold(); - BEGIN( DocScan ); - } -<DocBold>[a-z_A-Z][a-z_A-Z:0-9<>&\-=^%~!\[\]()|\*/]*"("[a-z_A-Z0-9,:\<\> \t\*\&]*")" { - outDoc->startBold(); - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - outDoc->endBold(); - BEGIN( DocScan ); - } -<DocBold>{WORD} { - outDoc->startBold(); - if (!insideHtmlLink) - { - linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE); - } - else - { - outDoc->docify(yytext); - } - outDoc->endBold(); - BEGIN( DocScan ); - } -<DocCode>{FILEMASK} { - outDoc->startTypewriter(); - if (!insideHtmlLink) - { - generateFileRef(*outDoc,yytext); - } - else - { - outDoc->docify(yytext); - } - outDoc->endTypewriter(); - BEGIN( DocScan ); - } -<DocCode>[a-z_A-Z][a-z_A-Z:0-9<>&\-=^%~!\[\]()!\*/]*"("[a-z_A-Z0-9,:\<\> \t\*\&]*")" { - outDoc->startTypewriter(); - if (!insideHtmlLink) - { - generateRef(*outDoc,className,yytext,inSeeBlock); - } - else - { - outDoc->docify(yytext); - } - outDoc->endTypewriter(); - BEGIN( DocScan ); - } -<DocCode>{WORD} { - outDoc->startTypewriter(); - if (!insideHtmlLink) - { - linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE); - } - else - { - outDoc->docify(yytext); - } - outDoc->endTypewriter(); - BEGIN( DocScan ); - } -<DocInclude>{FILE} { - includeFile(*outDoc,stripQuotes(yytext),FALSE); - BEGIN( DocScan ); - } -<DocDontInclude>{FILE} { - includeFile(*outDoc,stripQuotes(yytext),TRUE); - BEGIN( DocScan ); - } -<DocCodeBlock>"//" { codeBlock += yytext; } -<DocCodeBlock>"/*" { codeBlock += yytext; } -<DocCodeBlock>\n { codeBlock += '\n'; } -<DocCodeBlock>[^\/\\\<\n]* { codeBlock += yytext; } -<DocCodeBlock>. { codeBlock += *yytext; } -<DocCode,DocEmphasis,DocScan,DocBold>"//" { - outDoc->docify(yytext); - } -<DocCode,DocEmphasis,DocScan,DocBold>"/*" { - outDoc->docify(yytext); - } -<DocCode,DocEmphasis,DocBold>"\n" { outDoc->writeChar('\n'); } -<DocScan>({B}*"\n"){2,}{B}*"*"*{B}*"-"("#")?{B}+ { // new paragraph & start of a list - QCString text=yytext; - int dashPos = text.findRev('-'); - bool isEnumerated = text.at(dashPos+1)=='#'; - if (insideArgumentList) - { - insideArgumentList=FALSE; - outDoc->endItemList(); - } - else if (insideItemList) - { - forceEndItemList(); - } - else - { - outDoc->newParagraph(); - } - if (inBlock()) endBlock(); - addListItemMarker(yytext,dashPos+1,isEnumerated); - } -<DocScan>({B}*"\n"){2,}{B}* { // new paragraph - bool ib = inBlock(); - if (insideArgumentList) - { - insideArgumentList=FALSE; - outDoc->endItemList(); - if (ib) endBlock(); - } - else if (insideItemList) - { - forceEndItemList(); - } - else - { - if (insidePre) - { - outDoc->docify(yytext); - } - else if (!ib) - { - outDoc->newParagraph(); - } - if (ib && *currentListIndent.top()=='P') - { // inside paragraph block - endBlock(); - } - } - } -<DocScan>{BN}+/\n { - outDoc->writeChar(' '); - } -<DocScan>\n?{B}* { - if (insidePre) - { - outDoc->docify(yytext); - } - else - { - outDoc->writeChar(' '); - } - } -<DocCode,DocEmphasis,DocBold,DocScan,Text>[a-z_A-Z0-9]+ { - outDoc->docify(yytext); - } -<DocCode,DocEmphasis,DocBold,DocScan,Text>. { - outDoc->writeChar(*yytext); - } -<DocCopyFind>{CMD}"copydoc"{B}+ { // found copydoc command - BEGIN(DocCopyArg); - } -<DocCopyFind>{CMD}"verbatim"/[^a-z_A-Z0-9] { // skip verbatim sections - copyDocString+=yytext; - BEGIN(DocCopySkipVerb); - } -<DocCopyFind>[^@\\\n]+ { copyDocString+=yytext; } -<DocCopyFind>"\\\\"|"@@" { copyDocString+=yytext; /* skip escaped commands */ } -<DocCopySkipVerb>[^@\\\n]+ { copyDocString+=yytext; } -<DocCopySkipVerb>{CMD}"endverbatim" { copyDocString+=yytext; - BEGIN(DocCopyFind); - } -<DocCopyFind,DocCopySkipVerb>\n { copyDocString+=yytext; } -<DocCopyFind,DocCopySkipVerb>. { copyDocString+=yytext; } -<DocCopyArg>{LINKMASK} { //printf("found @copydoc with arg `%s'\n",yytext); - QCString doc; - Definition *def; - if (findDocsForMemberOrCompound(yytext,&doc,&def)) - { - //printf("found docs `%s'\n",doc.data()); - if (copyDocDefList.findRef(def)!=-1) - { - warn(yyFileName,yyLineNr,"Recursive @copydoc relation!"); - } - else - { - copyDocDefList.append(def); - pushContext(); - inputString = doc; - inputPosition = 0; - BEGIN(DocCopyFind); - docYYlex(); - popContext(); - copyDocDefList.remove(def); - BEGIN(DocCopyFind); - } - } - else // reference not found! - { - warn(yyFileName,yyLineNr,"Argument `%s' of @copydoc command " - "could not be resolved!",yytext); - } - BEGIN(DocCopyFind); - } -<*>\n { yyLineNr++ ; } -<*>. - -%% - -//---------------------------------------------------------------------------- - -void scanString(const char *s) -{ - pushContext(); - inputString = s; - inputPosition = 0; - BEGIN( Text ); - docYYlex(); - popContext(); -} - -void scanDoc(const char *s) -{ - pushContext(); - inputString = s; - inputPosition = 0; - BEGIN( DocScan ); - docYYlex(); - popContext(); -} - -void internalParseDocument(const char *s) -{ - if (s==0) return; - pushContext(); - inputString = s; - inputPosition = 0; - BEGIN( DocScan ); - docYYlex(); - popContext(); -} - -//---------------------------------------------------------------------------- - -void parseDocument(OutputDocInterface &od,const QCString &docString) -{ - //inParamBlock=inSeeBlock=inReturnBlock=FALSE; - curTable = 0; - depthIf = 0; - outDoc = od.clone(); - currentIncludeFile.resize(0); - includeFileOffset=0; - includeFileLength=0; - currentListIndent.clear(); - listIndentStack.clear(); - if (!docString) return; - linkRef = ""; - linkText = ""; - inputString = docString; - inputPosition = 0; - docYYrestart( docYYin ); - BEGIN( DocScan ); - insideArgumentList = FALSE; - insideVerbatim = FALSE; - docYYlex(); - if (insideArgumentList) { insideArgumentList=FALSE; outDoc->endItemList(); } - if (insideItemList) { forceEndItemList(); } - if (inBlock()) endBlock(); - if (!currentListIndent.isEmpty()) - { - warn(yyFileName,yyLineNr,"Warning: Documentation ended in the middle " - "of a list!"); - warn_cont("Missing: "); - while (!currentListIndent.isEmpty()) - { - char c; - switch((c=*currentListIndent.pop())) - { - case 'O': warn_cont("</ol>"); break; - case 'U': warn_cont("</ul>"); break; - case 'D': warn_cont("</dl>"); break; - } - } - warn_cont("\n"); - } - if (depthIf!=0) - { - warn(yyFileName,yyLineNr,"Warning: Documentation block contains \\if " - "without matching \\endif: nesting level is %d",depthIf); - } - if (!tableStack.isEmpty()) - { - forceEndTable(); - } - if (insideVerbatim) - { - warn(yyFileName,yyLineNr, - "Warning: file ended inside a \\verbatim block!" - ); - } - od.append(outDoc); - delete outDoc; outDoc=0; - return; -} - -//---------------------------------------------------------------------------- - -// in this pass all @copydoc commands are resolved. -void resolveCopyDocCommands(const char *scope,QCString &docString) -{ - copyDocString.resize(0); - copyDocScope = scope; - inputString = docString; - inputPosition = 0; - docYYrestart( docYYin ); - BEGIN( DocCopyFind ); - docYYlex(); - docString = copyDocString; -} - -//---------------------------------------------------------------------------- - -void parseDoc(OutputDocInterface &od,const char *fileName,int startLine, - const char *clName,MemberDef *md,const QCString &docStr) -{ - - //printf("parseDoc doc=`%s'\n",docStr.data()); - - if (Debug::isFlagSet(Debug::Validate)) - { - od.parseDoc(fileName,startLine,clName,md,docStr,FALSE); - } - else - { - strcpy(yyFileName,fileName); - yyLineNr = startLine; - - QCString docString=docStr; - resolveCopyDocCommands(clName,docString); - - yyLineNr = startLine; - //printf("parseDoc(file=`%s',line=%d)\n",fileName,startLine); - initParser(); - initParseCodeContext(); - exampleDoc=FALSE; // do not cross reference with member docs - className=clName; - memberDef = md; - hasParamCommand = FALSE; - paramsFound.setAutoDelete(FALSE); - paramsFound.clear(); - parseDocument(od,docString); - - if (md && hasParamCommand && Config_getBool("WARN_IF_UNDOCUMENTED")) - { - ArgumentList *al=memberDef->isDocsForDefinition() ? - memberDef->argumentList() : - memberDef->declArgumentList(); - if (al) - { - ArgumentListIterator ali(*al); - Argument *a; - bool found=FALSE; - for (ali.toFirst();(a=ali.current());++ali) - { - QCString argName = memberDef->isDefine() ? a->type : a->name; - if (argName.right(3)=="...") argName=argName.left(argName.length()-3); - if (!argName.isEmpty() && paramsFound.find(argName)==0) - { - found = TRUE; - break; - } - } - if (found) - { - QCString scope=memberDef->getScopeString(); - if (!scope.isEmpty()) scope+="::"; else scope=""; - warn(memberDef->docFile(),memberDef->docLine(), - "Warning: The following parameters of " - "%s%s%s are not documented:", - scope.data(),memberDef->name().data(), - argListToString(al).data()); - for (ali.toFirst();(a=ali.current());++ali) - { - QCString argName = memberDef->isDefine() ? a->type : a->name; - if (!argName.isEmpty() && paramsFound.find(argName)==0) - { - warn_cont( " parameter %s\n",argName.data()); - } - } - } - } - } - } -} - -//---------------------------------------------------------------------------- - -void parseText(OutputDocInterface &od,const QCString &txtString) -{ - if (txtString.isEmpty()) return; - if (Debug::isFlagSet(Debug::Validate)) - { - od.parseText(txtString); - } - else - { - inputString = txtString; - outDoc = od.clone(); - inputPosition = 0; - docYYrestart( docYYin ); - BEGIN( Text ); - docYYlex(); - od.append(outDoc); - delete outDoc; outDoc=0; - return; - } -} - -//---------------------------------------------------------------------------- - -void parseExample(OutputDocInterface &od,const QCString &docString, - const char *fileName) -{ - if (Debug::isFlagSet(Debug::Validate)) - { - od.parseDoc(fileName,/*startLine*/1,/*clName*/0,/*md*/0,docString,TRUE); - } - else - { - initParser(); - initParseCodeContext(); - exampleDoc=TRUE; // cross reference with member docs - exampleName=fileName; - strcpy(yyFileName,fileName); - parseDocument(od,docString); - } -} - -//---------------------------------------------------------------------------- -extern "C" { // some bogus code to keep the compiler happy - void docYYdummy() { yy_flex_realloc(0,0); } -} diff --git a/src/docparser.cpp b/src/docparser.cpp index 729dab4..097b30d 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1740,6 +1740,33 @@ int DocHtmlHeader::parse() } goto endheader; } + else if (tagId==HTML_H4 && g_token->endTag) // found </h4> tag + { + if (m_level!=4) + { + warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h4>", + m_level); + } + goto endheader; + } + else if (tagId==HTML_H5 && g_token->endTag) // found </h5> tag + { + if (m_level!=5) + { + warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h5>", + m_level); + } + goto endheader; + } + else if (tagId==HTML_H6 && g_token->endTag) // found </h6> tag + { + if (m_level!=6) + { + warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h6>", + m_level); + } + goto endheader; + } else { warn(g_fileName,doctokenizerYYlineno,"Error: Unexpected html tag <%s%s> found within <h%d> context", @@ -3504,6 +3531,27 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag retval = header->parse(); } break; + case HTML_H4: + { + DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,4); + m_children.append(header); + retval = header->parse(); + } + break; + case HTML_H5: + { + DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,5); + m_children.append(header); + retval = header->parse(); + } + break; + case HTML_H6: + { + DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,6); + m_children.append(header); + retval = header->parse(); + } + break; case HTML_IMG: { HtmlAttribListIterator li(tagHtmlAttribs); diff --git a/src/docparser.h b/src/docparser.h index ba3e3fe..1a79812 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -987,7 +987,7 @@ class DocSimpleListItem : public DocNode DocPara *m_paragraph; }; -/*! @brief Node representing a Html list item */ +/*! @brief Node representing a HTML list item */ class DocHtmlListItem : public CompAccept<DocHtmlListItem>, public DocNode { public: @@ -1006,7 +1006,7 @@ class DocHtmlListItem : public CompAccept<DocHtmlListItem>, public DocNode int m_itemNum; }; -/*! @brief Node representing a Html description data */ +/*! @brief Node representing a HTML description data */ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode { public: @@ -1024,7 +1024,7 @@ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode }; -/*! @brief Node representing a Html list item */ +/*! @brief Node representing a preformatted HTML section */ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode { public: @@ -1041,7 +1041,7 @@ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode HtmlAttribList m_attribs; }; -/*! @brief Node representing a Html table cell */ +/*! @brief Node representing a HTML table cell */ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode { public: @@ -1067,7 +1067,7 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode HtmlAttribList m_attribs; }; -/*! @brief Node representing a Html table caption */ +/*! @brief Node representing a HTML table caption */ class DocHtmlCaption : public CompAccept<DocHtmlCaption>, public DocNode { public: @@ -1084,7 +1084,7 @@ class DocHtmlCaption : public CompAccept<DocHtmlCaption>, public DocNode HtmlAttribList m_attribs; }; -/*! @brief Node representing a Html table row */ +/*! @brief Node representing a HTML table row */ class DocHtmlRow : public CompAccept<DocHtmlRow>, public DocNode { public: @@ -1102,7 +1102,7 @@ class DocHtmlRow : public CompAccept<DocHtmlRow>, public DocNode HtmlAttribList m_attribs; }; -/*! @brief Node representing a Html table */ +/*! @brief Node representing a HTML table */ class DocHtmlTable : public CompAccept<DocHtmlTable>, public DocNode { public: diff --git a/src/doctokenizer.l b/src/doctokenizer.l index ab6e1b2..4f34a00 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -234,13 +234,17 @@ OPDEL {BLANK}+"delete"({BLANK}*"[]")? OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" OPCAST {BLANK}+[^(\r\n.,]+ OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) -LNKWORD1 {SCOPEMASK}({FUNCARG}({BLANK}*("const"|"volatile"))?)? +LNKWORD1 {SCOPEMASK} +CVSPEC {BLANK}*("const"|"volatile") LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} WORD1 [^ \t\n\r\\@<>&$#,.]+ WORD2 "."|"," WORD1NQ [^ \t\n\r\\@<>&$#,."]+ WORD2NQ "."|"," HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" +HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p" +HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P" +HTMLKEYW {HTMLKEYL}|{HTMLKEYU} %option noyywrap %option yylineno @@ -354,11 +358,29 @@ HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" g_token->name = yytext; return TK_SYMBOL; } -<St_Para>{LNKWORD1}/[^a-z_A-Z0-9] | + + /********* patterns for linkable words ******************/ + +<St_Para>{ID}/"<"{HTMLKEYW}">" { /* this rule is to prevent opening html + * tag to be recognized as a templated classes + */ + g_token->name = yytext; + return TK_LNKWORD; + } +<St_Para>{LNKWORD1} | +<St_Para>{LNKWORD1}{FUNCARG} | <St_Para>{LNKWORD2} { g_token->name = yytext; return TK_LNKWORD; } +<St_Para>{LNKWORD1}{FUNCARG}{CVSPEC}[^a-z_A-Z0-9] { + g_token->name = yytext; + g_token->name = g_token->name.left(g_token->name.length()-1); + unput(yytext[yyleng-1]); + return TK_LNKWORD; + } + /********* patterns for normal words ******************/ + <St_Para,St_Text>{WORD1} | <St_Para,St_Text>{WORD2} { /* function call */ g_token->name = yytext; @@ -370,6 +392,9 @@ HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" */ goto find_rule; } + + /*******************************************************/ + <St_Para,St_Text>{BLANK}+ | <St_Para,St_Text>{BLANK}*\n{BLANK}* { /* white space */ g_token->chars=yytext; diff --git a/src/dot.cpp b/src/dot.cpp index 58c05d3..bccf249 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -76,7 +76,7 @@ static bool convertMapFile(QTextStream &t,const char *mapName) if (strncmp(buf,"rect",4)==0) { // obtain the url and the coordinates in the order used by graphviz-1.5 - sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y2,&x2,&y1); + sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2); // later versions of graphviz corrected the y coordinate order // the rule is that y2>=y1, so test and switch if needed if (y2<y1) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index cf0dadc..8874917 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -696,7 +696,8 @@ static void addClassToContext(Entry *root) QCString namespaceName; extractNamespaceName(fullName,className,namespaceName); - //printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data()); + //printf("New class: namespace `%s' name=`%s' brief=`%s' docs=`%s'\n", + // className.data(),namespaceName.data(),root->brief.data(),root->doc.data()); QCString tagName; QCString refFileName; @@ -1777,6 +1778,10 @@ void addMethodToClass(Entry *root,ClassDef *cd, name=name.left(i); } + //printf("root->name=`%s; root->args=`%s' root->argList=`%s'\n", + // root->name.data(),root->args.data(),argListToString(root->argList).data() + // ); + // adding class member MemberDef *md=new MemberDef( root->fileName,root->startLine, @@ -2043,6 +2048,7 @@ static void buildFunctionList(Entry *root) //} if (root->proto) { + //printf("setDeclArgumentList to %p\n",argList); md->setDeclArgumentList(argList); } else @@ -4463,7 +4469,6 @@ static void findMember(Entry *root, // ); md->setDefinitionTemplateParameterLists(root->tArgLists); - //md->setMemberDefTemplateArguments(root->mtArgList); md->setArgumentList(argList); } else // no match -> delete argument list @@ -5377,7 +5382,7 @@ static void buildCompleteMemberLists() ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();(cd=cli.current());++cli) { - if (!cd->isReference() && // not an external class + if (// !cd->isReference() && // not an external class cd->subClasses()->count()==0 && // is a root of the hierarchy cd->baseClasses()->count()>0) // and has at least one base class { diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index bed90c4..fd2ef70 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -110,11 +110,11 @@ HtmlGenerator::~HtmlGenerator() //printf("HtmlGenerator::~HtmlGenerator()\n"); } -void HtmlGenerator::append(const OutputGenerator *g) -{ - t << g->getContents(); - col+=((HtmlGenerator *)g)->col; -} +//void HtmlGenerator::append(const OutputGenerator *g) +//{ +// t << g->getContents(); +// col+=((HtmlGenerator *)g)->col; +//} void HtmlGenerator::init() { diff --git a/src/htmlgen.h b/src/htmlgen.h index aac81f6..5f8c13c 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -33,9 +33,6 @@ class HtmlGenerator : public OutputGenerator static void writeHeaderFile(QFile &f); static void writeFooterFile(QFile &f); - OutputGenerator *copy() { return new HtmlGenerator; } - //OutputGenerator *clone() { return new HtmlGenerator(*this); } - void append(const OutputGenerator *o); void enable() { active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Html) active=TRUE; } @@ -46,15 +43,12 @@ class HtmlGenerator : public OutputGenerator void printDoc(DocNode *); - - //void generateExternalIndex(); void startFile(const char *name,const char *manName, const char *title,bool external); void writeFooter(int,bool); void endFile(); void clearBuffer(); - //void writeIndex(); void startIndexSection(IndexSections) {} void endIndexSection(IndexSections) {} void startProjectNumber(); @@ -75,11 +69,6 @@ class HtmlGenerator : public OutputGenerator void endIndexValue(const char *,bool); void startItemList() { t << "<ul>" << endl; } void endItemList() { t << "</ul>" << endl; } - //void startEnumList() { t << "<ol>" << endl; } - //void endEnumList() { t << "</ol>" << endl; } - //void startAlphabeticalIndexList(); - //void endAlphabeticalIndexList(); - //void writeIndexHeading(const char *s); void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); void codify(const char *text); @@ -91,7 +80,6 @@ class HtmlGenerator : public OutputGenerator void endTextLink(); void startHtmlLink(const char *url); void endHtmlLink(); - //void writeMailLink(const char *url); void startTypewriter() { t << "<code>"; } void endTypewriter() { t << "</code>"; } void startGroupHeader(); @@ -125,15 +113,9 @@ class HtmlGenerator : public OutputGenerator { t << "<a name=\"" << name <<"\"></a>"; } void startCodeFragment() { t << "<div class=\"fragment\"><pre>"; } void endCodeFragment() { t << "</pre></div>"; } - //void startPreFragment() { t << "<pre>"; } - //void endPreFragment() { t << "</pre>"; } - //void startVerbatimFragment() { t << "<div class=\"fragment\"><pre>"; } - //void endVerbatimFragment() { t << "</pre></div>"; } void writeLineNumber(const char *,const char *,const char *,int); void startCodeLine() { col=0; } void endCodeLine() { codify("\n"); } - //void writeBoldString(const char *text) - // { t << "<b>"; docify(text); t << "</b>"; } void startEmphasis() { t << "<em>"; } void endEmphasis() { t << "</em>"; } void startBold() { t << "<b>"; } @@ -146,15 +128,12 @@ class HtmlGenerator : public OutputGenerator void writeChar(char c); void startMemberDoc(const char *,const char *,const char *,const char *); void endMemberDoc(); - //void writeDoxyAnchor(const char *fName,const char *clName, - // const char *anchor,const char *name); void startDoxyAnchor(const char *fName,const char *manName, const char *anchor,const char *name); void endDoxyAnchor(const char *fName,const char *anchor); void startCodeAnchor(const char *label) { t << "<a name=\"" << label << "\"></a>"; } void endCodeAnchor() { } void writeLatexSpacing() {} - //void writeLatexLabel(const char *,const char *) {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *) { t << endl; } @@ -166,63 +145,26 @@ class HtmlGenerator : public OutputGenerator void endCenter() { t << "</center>" << endl; } void startSmall() { t << "<small>" << endl; } void endSmall() { t << "</small>" << endl; } - //void startSubscript() { t << "<sub>"; } - //void endSubscript() { t << "</sub>"; } - //void startSuperscript() { t << "<sup>"; } - //void endSuperscript() { t << "</sup>"; } - //void startTable(bool,int) - // { t << "<table border=1 cellspacing=3 cellpadding=3>"; } - //void endTable(bool hasCaption) - // { if (!hasCaption) t << "</tr>"; - // t << "</table>" << endl; - // } - //void startCaption() { t << "</tr><caption align=\"bottom\">"; } - //void endCaption() { t << "</caption>" << endl; } - //void nextTableRow() { t << "<tr><td>"; } - //void endTableRow() { t << "</tr>" << endl; } - //void nextTableColumn() { t << "<td>"; } - //void endTableColumn() { t << "</td>"; } - //void writeCopyright() { t << "©"; } - //void writeQuote() { t << """; } - //void writeUmlaut(char c) { t << "&" << c << "uml;"; } - //void writeAcute(char c) { t << "&" << c << "acute;"; } - //void writeGrave(char c) { t << "&" << c << "grave;"; } - //void writeCirc(char c) { t << "&" << c << "circ;"; } - //void writeTilde(char c) { t << "&" << c << "tilde;"; } - //void writeRing(char c) { t << "&" << c << "ring;"; } - //void writeSharpS() { t << "ß"; } - //void writeCCedil(char c) { t << "&" << c << "cedil;"; } void startDescList(SectionTypes) { t << "<dl compact><dt><b>" << endl; } void endDescList() { t << "</dl>"; } void startSimpleSect(SectionTypes,const char *,const char *,const char *); void endSimpleSect(); void startParamList(ParamListTypes,const char *); void endParamList(); - //void endDescTitle() { t << "</b>"; } void writeDescItem() { t << "<dd>" << endl; } void startSection(const char *,const char *,SectionInfo::SectionType); void endSection(const char *,SectionInfo::SectionType); - //void writeSectionRef(const char *,const char *,const char *,const char *); - //void writeSectionRefItem(const char *,const char *,const char *); - //void writeSectionRefAnchor(const char *,const char *,const char *); void addIndexItem(const char *,const char *); void startIndent(); void endIndent(); void writeSynopsis() {} void startClassDiagram(); void endClassDiagram(ClassDiagram &,const char *,const char *); - //void startColorFont(uchar r,uchar g,uchar b); - //void endColorFont(); void startPageRef() {} void endPageRef(const char *,const char *) {} void startQuickIndexItem(const char *,const char *); void endQuickIndexItem(); - //void writeFormula(const char *,const char *); void writeNonBreakableSpace(int); - //void startImage(const char *,const char *,bool); - //void endImage(bool); - //void startDotFile(const char *,bool); - //void endDotFile(bool); void startDescTable() { t << "<table border=0 cellspacing=2 cellpadding=0>" << endl; } @@ -236,7 +178,6 @@ class HtmlGenerator : public OutputGenerator { t << "<td>" << endl; } void endDescTableData() { t << "</td></tr>" << endl; } - //static void docifyStatic(QTextStream &t,const char *str); void startDotGraph(); void endDotGraph(DotClassGraph &g); @@ -262,14 +203,6 @@ class HtmlGenerator : public OutputGenerator void startFontClass(const char *s) { t << "<span class=\"" << s << "\">"; } void endFontClass() { t << "</span>"; } - //void startHtmlOnly() {} - //void endHtmlOnly() {} - //void startLatexOnly() {} - //void endLatexOnly() {} - - //void startSectionRefList(); - //void endSectionRefList(); - void writeCodeAnchor(const char *anchor) { t << "<a name=\"" << anchor << "\"></a>"; } diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index a6c2c9c..ce71479 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -623,18 +623,21 @@ void LatexDocVisitor::visitPre(DocHtmlHeader *header) { switch(header->level()) { - case 1: m_t << "\\subsection*{"; break; - case 2: m_t << "\\subsubsection*{"; break; - case 3: m_t << "\\paragraph*{"; break; + case 1: m_t << "\\subsection*{"; break; + case 2: m_t << "\\subsubsection*{"; break; + case 3: m_t << "\\paragraph*{"; break; + default: m_t << "\\subparagraph*{"; break; } } else { switch(header->level()) { - case 1: m_t << "\\section*{"; break; - case 2: m_t << "\\subsection*{"; break; - case 3: m_t << "\\subsubsection*{"; break; + case 1: m_t << "\\section*{"; break; + case 2: m_t << "\\subsection*{"; break; + case 3: m_t << "\\subsubsection*{"; break; + case 4: m_t << "\\paragraph*{"; break; + default: m_t << "\\subparagraph*{"; break; } } } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index ec74944..09ecae4 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -113,24 +113,24 @@ LatexGenerator::~LatexGenerator() // col=g.col; //} -void LatexGenerator::append(const OutputGenerator *g) -{ - t << g->getContents(); - col+=((LatexGenerator *)g)->col; - insideTabbing=insideTabbing || ((LatexGenerator *)g)->insideTabbing; - firstDescItem = ((LatexGenerator *)g)->firstDescItem; - insidePre = insidePre || ((LatexGenerator *)g)->insidePre; - //printf("LatexGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), - // insideTabbing ? "TRUE" : "FALSE" ); -} +//void LatexGenerator::append(const OutputGenerator *g) +//{ +// t << g->getContents(); +// col+=((LatexGenerator *)g)->col; +// insideTabbing=insideTabbing || ((LatexGenerator *)g)->insideTabbing; +// firstDescItem = ((LatexGenerator *)g)->firstDescItem; +// insidePre = insidePre || ((LatexGenerator *)g)->insidePre; +// //printf("LatexGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), +// // insideTabbing ? "TRUE" : "FALSE" ); +//} -OutputGenerator *LatexGenerator::copy() -{ - LatexGenerator *result = new LatexGenerator; - result->insideTabbing=insideTabbing; - result->insidePre=insidePre; - return result; -} +//OutputGenerator *LatexGenerator::copy() +//{ +// LatexGenerator *result = new LatexGenerator; +// result->insideTabbing=insideTabbing; +// result->insidePre=insidePre; +// return result; +//} void LatexGenerator::init() { @@ -1295,62 +1295,6 @@ void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType) //void LatexGenerator::docifyStatic(QTextStream &t,const char *str) void LatexGenerator::docify(const char *str) { -#if 0 - //static bool isCzech = theTranslator->idLanguage()=="czech"; - static bool isJapanese = theTranslator->idLanguage()=="japanese"; - //static bool isKorean = theTranslator->idLanguage()=="korean"; - //static bool isRussian = theTranslator->idLanguage()=="russian"; - //static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; - //static bool isChinese = theTranslator->idLanguage()=="chinese" || - // theTranslator->idLanguage()=="chinese-traditional"; - //static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; - //static bool isGreek = theTranslator->idLanguage()=="greek"; - if (str) - { - const unsigned char *p=(const unsigned char *)str; - unsigned char c; - unsigned char pc='\0'; - bool multiByte = FALSE; - while (*p) - { - c=*p++; - - if( isJapanese) - { - if (multiByte) - { - t << (char)c; - multiByte = FALSE; - pc = c; - continue; - } - if (c>=0x80) - { - multiByte = TRUE; - t << (char)c; - pc = c; - continue; - } - } - - if (insidePre) - { - switch(c) - { - case '\\': t << "\\(\\backslash\\)"; break; - case '{': t << "\\{"; break; - case '}': t << "\\}"; break; - default: t << (char)c; break; - } - } - else - { - filterLatexChar(t,c,insideTabbing); - } - pc = c; - } - } -#endif filterLatexString(t,str,insideTabbing,insidePre); } @@ -1377,7 +1321,7 @@ void LatexGenerator::codify(const char *str) MultiByte = FALSE; continue; } - if ( c<0 ) // char in range [0x80..0xff] + if ( (uchar)c>=0x80 || (uchar)c<=0xff) // char in range [0x80..0xff] { t << (char)c; MultiByte = TRUE; diff --git a/src/latexgen.h b/src/latexgen.h index d6c9d67..e03177b 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -31,9 +31,9 @@ class LatexGenerator : public OutputGenerator static void writeStyleSheetFile(QFile &f); static void writeHeaderFile(QFile &f); - OutputGenerator *copy(); + //OutputGenerator *copy(); //OutputGenerator *clone() { return new LatexGenerator(*this); } - void append(const OutputGenerator *o); + //void append(const OutputGenerator *o); void enable() { active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Latex) active=TRUE; } diff --git a/src/mangen.cpp b/src/mangen.cpp index cc55ebe..8712328 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -62,21 +62,21 @@ ManGenerator::~ManGenerator() { } -void ManGenerator::append(const OutputGenerator *g) -{ - QCString r=g->getContents(); - if (upperCase) - t << r.upper(); - else - t << r; - if (!r.isEmpty()) - firstCol = r.at(r.length()-1)=='\n'; - else - firstCol = ((ManGenerator *)g)->firstCol; - col+=((ManGenerator *)g)->col; - inHeader=((ManGenerator *)g)->inHeader; - paragraph=FALSE; -} +//void ManGenerator::append(const OutputGenerator *g) +//{ +// QCString r=g->getContents(); +// if (upperCase) +// t << r.upper(); +// else +// t << r; +// if (!r.isEmpty()) +// firstCol = r.at(r.length()-1)=='\n'; +// else +// firstCol = ((ManGenerator *)g)->firstCol; +// col+=((ManGenerator *)g)->col; +// inHeader=((ManGenerator *)g)->inHeader; +// paragraph=FALSE; +//} void ManGenerator::init() { diff --git a/src/mangen.h b/src/mangen.h index 72f9b02..12af60b 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -28,9 +28,9 @@ class ManGenerator : public OutputGenerator ManGenerator(); ~ManGenerator(); - OutputGenerator *copy() { return new ManGenerator; } + //OutputGenerator *copy() { return new ManGenerator; } //OutputGenerator *clone() { return new ManGenerator(*this); } - void append(const OutputGenerator *o); + //void append(const OutputGenerator *o); void enable() { active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Man) active=TRUE; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 9c38344..7e2e454 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -262,7 +262,8 @@ MemberDef::MemberDef(const char *df,int dl, const ArgumentList *tal,const ArgumentList *al ) : Definition(df,dl,na) { - //printf("++++++ MemberDef(%s file=%s,line=%d static=%d) ++++++ \n",na,df,dl,s); + //printf("++++++ MemberDef(%s file=%s,line=%d static=%d) ++++++ \n", + // na,df,dl,s); classDef=0; fileDef=0; redefines=0; @@ -345,6 +346,7 @@ MemberDef::MemberDef(const char *df,int dl, defArgList->constSpecifier = al->constSpecifier; defArgList->volatileSpecifier = al->volatileSpecifier; defArgList->pureSpecifier = al->pureSpecifier; + //printf("defArgList(%p)->constSpecifier=%d\n",defArgList,defArgList->constSpecifier); } else { @@ -355,6 +357,8 @@ MemberDef::MemberDef(const char *df,int dl, { declArgList = new ArgumentList; stringToArgumentList(args,declArgList); + //printf("setDeclArgList %s to %p const=%d\n",args.data(), + // declArgList,declArgList->constSpecifier); } else { @@ -1922,3 +1926,13 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, } } +void MemberDef::setArgumentList(ArgumentList *al) +{ + if (defArgList) delete defArgList; + defArgList = al; +} +void MemberDef::setDeclArgumentList(ArgumentList *al) +{ + if (declArgList) delete declArgList; + declArgList = al; +} diff --git a/src/memberdef.h b/src/memberdef.h index 5be5285..7a8aba3 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -200,16 +200,8 @@ class MemberDef : public Definition // argument related members ArgumentList *argumentList() const { return defArgList; } ArgumentList *declArgumentList() const { return declArgList; } - void setArgumentList(ArgumentList *al) - { - if (defArgList) delete defArgList; - defArgList = al; - } - void setDeclArgumentList(ArgumentList *al) - { - if (declArgList) delete declArgList; - declArgList = al; - } + void setArgumentList(ArgumentList *al); + void setDeclArgumentList(ArgumentList *al); ArgumentList *templateArguments() const { return tArgList; } void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists); QList<ArgumentList> *definitionTemplateParameterLists() const diff --git a/src/outputgen.h b/src/outputgen.h index 104a09b..b82c0af 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -254,8 +254,6 @@ class OutputGenerator : public BaseOutputDocInterface /////////////////////////////////////////////////////////////// // generic generator methods /////////////////////////////////////////////////////////////// - virtual OutputGenerator *copy() = 0; - //virtual void append(const OutputGenerator *) = 0; virtual void enable() = 0; virtual void disable() = 0; virtual void enableIf(OutputType o) = 0; @@ -263,8 +261,6 @@ class OutputGenerator : public BaseOutputDocInterface virtual void disableIfNot(OutputType o) = 0; virtual bool isEnabled(OutputType o) = 0; virtual OutputGenerator *get(OutputType o) = 0; - //void clear() { b.close(); a.resize(0); b.setBuffer(a); - // b.open(IO_WriteOnly); t.setDevice(&b); } void startPlainFile(const char *name); void endPlainFile(); QCString getContents() const; @@ -370,8 +366,8 @@ class OutputGenerator : public BaseOutputDocInterface /*! \brief Interface used for generating documentation. * - * This abstract class is used by the documentation block - * parser to generate the output for a specific format. + * This abstract class is used by several functions + * to generate the output for a specific format. * This interface contains some state saving and changing * functions for dealing with format specific output. */ @@ -383,7 +379,7 @@ class OutputDocInterface : public BaseOutputDocInterface /*! Create a new output generator. This can later by appended * to the current one using append(). */ - virtual OutputDocInterface *clone() = 0; + //virtual OutputDocInterface *clone() = 0; /*! Disables all output formats except format \a o * (useful for OutputList only) diff --git a/src/outputlist.cpp b/src/outputlist.cpp index b580a58..5826cca 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -36,23 +36,23 @@ OutputList::OutputList(bool) outputs->setAutoDelete(TRUE); } -OutputList::OutputList(const OutputList *olist) -{ - //printf("OutputList::OutputList() deep copy\n"); - outputs = new QList<OutputGenerator>; - outputs->setAutoDelete(TRUE); - - QList<OutputGenerator> *ol=olist->outputs; - OutputGenerator *og=ol->first(); - while (og) - { - OutputGenerator *ogc=og->copy(); - outputs->append(ogc); - if (og->isEnabled()) ogc->enable(); else ogc->disable(); - og=ol->next(); - } - //printf("OutputList::OutputList dst=%d res=%d\n",ol->count(),outputs->count()); -} +//OutputList::OutputList(const OutputList *olist) +//{ +// //printf("OutputList::OutputList() deep copy\n"); +// outputs = new QList<OutputGenerator>; +// outputs->setAutoDelete(TRUE); +// +// QList<OutputGenerator> *ol=olist->outputs; +// OutputGenerator *og=ol->first(); +// while (og) +// { +// OutputGenerator *ogc=og->copy(); +// outputs->append(ogc); +// if (og->isEnabled()) ogc->enable(); else ogc->disable(); +// og=ol->next(); +// } +// //printf("OutputList::OutputList dst=%d res=%d\n",ol->count(),outputs->count()); +//} OutputList::~OutputList() { @@ -60,23 +60,23 @@ OutputList::~OutputList() delete outputs; } -OutputList &OutputList::operator=(const OutputList &olist) -{ - if (this!=&olist) - { - QList<OutputGenerator> *ol=olist.outputs; - OutputGenerator *ogsrc=ol->first(); - OutputGenerator *ogdst=outputs->first(); - //printf("OutputList::operator= src=%d dst=%d\n",outputs->count(),ol->count()); - while (ogdst) - { - ogdst=ogsrc->copy(); - ogsrc=ol->next(); - ogdst=outputs->next(); - } - } - return *this; -} +//OutputList &OutputList::operator=(const OutputList &olist) +//{ +// if (this!=&olist) +// { +// QList<OutputGenerator> *ol=olist.outputs; +// OutputGenerator *ogsrc=ol->first(); +// OutputGenerator *ogdst=outputs->first(); +// //printf("OutputList::operator= src=%d dst=%d\n",outputs->count(),ol->count()); +// while (ogdst) +// { +// ogdst=ogsrc->copy(); +// ogsrc=ol->next(); +// ogdst=outputs->next(); +// } +// } +// return *this; +//} void OutputList::add(const OutputGenerator *og) { diff --git a/src/outputlist.h b/src/outputlist.h index 3bdf21e..fc49f1e 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -42,10 +42,6 @@ class OutputList : public OutputDocInterface public: OutputList(bool); virtual ~OutputList(); - OutputList(const OutputList *ol); - OutputList &operator=(const OutputList &ol); - //OutputList &operator+=(const OutputList &ol); - void add(const OutputGenerator *); @@ -68,17 +64,7 @@ class OutputList : public OutputDocInterface bool isExample); void parseText(const QCString &textStr); - OutputDocInterface *clone() - { - return new OutputList(this); - } - //void append(const OutputDocInterface *g) - //{ - // operator+=(*(OutputList *)g); - //} - //void writeIndex() - //{ forall(&OutputGenerator::writeIndex); } void startIndexSection(IndexSections is) { forall(&OutputGenerator::startIndexSection,is); } void endIndexSection(IndexSections is) @@ -124,16 +110,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startItemList); } void endItemList() { forall(&OutputGenerator::endItemList); } - //void startEnumList() - //{ forall(&OutputGenerator::startEnumList); } - //void endEnumList() - //{ forall(&OutputGenerator::endEnumList); } - //void startAlphabeticalIndexList() - //{ forall(&OutputGenerator::startAlphabeticalIndexList); } - //void endAlphabeticalIndexList() - //{ forall(&OutputGenerator::endAlphabeticalIndexList); } - //void writeIndexHeading(const char *s) - //{ forall(&OutputGenerator::writeIndexHeading,s); } void writeIndexItem(const char *ref,const char *file,const char *text) { forall(&OutputGenerator::writeIndexItem,ref,file,text); } void docify(const char *s) @@ -154,8 +130,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startHtmlLink,url); } void endHtmlLink() { forall(&OutputGenerator::endHtmlLink); } - //void writeMailLink(const char *url) - //{ forall(&OutputGenerator::writeMailLink,url); } void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) { forall(&OutputGenerator::writeStartAnnoItem,type,file,path,name); } @@ -213,22 +187,10 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startCodeFragment); } void endCodeFragment() { forall(&OutputGenerator::endCodeFragment); } - //void startPreFragment() - //{ forall(&OutputGenerator::startPreFragment); } - //void endPreFragment() - //{ forall(&OutputGenerator::endPreFragment); } - //void startVerbatimFragment() - //{ forall(&OutputGenerator::startVerbatimFragment); } - //void endVerbatimFragment() - //{ forall(&OutputGenerator::endVerbatimFragment); } void startCodeLine() { forall(&OutputGenerator::startCodeLine); } void endCodeLine() { forall(&OutputGenerator::endCodeLine); } - //void startLineNumber() - //{ forall(&OutputGenerator::startLineNumber); } - //void endLineNumber() - //{ forall(&OutputGenerator::endLineNumber); } void writeLineNumber(const char *ref,const char *file,const char *anchor, int lineNumber) { forall(&OutputGenerator::writeLineNumber,ref,file,anchor,lineNumber); } @@ -254,8 +216,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::endCodeAnchor); } void writeLatexSpacing() { forall(&OutputGenerator::writeLatexSpacing); } - //void writeLatexLabel(const char *scope,const char *anchor) - //{ forall(&OutputGenerator::writeLatexLabel,scope,anchor); } void startDescription() { forall(&OutputGenerator::startDescription); } void endDescription() @@ -280,56 +240,12 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startSmall); } void endSmall() { forall(&OutputGenerator::endSmall); } - //void startSubscript() - //{ forall(&OutputGenerator::startSubscript); } - //void endSubscript() - //{ forall(&OutputGenerator::endSubscript); } - //void startSuperscript() - //{ forall(&OutputGenerator::startSuperscript); } - //void endSuperscript() - //{ forall(&OutputGenerator::endSuperscript); } - //void startTable(bool hasCaption,int cols) - //{ forall(&OutputGenerator::startTable,hasCaption,cols); } - //void endTable(bool hasCaption) - //{ forall(&OutputGenerator::endTable,hasCaption); } - //void startCaption() - //{ forall(&OutputGenerator::startCaption); } - //void endCaption() - //{ forall(&OutputGenerator::endCaption); } - //void nextTableRow() - //{ forall(&OutputGenerator::nextTableRow); } - //void endTableRow() - //{ forall(&OutputGenerator::endTableRow); } - //void nextTableColumn() - //{ forall(&OutputGenerator::nextTableColumn); } - //void endTableColumn() - //{ forall(&OutputGenerator::endTableColumn); } void lineBreak() { forall(&OutputGenerator::lineBreak); } void startBold() { forall(&OutputGenerator::startBold); } void endBold() { forall(&OutputGenerator::endBold); } - //void writeCopyright() - //{ forall(&OutputGenerator::writeCopyright); } - //void writeQuote() - //{ forall(&OutputGenerator::writeQuote); } - //void writeUmlaut(char c) - //{ forall(&OutputGenerator::writeUmlaut,c); } - //void writeAcute(char c) - //{ forall(&OutputGenerator::writeAcute,c); } - //void writeGrave(char c) - //{ forall(&OutputGenerator::writeGrave,c); } - //void writeCirc(char c) - //{ forall(&OutputGenerator::writeCirc,c); } - //void writeTilde(char c) - //{ forall(&OutputGenerator::writeTilde,c); } - //void writeRing(char c) - //{ forall(&OutputGenerator::writeRing,c); } - //void writeSharpS() - //{ forall(&OutputGenerator::writeSharpS); } - //void writeCCedil(char c) - //{ forall(&OutputGenerator::writeCCedil,c); } void startMemberDescription() { forall(&OutputGenerator::startMemberDescription); } void endMemberDescription() @@ -343,8 +259,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startParamList,t,title); } void endParamList() { forall(&OutputGenerator::endParamList); } - //void endDescTitle() - //{ forall(&OutputGenerator::endDescTitle); } void writeDescItem() { forall(&OutputGenerator::writeDescItem); } void startIndent() @@ -355,13 +269,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startSection,lab,title,t); } void endSection(const char *lab,SectionInfo::SectionType t) { forall(&OutputGenerator::endSection,lab,t); } - //void writeSectionRef(const char *ref,const char *file, - // const char *anchor, const char *title) - //{ forall(&OutputGenerator::writeSectionRef,ref,file,anchor,title); } - //void writeSectionRefItem(const char *page,const char *lab, const char *title) - //{ forall(&OutputGenerator::writeSectionRefItem,page,lab,title); } - //void writeSectionRefAnchor(const char *page,const char *lab, const char *title) - //{ forall(&OutputGenerator::writeSectionRefAnchor,page,lab,title); } void addIndexItem(const char *s1,const char *s2) { forall(&OutputGenerator::addIndexItem,s1,s2); } void writeSynopsis() @@ -370,10 +277,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startClassDiagram); } void endClassDiagram(ClassDiagram &d,const char *f,const char *n) { forall(&OutputGenerator::endClassDiagram,d,f,n); } - //void startColorFont(uchar r,uchar g,uchar b) - //{ forall(&OutputGenerator::startColorFont,r,g,b); } - //void endColorFont() - //{ forall(&OutputGenerator::endColorFont); } void startPageRef() { forall(&OutputGenerator::startPageRef); } void endPageRef(const char *c,const char *a) @@ -382,19 +285,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startQuickIndexItem,s,l); } void endQuickIndexItem() { forall(&OutputGenerator::endQuickIndexItem); } - //void writeFormula(const char *n,const char *t) - //{ forall(&OutputGenerator::writeFormula,n,t); } void writeNonBreakableSpace(int num) { forall(&OutputGenerator::writeNonBreakableSpace,num); } - //void startImage(const char *n,const char *s,bool c) - //{ forall(&OutputGenerator::startImage,n,s,c); } - //void endImage(bool c) - //{ forall(&OutputGenerator::endImage,c); } - //void startDotFile(const char *n,bool c) - //{ forall(&OutputGenerator::startDotFile,n,c); } - //void endDotFile(bool c) - //{ forall(&OutputGenerator::endDotFile,c); } - void startDescTable() { forall(&OutputGenerator::startDescTable); } void endDescTable() @@ -423,7 +315,6 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::endTextBlock); } void lastIndexPage() { forall(&OutputGenerator::lastIndexPage); } - void startMemberDocPrefixItem() { forall(&OutputGenerator::startMemberDocPrefixItem); } void endMemberDocPrefixItem() @@ -444,34 +335,12 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startParameterList); } void endParameterList() { forall(&OutputGenerator::endParameterList); } - void startFontClass(const char *c) { forall(&OutputGenerator::startFontClass,c); } void endFontClass() { forall(&OutputGenerator::endFontClass); } - - //void startHtmlOnly() - //{ forall(&OutputGenerator::startHtmlOnly); } - //void endHtmlOnly() - //{ forall(&OutputGenerator::endHtmlOnly); } - //void startLatexOnly() - //{ forall(&OutputGenerator::startLatexOnly); } - //void endLatexOnly() - //{ forall(&OutputGenerator::endLatexOnly); } - - //void startSectionRefList() - //{ forall(&OutputGenerator::startSectionRefList); } - //void endSectionRefList() - //{ forall(&OutputGenerator::endSectionRefList); } - void writeCodeAnchor(const char *name) { forall(&OutputGenerator::writeCodeAnchor,name); } -#if 0 - void startPlainFile(const char *name) - { forall(&OutputGenerator::startPlainFile,name); } - void endPlainFile() - { forall(&OutputGenerator::endPlainFile); } -#else // this is to work around a bug in the SGI MipsPro compiler void startPlainFile(const char *name) { OutputGenerator *og=outputs->first(); @@ -490,7 +359,6 @@ class OutputList : public OutputDocInterface og=outputs->next(); } } -#endif private: void debug(); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index af35b80..19fc945 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -65,25 +65,25 @@ RTFGenerator::~RTFGenerator() { } -void RTFGenerator::append(const OutputGenerator *g) -{ - t << g->getContents(); - col+=((RTFGenerator *)g)->col; - //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing; - m_listLevel=((RTFGenerator *)g)->m_listLevel; - m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph; - //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), - // insideTabbing ? "TRUE" : "FALSE" ); -} +//void RTFGenerator::append(const OutputGenerator *g) +//{ +// t << g->getContents(); +// col+=((RTFGenerator *)g)->col; +// //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing; +// m_listLevel=((RTFGenerator *)g)->m_listLevel; +// m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph; +// //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), +// // insideTabbing ? "TRUE" : "FALSE" ); +//} -OutputGenerator *RTFGenerator::copy() -{ - RTFGenerator *result = new RTFGenerator; - //result->insideTabbing=insideTabbing; - result->m_listLevel=m_listLevel; - result->m_omitParagraph=m_omitParagraph; - return result; -} +//OutputGenerator *RTFGenerator::copy() +//{ +// RTFGenerator *result = new RTFGenerator; +// //result->insideTabbing=insideTabbing; +// result->m_listLevel=m_listLevel; +// result->m_omitParagraph=m_omitParagraph; +// return result; +//} void RTFGenerator::writeStyleSheetFile(QFile &file) { diff --git a/src/rtfgen.h b/src/rtfgen.h index 07f8ae7..45ec1de 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -31,9 +31,9 @@ class RTFGenerator : public OutputGenerator static void writeStyleSheetFile(QFile &f); static void writeExtensionsFile(QFile &file); - OutputGenerator *copy(); + //OutputGenerator *copy(); //OutputGenerator *clone() { return new RTFGenerator(*this); } - void append(const OutputGenerator *o); + //void append(const OutputGenerator *o); void enable() { active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==RTF) active=TRUE; } diff --git a/src/scanner.l b/src/scanner.l index a3d2c76..6d055eb 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2552,7 +2552,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) if ( *yytext == '{' ) { if ( !insidePHP && (current_root->section & Entry::COMPOUND_MASK) ) - previous->memSpec = previous->memSpec | Entry::Inline; + { + previous->memSpec |= Entry::Inline; + } //addToBody(yytext); curlyCount=0; BEGIN( SkipCurly ) ; @@ -2932,7 +2934,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) <Comment>"/*" { current->program += yytext ; } <Comment>"//" { current->program += yytext ; } <Comment>[^\n\*]+ { current->program += yytext ; } -<Comment>.*"*/" { current->program += yytext ; +<Comment>"*/" { current->program += yytext ; BEGIN( lastContext ) ; } <Comment>. { current->program += *yytext ; } diff --git a/src/translator_br.h b/src/translator_br.h index 28920ee..8549d64 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -11,11 +11,16 @@ * input used in their production; they are not affected by this license. * * Brazilian Portuguese version by - * Fabio "FJTC" Jun Takada Chino <chino@icmc.sc.usp.br> + * Fabio "FJTC" Jun Takada Chino <chino@icmc.usp.br> * http://www.icmc.sc.usp.br/~chino - * Version: 1.2.18 (2002/07/30) + * Version: 1.2.19 (2002/10/15) * * History: + * 1.2.19: + * - Updated to Doxygen 1.2.19 + * - Translation Review (Thanks to Jorge Ramos and others) + * - Small fixes in C output. + * - Latex generation support fixed (invalid package name). * 1.2.18 (2002/07/30): * - Updated to Doxygen 1.2.18 * 1.2.17 (2002/07/10): @@ -27,7 +32,7 @@ #ifndef TRANSLATOR_BR_H #define TRANSLATOR_BR_H -class TranslatorBrazilian: public TranslatorAdapter_1_2_18 +class TranslatorBrazilian: public Translator { public: @@ -52,7 +57,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 */ virtual QCString latexLanguageSupportCommand() { - return "Brazilian"; + return ""; } /*! return the language charset. This will be used for the HTML output */ @@ -114,7 +119,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! this is the first part of a sentence that is followed by a class name */ virtual QCString trThisIsTheListOfAllMembers() - { return "Esta é a lista de todos os membros da "; } + { return "Esta é a lista de todos os membros de "; } /*! this is the remainder of the sentence after the class name */ virtual QCString trIncludingInheritedMembers() @@ -140,7 +145,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! put after an undocumented member in the list of all members */ virtual QCString trDefinedIn() - { return "definida em"; } + { return "definido(a) em"; } // quick reference sections @@ -148,7 +153,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 * compounds or files (see the \\group command). */ virtual QCString trModules() - { return "Modulos"; } + { return "Módulos"; } /*! This is put above each page as a link to the class hierarchy */ virtual QCString trClassHierarchy() @@ -159,7 +164,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return "Estrutura de Dados"; + return "Estruturas de Dados"; } else { @@ -215,14 +220,14 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! This is an introduction to the class hierarchy. */ virtual QCString trClassHierarchyDescription() - { return "Esta lista de hierarquia está parcialmente ordenada em ordem alfabética:"; } + { return "Esta lista de hierarquias está parcialmente ordenada (ordem alfabética):"; } /*! This is an introduction to the list with all files. */ virtual QCString trFileListDescription(bool extractAll) { - QCString result="Aqui está a lista de todos os arquivos "; + QCString result="Esta é a lista de todos os arquivos "; if (!extractAll) result+="documentados "; - result+="com suas respectivas descrições:"; + result+="e suas respectivas descrições:"; return result; } @@ -243,13 +248,47 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! This is an introduction to the page with all class members. */ virtual QCString trCompoundMembersDescription(bool extractAll) { - QCString result="Esta é lista de todos os membros das classes "; - if (!extractAll) result+="documentados "; - result+="com links para "; - if (extractAll) - result+="a documentação de suas respectivas classes:"; + QCString result="Esta é a lista de "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="todas as estruturas e campos de uniões "; + if (!extractAll) + { + result+="documentas"; + } + } + else + { + result+="todos os membros de classes "; + if (!extractAll) + { + result+="documentos"; + } + } + result+=" com referências para "; + if (!extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="a documentação da estrutura/união de cada campo:"; + } + else + { + result+="a documentação da classe de cada membro:"; + } + } else - result+="suas respectivas classes:"; + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="a estrutura/união a que pertencem:"; + } + else + { + result+="a classe a que pertencem:"; + } + } return result; } @@ -259,7 +298,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 QCString result="Esta é a lista de "; if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="tadas as funções, variáveis, definições, enumerações e definições de tipos "; + result+="todas as funções, variáveis, definições, enumerações e definições de tipos "; if (!extractAll) result+="documentadas "; } else @@ -267,9 +306,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 result+="todos os membros dos arquivos "; if (!extractAll) result+="documentados "; } - - - result+="com links para "; + result+="com referências para "; if (extractAll) result+="seus respectivos arquivos:"; else @@ -283,15 +320,15 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! This is an introduction to the page with the list of all examples */ virtual QCString trExamplesDescription() - { return "Esta é a lista de todos os exemplos:"; } + { return "Esta é a lista com todos os exemplos:"; } /*! This is an introduction to the page with the list of related pages */ virtual QCString trRelatedPagesDescription() - { return "Esta é a lista de toda a documentação relacionadas:"; } + { return "Esta é a lista com toda a documentação relacionadas:"; } /*! This is an introduction to the page with the list of class/file groups */ virtual QCString trModulesDescription() - { return "Esta é a lista de todos os médulos:"; } + { return "Esta é a lista com todos os módulos:"; } /*! This sentences is used in the annotated class/file lists if no brief * description is given. @@ -304,7 +341,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! This is used in HTML as the title of index.html. */ virtual QCString trDocumentation() - { return "Documentação"; } + { return "\nDocumentação"; } /*! This is used in LaTeX as the title of the chapter with the * index of all groups. @@ -349,7 +386,16 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 * the documentation of all classes, structs and unions. */ virtual QCString trClassDocumentation() - { return "Classes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estruturas"; + } + else + { + return "Classes"; + } + } /*! This is used in LaTeX as the title of the chapter containing * the documentation of all files. @@ -413,7 +459,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 * list of (global) variables */ virtual QCString trEnumerationValues() - { return "Valores Enumerados"; } + { return "Valores enumerados"; } /*! This is used in the documentation of a file before the list of * documentation blocks for defines @@ -509,7 +555,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! this text is generated when the \\bug command is used. */ virtual QCString trBugsAndLimitations() - { return "Bugs e limitações"; } + { return "Problemas e Limitações"; } /*! this text is generated when the \\version command is used. */ virtual QCString trVersion() @@ -550,7 +596,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! used as an introduction to the namespace list */ virtual QCString trNamespaceListDescription(bool extractAll) { - QCString result="Aqui esta a lista de todos os Namespaces "; + QCString result="Esta é a lista de todos os Namespaces "; if (!extractAll) result+="documentados "; result+="com suas respectivas descrições:"; return result; @@ -582,7 +628,6 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 bool isTemplate) { QCString result="Referência da"; - if (isTemplate) result+=" Template de"; switch(compType) { @@ -612,13 +657,12 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 return result; } - /* these are for the member sections of a class, struct or union */ virtual QCString trPublicMembers() { return "Métodos Públicos"; } virtual QCString trPublicSlots() { return "Slots Públicos"; } virtual QCString trSignals() - { return "Signals"; } + { return "Sinais"; } virtual QCString trStaticPublicMembers() { return "Métodos Públicos Estáticos"; } virtual QCString trProtectedMembers() @@ -680,7 +724,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 */ virtual QCString trReimplementedFromList(int numEntries) { - return "Reimplementado de "+trWriteList(numEntries)+"."; + return "Reimplementação de "+trWriteList(numEntries)+"."; } /*! used in member documentation blocks to produce a list of @@ -688,7 +732,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 */ virtual QCString trReimplementedInList(int numEntries) { - return "Reimplementado em "+trWriteList(numEntries)+"."; + return "Reimplementado por "+trWriteList(numEntries)+"."; } /*! This is put above each page as a link to all members of namespaces. */ @@ -698,9 +742,9 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! This is an introduction to the page with all namespace members */ virtual QCString trNamespaceMemberDescription(bool extractAll) { - QCString result="Aqui está a lista de todos os membros do Namespace "; + QCString result="Esta é a lista com todos os membros do Namespace "; if (!extractAll) result+="documentados "; - result+="com links para "; + result+="com referências para "; if (extractAll) result+="a documentação de seus respectivos Namespaces:"; else @@ -711,7 +755,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 * index of all namespaces. */ virtual QCString trNamespaceIndex() - { return "Índice de Namespaces"; } + { return "Namespaces"; } /*! This is used in LaTeX as the title of the chapter containing * the documentation of all namespaces. @@ -851,7 +895,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! Text for the \\invariant command */ virtual QCString trInvariant() { - return "Invariável"; + return "Invariante"; } /*! Text shown before a multi-line variable/enum initialization */ virtual QCString trInitialValue() @@ -877,7 +921,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 } virtual QCString trPageIndex() { - return "Índice de Página"; + return "Índice da Página"; } ////////////////////////////////////////////////////////////////////////// @@ -886,7 +930,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 virtual QCString trNote() { - return "Nota"; + return "Observação"; } virtual QCString trPublicTypes() { @@ -905,7 +949,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 } virtual QCString trStaticPublicAttribs() { - return "Atributos Públicos Estáticos"; + return "Atributos Estáticos Públicos"; } virtual QCString trProtectedTypes() { @@ -917,7 +961,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 } virtual QCString trStaticProtectedAttribs() { - return "Atributos Protegidos Estáticos"; + return "Atributos Estáticos Protegidos"; } virtual QCString trPrivateTypes() { @@ -939,12 +983,12 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! Used as a marker that is put before a todo item */ virtual QCString trTodo() { - return "Tarefas Futuras"; + return "Futuras Atividades"; } /*! Used as the header of the todo list */ virtual QCString trTodoList() { - return "Lista de Tarefas Futuras"; + return "Lista de Futuras Atividades"; } ////////////////////////////////////////////////////////////////////////// @@ -965,8 +1009,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 } virtual QCString trInclByDepGraph() { - return "Este grafo mostra quais arquivos estão direta ou indiretamente " - "relacionados com este arquivo:"; + return "Este grafo mostra quais arquivos estão direta ou indiretamente relacionados com este arquivo:"; } virtual QCString trSince() { @@ -1120,7 +1163,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! The description of the package index page */ virtual QCString trPackageListDescription() { - return "Aqui está a lista de pacotes com suas respectivas descrições (se disponíveis):"; + return "Esta é a lista com os pacotes e suas respectivas descrições (se disponíveis):"; } /*! The link name in the Quick links header for each page */ virtual QCString trPackages() @@ -1145,12 +1188,12 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 /*! Used as a marker that is put before a \\bug item */ virtual QCString trBug() { - return "Bug"; + return "Problema"; } /*! Used as the header of the bug list */ virtual QCString trBugList() { - return "Lista de Bug"; + return "Lista de Problemas"; } ////////////////////////////////////////////////////////////////////////// @@ -1335,7 +1378,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 */ virtual QCString trImplementedInList(int numEntries) { - return "Implementado em "+trWriteList(numEntries)+"."; + return "Implementado por "+trWriteList(numEntries)+"."; } ////////////////////////////////////////////////////////////////////////// @@ -1362,5 +1405,22 @@ class TranslatorBrazilian: public TranslatorAdapter_1_2_18 return "Lista de Descontinuados(as)"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return "Eventos"; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return "Eventos"; + } + }; #endif diff --git a/src/translator_ca.h b/src/translator_ca.h index e00aec9..e232cde 100644 --- a/src/translator_ca.h +++ b/src/translator_ca.h @@ -278,7 +278,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_2_17 result+="documentats "; } result+=" amb enllaços a "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_cz.h b/src/translator_cz.h index ea59973..4e241a3 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -144,6 +144,9 @@ // 2002/07/29 // - The new trDeprecatedList() implemented. // +// 2002/10/15 +// - The new trEvents() and trEventDocumentation() implemented. +// // Todo // ---- // - The trReimplementedFromList() should pass the kind of the @@ -163,7 +166,7 @@ // probably slightly faster. -class TranslatorCzech : public TranslatorAdapter_1_2_18 +class TranslatorCzech : public Translator { private: /*! The decode() inline assumes the source written in the @@ -1534,6 +1537,24 @@ class TranslatorCzech : public TranslatorAdapter_1_2_18 { return decode("Seznam zastaralých prvkù"); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return "Události"; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return "Dokumentace událostí"; + } + }; #endif // TRANSLATOR_CZ_H diff --git a/src/translator_de.h b/src/translator_de.h index 41f2d45..9a94ae4 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -272,7 +272,7 @@ class TranslatorGerman : public TranslatorAdapter_1_2_17 result+="Strukturen und Varianten mit Verweisen auf "; else result+="Klassenelemente mit Verweisen auf "; - if (extractAll) { + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) result+="die Dokumentation zu jedem Element:"; else diff --git a/src/translator_dk.h b/src/translator_dk.h index 55ee6bd..2810157 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -265,7 +265,7 @@ class TranslatorDanish : public TranslatorAdapter_1_2_7 result+="klassemedlemmer"; } result+=" med links til "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_en.h b/src/translator_en.h index d89509a..b045524 100644 --- a/src/translator_en.h +++ b/src/translator_en.h @@ -278,7 +278,7 @@ class TranslatorEnglish : public Translator result+="class members"; } result+=" with links to "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_es.h b/src/translator_es.h index 73db6b7..f5b5d72 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -206,7 +206,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_2_7 QCString result="Lista de"; if (!extractAll) result+=" toda la documentación de"; result+=" los miembros de la clase con enlaces a "; - if (extractAll) + if (!extractAll) result+=" la documentación de cada clase:"; else result+=" la clase de la que forman parte:"; diff --git a/src/translator_fi.h b/src/translator_fi.h index 635589b..98a63b2 100644 --- a/src/translator_fi.h +++ b/src/translator_fi.h @@ -241,7 +241,7 @@ class TranslatorFinnish : public TranslatorEnglish QCString result="Täällä on lista kaikista "; // "Here is a list of all " if (!extractAll) result+="dokumentoiduista "; // "documented " result+="luokan jäsenistä linkitettynä "; // "class members with links to " - if (extractAll) + if (!extractAll) result+="jokaisen jäsenen luokkadokumentaatioon:"; // "the class documentation for each member:" else result+="luokkaan johon ne kuuluvat:"; // "the classes they belong to:" diff --git a/src/translator_fr.h b/src/translator_fr.h index a30fcd8..79645eb 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -213,7 +213,7 @@ class TranslatorFrench : public TranslatorAdapter_1_2_17 QCString result="Liste de tous les membres de classe "; if (!extractAll) result+="documentés "; result+="avec les liens vers "; - if (extractAll) result+="la documentation de la classe correspondante :"; + if (!extractAll) result+="la documentation de la classe correspondante :"; else result+="les classes auxquelles ils appartiennent :"; return result; } diff --git a/src/translator_gr.h b/src/translator_gr.h index 35988b3..0e701d6 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -251,7 +251,7 @@ class TranslatorGreek : public TranslatorAdapter_1_2_11 result+="êëÜóåùí"; } result+=" ìå óõíäÝóìïõò "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_hr.h b/src/translator_hr.h index c8e511c..c3b847d 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -172,7 +172,7 @@ class TranslatorCroatian : public TranslatorAdapter_1_2_18 else result+="èlanova struktura s linkovima na "; - if (extractAll) + if (!extractAll) { result+="dokumentaciju svakog èlana:"; } diff --git a/src/translator_hu.h b/src/translator_hu.h index 7f1ea5c..2a0797c 100644 --- a/src/translator_hu.h +++ b/src/translator_hu.h @@ -195,7 +195,7 @@ class TranslatorHungarian : public TranslatorAdapter_1_2_1 QCString result="Ez az összes "; if (!extractAll) result+="dokumentált "; result+="osztály összetevõ listája "; - if (extractAll) + if (!extractAll) result+="hivatkozással a hozzájuk tartózó osztály dokumentációra:"; else result+="az õket tartalmazó osztály megjelölésével:"; diff --git a/src/translator_nl.h b/src/translator_nl.h index 14f0edb..f07e089 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -123,7 +123,7 @@ class TranslatorDutch : public Translator QCString result="Hieronder volgt de lijst met alle "; if (!extractAll) result+="gedocumenteerde "; result+="klasse members met links naar "; - if (extractAll) result+="de klasse documentatie voor elke member:"; + if (!extractAll) result+="de klasse documentatie voor elke member:"; else result+="de klassen waartoe ze behoren:"; return result; } diff --git a/src/translator_no.h b/src/translator_no.h index 65a829c..e582072 100644 --- a/src/translator_no.h +++ b/src/translator_no.h @@ -144,7 +144,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_2_2 QCString result="Her følger en liste over alle "; if (!extractAll) result+="dokumenterte "; result+="klassemedlemmer med lenker til "; - if (extractAll) result+="klassedokumentasjonen for hvert medlem:"; + if (!extractAll) result+="klassedokumentasjonen for hvert medlem:"; else result+="klassene som de tilhører:"; return result; } diff --git a/src/translator_pl.h b/src/translator_pl.h index 7d16654..3754594 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -259,7 +259,7 @@ class TranslatorPolish : public TranslatorAdapter_1_2_17 result+="sk³adowych"; } result+=" wraz z odno¶nikami do "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_pt.h b/src/translator_pt.h index affe19e..eb05d0c 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -269,7 +269,7 @@ class TranslatorPortuguese : public TranslatorAdapter_1_2_18 result+=" documentadas"; } result+=" com links para "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_ro.h b/src/translator_ro.h index cc7183c..07c2bd9 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -287,7 +287,7 @@ class TranslatorRomanian: public TranslatorAdapter_1_2_16 result+="din toate clasele "; } result+=", cu legãturi cãtre "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_ru.h b/src/translator_ru.h index 87ac3e6..7083e37 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -20,8 +20,6 @@ * Andrey V. Stolyarov released Feb 14, 2001 * Alexandr V. Chelpanov <cav@cryptopro.ru> released Apr 21, 2001 * - * äÏÓÔÕÐÎÙ ÔÁË ÖÅ ÐÅÒÅ×ÏÄ ÐÒÉÍÅÒÏ× ÎÁ ÒÕÓÓËÉÊ ÑÚÙË ÐÏ email (ÓÍ. ×ÙÛÅ) - * * ðÒÉ ÐÅÒÅ×ÏÄÅ ÚÁÇÏÌÏ×ËÏ× ÓÌÏ×Á list É documentation ÕÂÒÁÎÙ. * * Modules ÐÅÒÅ×ÅÄÅÎÏ ËÁË ÇÒÕÐÐÙ, ÔÁË ËÁË ÍÏÄÕÌÉ ÞÁÝÅ ×ÓÅÇÏ × ÒÕÓÓËÏÍ @@ -50,7 +48,7 @@ #ifndef TRANSLATOR_RU_H #define TRANSLATOR_RU_H -class TranslatorRussian : public TranslatorAdapter_1_2_18 +class TranslatorRussian : public Translator { private: /*! The Decode() inline assumes the source written in the @@ -277,7 +275,7 @@ class TranslatorRussian : public TranslatorAdapter_1_2_18 result+="ÞÌÅÎÏ× ÓÔÒÕËÔÕÒ ÄÁÎÎÙÈ ÓÏ ÓÓÙÌËÁÍÉ ÎÁ "; else result+="ÞÌÅÎÏ× ËÌÁÓÓÏ× ÓÏ ÓÓÙÌËÁÍÉ ÎÁ "; - if(extractAll) + if(!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) result+="ÄÏËÕÍÅÎÔÁÃÉÀ ÐÏ ÓÔÒÕËÔÕÒÅ ÄÌÑ ËÁÖÄÏÇÏ ÞÌÅÎÁ."; @@ -1417,6 +1415,23 @@ class TranslatorRussian : public TranslatorAdapter_1_2_18 { return decode( "óÐÉÓÏË ÕÓÔÁÒÅ×ÛÉÈ ÏÐÒÅÄÅÌÅÎÉÊ É ÏÐÉÓÁÎÉÊ" ); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return decode( "óÏÂÙÔÉÑ" ); + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return decode( "CÏÂÙÔÉÑ" ); + } }; #endif diff --git a/src/translator_se.h b/src/translator_se.h index e69cdd9..5fba0d0 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -191,7 +191,7 @@ class TranslatorSwedish : public TranslatorEnglish QCString result="Här följer en lista över alla "; if (!extractAll) result+="dokumenterade "; result+="klassmedlemmar med länkar till "; - if (extractAll) result+="klassdokumentationen för varje medlem:"; + if (!extractAll) result+="klassdokumentationen för varje medlem:"; else result+="klasserna som de tillhör:"; return result; } diff --git a/src/translator_sk.h b/src/translator_sk.h index 1d70245..dfcb2db 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -263,7 +263,7 @@ class TranslatorSlovak : public TranslatorAdapter_1_2_18 result += "s odkazmi na "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_sr.h b/src/translator_sr.h index 17c0757..3047274 100644 --- a/src/translator_sr.h +++ b/src/translator_sr.h @@ -272,7 +272,7 @@ private: result+="èlanova klasa"; } result+=" sa linkovima na "; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/translator_tw.h b/src/translator_tw.h index f8b218f..57b9757 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -277,7 +277,7 @@ class TranslatorChinesetraditional : public TranslatorAdapter_1_2_16 result+="Ãþ§O¦¨û"; } result+=", ¨Ã¥B±a¦³³sµ²¦Ü"; - if (extractAll) + if (!extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { diff --git a/src/util.cpp b/src/util.cpp index 3d54f20..a265a15 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -895,7 +895,6 @@ void writeExample(OutputList &ol,ExampleSDict *ed) } - QCString argListToString(ArgumentList *al) { QCString result; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index e6cbd64..ca021c6 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -152,9 +152,9 @@ void XmlDocVisitor::visit(DocVerbatim *s) m_t << "</programlisting>"; break; case DocVerbatim::Verbatim: - m_t << "<preformatted>"; + m_t << "<verbatim>"; filter(s->text()); - m_t << "</preformatted>"; + m_t << "</verbatim>"; break; case DocVerbatim::HtmlOnly: m_t << "<htmlonly>"; @@ -193,9 +193,9 @@ void XmlDocVisitor::visit(DocInclude *inc) m_t << "</htmlonly>"; break; case DocInclude::VerbInclude: - m_t << "<preformatted>"; + m_t << "<verbatim>"; filter(inc->text()); - m_t << "</preformatted>"; + m_t << "</verbatim>"; break; } } @@ -693,12 +693,14 @@ void XmlDocVisitor::visitPost(DocInternalRef *) m_t << " "; } -void XmlDocVisitor::visitPre(DocCopy *) +void XmlDocVisitor::visitPre(DocCopy *c) { + m_t << "<copydoc link=\"" << c->link() << "\">"; } void XmlDocVisitor::visitPost(DocCopy *) { + m_t << "</copydoc>" << endl; } void XmlDocVisitor::visitPre(DocText *) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index cac773f..80054c8 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -41,42 +41,11 @@ // no debug info #define XML_DB(x) do {} while(0) - // debug to stdout //#define XML_DB(x) printf x - // debug inside output //#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t -// static QCString sectionTypeToString(BaseOutputDocInterface::SectionTypes t) -// { -// switch (t) -// { -// case BaseOutputDocInterface::See: return "see"; -// case BaseOutputDocInterface::Return: return "return"; -// case BaseOutputDocInterface::Author: return "author"; -// case BaseOutputDocInterface::Version: return "version"; -// case BaseOutputDocInterface::Since: return "since"; -// case BaseOutputDocInterface::Date: return "date"; -// case BaseOutputDocInterface::Bug: return "bug"; -// case BaseOutputDocInterface::Note: return "note"; -// case BaseOutputDocInterface::Warning: return "warning"; -// case BaseOutputDocInterface::Par: return "par"; -// case BaseOutputDocInterface::Deprecated: return "deprecated"; -// case BaseOutputDocInterface::Pre: return "pre"; -// case BaseOutputDocInterface::Post: return "post"; -// case BaseOutputDocInterface::Invar: return "invariant"; -// case BaseOutputDocInterface::Remark: return "remark"; -// case BaseOutputDocInterface::Attention: return "attention"; -// case BaseOutputDocInterface::Todo: return "todo"; -// case BaseOutputDocInterface::Test: return "test"; -// case BaseOutputDocInterface::RCS: return "rcs"; -// case BaseOutputDocInterface::EnumValues: return "enumvalues"; -// case BaseOutputDocInterface::Examples: return "examples"; -// } -// return "illegal"; -// } - inline void writeXMLString(QTextStream &t,const char *s) { @@ -325,820 +294,6 @@ class XMLCodeGenerator : public BaseCodeDocInterface bool m_insideSpecialHL; }; -// /*! This class is used by the documentation parser. -// * Its methods are called when some XML text or markup -// * needs to be written. -// */ -// class XMLGenerator : public OutputDocInterface -// { -// public: -// -// // helper functions -// -// void startParMode() -// { -// if (!m_inParStack.isEmpty() && !m_inParStack.top()) -// { -// m_inParStack.top() = TRUE; -// m_t << "<para>"; -// XML_DB(("start par at level=%d\n",m_inParStack.count())); -// } -// else if (m_inParStack.isEmpty()) -// { -// m_inParStack.push(TRUE); -// m_t << "<para>"; -// XML_DB(("start par at level=%d\n",m_inParStack.count())); -// } -// } -// void endParMode() -// { -// if (!m_inParStack.isEmpty() && m_inParStack.top()) -// { -// m_inParStack.top() = FALSE; -// m_t << "</para>" << endl; -// XML_DB(("end par at level=%d\n",m_inParStack.count())); -// } -// } -// void startNestedPar() -// { -// m_inParStack.push(FALSE); -// XML_DB(("enter par level=%d\n",m_inParStack.count())); -// } -// void endNestedPar() -// { -// XML_DB(("leave par level=%d\n",m_inParStack.count())); -// if (m_inParStack.pop()) -// { -// m_t << "</para>" << endl; -// } -// else -// { -// //XML_DB(("ILLEGAL par level!\n")); -// } -// } -// -// // Standard generator functions to be implemented by all generators -// -// void docify(const char *s) -// { -// if (m_outputEnabled) -// { -// XML_DB(("(docify \"%s\")\n",s)); -// startParMode(); -// writeXMLString(m_t,s); -// } -// } -// void writeChar(char c) -// { -// char s[2];s[0]=c;s[1]=0; -// docify(s); -// } -// void writeString(const char *text) -// { -// //m_t << text; -// docify(text); -// } -// void startItemList() -// { -// XML_DB(("(startItemList)\n")); -// startParMode(); -// m_t << "<itemizedlist>" << endl;; -// m_inListStack.push(TRUE); -// } -// void startEnumList() -// { -// XML_DB(("(startEnumList)\n")); -// startParMode(); -// m_t << "<orderedlist>"; -// m_inListStack.push(TRUE); -// } -// void writeListItem() -// { -// XML_DB(("(writeListItem)\n")); -// if (!m_inListStack.isEmpty() && m_inListStack.top()) // first element -// { -// m_inListStack.top()=FALSE; -// } -// else // not first element, end previous element first -// { -// endParMode(); -// endNestedPar(); -// m_t << "</listitem>" << endl; -// } -// m_t << "<listitem>"; -// startNestedPar(); -// } -// void endItemList() -// { -// XML_DB(("(endItemList)\n")); -// if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element -// { -// endParMode(); -// endNestedPar(); -// m_t << "</listitem>" << endl; -// } -// m_t << "</itemizedlist>" << endl; -// } -// void endEnumList() -// { -// XML_DB(("(endEnumList)\n")); -// if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element -// { -// endParMode(); -// m_t << "</listitem>" << endl; -// endNestedPar(); -// } -// m_t << "</orderedlist>" << endl; -// } -// void newParagraph() -// { -// XML_DB(("(newParagraph)\n")); -// endParMode(); -// startParMode(); -// } -// void startBold() -// { -// XML_DB(("(startBold)\n")); -// startParMode(); -// m_t << "<bold>"; // non DocBook -// } -// void endBold() -// { -// XML_DB(("(endBold)\n")); -// m_t << "</bold>"; // non DocBook -// } -// void startTypewriter() -// { -// XML_DB(("(startTypewriter)\n")); -// startParMode(); -// m_t << "<computeroutput>"; -// } -// void endTypewriter() -// { -// XML_DB(("(endTypewriter)\n")); -// m_t << "</computeroutput>"; -// } -// void startEmphasis() -// { -// XML_DB(("(startEmphasis)\n")); -// startParMode(); -// m_t << "<emphasis>"; -// } -// void endEmphasis() -// { -// XML_DB(("(endEmphasis)\n")); -// m_t << "</emphasis>"; -// } -// void startCodeFragment() -// { -// XML_DB(("(startCodeFragment)\n")); -// startParMode(); -// m_t << "<programlisting>"; -// } -// void endCodeFragment() -// { -// XML_DB(("(endCodeFragment)\n")); -// m_t << "</programlisting>"; -// } -// void startPreFragment() -// { -// XML_DB(("(startPreFragment)\n")); -// startParMode(); -// m_t << "<preformatted>"; -// } -// void endPreFragment() -// { -// XML_DB(("(endPreFragment)\n")); -// m_t << "</preformatted>"; -// } -// void startVerbatimFragment() -// { -// XML_DB(("(startVerbatimFragment)\n")); -// startParMode(); -// m_t << "<preformatted>"; -// } -// void endVerbatimFragment() -// { -// XML_DB(("(endVerbatimFragment)\n")); -// m_t << "</preformatted>"; -// } -// void writeRuler() -// { -// XML_DB(("(startParMode)\n")); -// startParMode(); -// m_t << "<hruler/>"; -// } -// void startDescription() -// { -// XML_DB(("(startDescription)\n")); -// startParMode(); -// m_t << "<variablelist>"; -// m_inListStack.push(TRUE); -// } -// void endDescription() -// { -// XML_DB(("(endDescription)\n")); -// if (!m_inListStack.isEmpty() && !m_inListStack.pop()) // first element -// { -// endNestedPar(); -// m_t << "</listitem>" << endl; -// } -// m_t << "</variablelist>"; -// if (!m_inListStack.isEmpty()) m_inListStack.pop(); -// } -// void startDescItem() -// { -// XML_DB(("(startDescItem)\n")); -// if (!m_inListStack.isEmpty() && m_inListStack.top()) // first element -// { -// m_inListStack.top()=FALSE; -// } -// else // not first element, end previous element first -// { -// endNestedPar(); -// m_t << "</listitem>"; -// } -// m_t << "<varlistentry><term>"; -// } -// void endDescItem() -// { -// XML_DB(("(endDescItem)\n")); -// m_t << "</term></varlistentry><listitem>"; -// startNestedPar(); -// } -// void startDescList(SectionTypes st) -// { -// XML_DB(("(startDescList)\n")); -// endParMode(); -// m_t << "<simplesect kind=\"" << sectionTypeToString(st); -// m_t << "\"><title>"; -// startNestedPar(); -// m_inParStack.top() = TRUE; -// } -// void endDescList() -// { -// XML_DB(("(endDescList)\n")); -// endNestedPar(); -// m_t << "</simplesect>"; -// } -// void startSimpleSect(SectionTypes st,const char *,const char *,const char *) -// { -// XML_DB(("(startSimpleSect)\n")); -// m_t << "<simplesect kind=\"" << sectionTypeToString(st) << "\">"; -// startNestedPar(); -// } -// void endSimpleSect() -// { -// XML_DB(("(endSimpleSect)\n")); -// endNestedPar(); -// m_t << "</simplesect>"; -// } -// void startParamList(ParamListTypes t,const char *) -// { -// XML_DB(("(startParamList)\n")); -// startParMode(); -// QCString kind; -// switch(t) -// { -// case Param: kind="param"; break; -// case RetVal: kind="retval"; break; -// case Exception: kind="exception"; break; -// } -// m_t << "<parameterlist kind=\"" << kind << "\">"; // non DocBook -// startNestedPar(); -// m_inParStack.top() = TRUE; -// m_inParamList = TRUE; -// } -// void endParamList() -// { -// XML_DB(("(endParamList)\n")); -// m_inParamList = FALSE; -// m_t << "</parameterlist>"; -// } -// void endDescTitle() -// { -// m_inParStack.top() = FALSE; -// endNestedPar(); -// XML_DB(("(endDescTitle)\n")); -// m_t << "</title>"; -// if (!m_inParamList) startNestedPar(); -// } -// void writeDescItem() -// { -// XML_DB(("(writeDescItem)\n")); -// } -// void startDescTable() -// { -// XML_DB(("(startDescTable)\n")); -// } -// void endDescTable() -// { -// XML_DB(("(endDescTable)\n")); -// } -// void startDescTableTitle() -// { -// XML_DB(("(startDescTableTitle)\n")); -// m_t << "<parametername>"; // non docbook -// } -// void endDescTableTitle() -// { -// XML_DB(("(endDescTableTitle)\n")); -// m_t << "</parametername>"; // non docbook -// } -// void startDescTableData() -// { -// XML_DB(("(startDescTableData)\n")); -// m_t << "<parameterdescription>"; // non docbook -// startNestedPar(); -// } -// void endDescTableData() -// { -// XML_DB(("(endDescTableData)\n")); -// endNestedPar(); -// m_t << "</parameterdescription>"; // non docbook -// } -// void lineBreak() -// { -// XML_DB(("(lineBreak)\n")); -// startParMode(); -// m_t << "<linebreak/>"; // non docbook -// } -// void writeNonBreakableSpace(int num) -// { -// XML_DB(("(writeNonBreakableSpace)\n")); -// int i;for (i=0;i<num;i++) m_t << " "; -// } -// -// void writeObjectLink(const char *ref,const char *file, -// const char *anchor, const char *text) -// { -// XML_DB(("(writeObjectLink)\n")); -// startParMode(); -// writeXMLLink(m_t,ref,file,anchor,text); -// } -// void writeCodeLink(const char *ref,const char *file, -// const char *anchor,const char *text) -// { -// XML_DB(("(writeCodeLink)\n")); -// writeXMLLink(m_t,ref,file,anchor,text); -// } -// void startHtmlLink(const char *url) -// { -// XML_DB(("(startHtmlLink)\n")); -// startParMode(); -// m_t << "<ulink url=\"" << url << "\">"; -// } -// void endHtmlLink() -// { -// XML_DB(("(endHtmlLink)\n")); -// m_t << "</ulink>"; -// } -// void writeMailLink(const char *url) -// { -// XML_DB(("(writeMailLink)\n")); -// startParMode(); -// m_t << "<email>"; -// docify(url); -// m_t << "</email>"; -// } -// void startSection(const char *id,const char *,SectionInfo::SectionType type) -// { -// XML_DB(("(startSection)\n")); -// endParMode(); -// m_t << "<sect"; -// switch(type) -// { -// case SectionInfo::Page: m_t << "1"; break; -// case SectionInfo::Section: m_t << "2"; break; -// case SectionInfo::Subsection: m_t << "3"; break; -// default: ASSERT(0); break; -// } -// m_t << " id=\"" << id << "\">"; -// startNestedPar(); -// m_inParStack.top() = TRUE; -// } -// void endSection(const char *,SectionInfo::SectionType type) -// { -// XML_DB(("(endSection)\n")); -// m_t << "</sect"; -// switch(type) -// { -// case SectionInfo::Page: m_t << "1"; break; -// case SectionInfo::Section: m_t << "2"; break; -// case SectionInfo::Subsection: m_t << "3"; break; -// default: ASSERT(0); break; -// } -// m_t << ">"; -// m_inParStack.top() = FALSE; -// endNestedPar(); -// } -// void startSubsection() -// { -// XML_DB(("(startSubsection)\n")); -// endParMode(); -// m_t << "<sect2>"; -// startNestedPar(); -// m_inParStack.top() = TRUE; -// } -// void endSubsection() -// { -// XML_DB(("(endSubsection)\n")); -// m_t << "</sect2>"; -// m_inParStack.top() = FALSE; -// endNestedPar(); -// } -// void startSubsubsection() -// { -// XML_DB(("(startSubsubsection)\n")); -// endParMode(); -// m_t << "<sect3>"; -// startNestedPar(); -// m_inParStack.top() = TRUE; -// } -// void endSubsubsection() -// { -// XML_DB(("(endSubsubsection)\n")); -// m_t << "</sect3>"; -// m_inParStack.top() = FALSE; -// endNestedPar(); -// } -// void startCenter() -// { -// XML_DB(("(startCenter)\n")); -// startParMode(); -// m_t << "<center>"; // non docbook -// } -// void endCenter() -// { -// XML_DB(("(endCenter)\n")); -// m_t << "</center>"; // non docbook -// } -// void startSmall() -// { -// XML_DB(("(startSmall)\n")); -// startParMode(); -// m_t << "<small>"; // non docbook -// } -// void endSmall() -// { -// XML_DB(("(endSmall)\n")); -// m_t << "</small>"; // non docbook -// } -// void startSubscript() -// { -// XML_DB(("(startSubscript)\n")); -// startParMode(); -// m_t << "<subscript>"; -// } -// void endSubscript() -// { -// XML_DB(("(endSubscript)\n")); -// m_t << "</subscript>"; -// } -// void startSuperscript() -// { -// XML_DB(("(startSuperscript)\n")); -// startParMode(); -// m_t << "<superscript>"; -// } -// void endSuperscript() -// { -// XML_DB(("(endSuperscript)\n")); -// m_t << "</superscript>"; -// } -// void startTable(bool,int cols) -// { -// XML_DB(("startTable\n")); -// startParMode(); -// m_t << "<table cols=\"" << cols << "\">\n"; -// } -// void endTable(bool hasCaption) -// { -// XML_DB(("endTable\n")); -// if (!hasCaption) m_t << "</row>\n"; -// m_t << "</table>"; -// } -// void startCaption() -// { -// XML_DB(("startCaption")); -// m_t << "</row><caption>"; -// } -// void endCaption() -// { -// XML_DB(("encCaption")); -// m_t << "</caption>"; -// } -// void nextTableRow() -// { -// XML_DB(("(nextTableRow)\n")); -// m_t << "<row><entry>"; -// -// // we need manually add a para here because cells are -// // parsed before the table is generated, and thus -// // are already parsed as if they are inside a paragraph. -// m_t << "<para>"; -// } -// void endTableRow() -// { -// XML_DB(("(endTableRow)\n")); -// m_t << "</row>" << endl; -// } -// void nextTableColumn() -// { -// XML_DB(("(nextTableColumn)\n")); -// m_t << "<entry>"; -// -// // we need manually add a para here because cells are -// // parsed before the table is generated, and thus -// // are already parsed as if they are inside a paragraph. -// m_t << "<para>"; -// } -// void endTableColumn() -// { -// XML_DB(("(endTableColumn)\n")); -// // we need manually add a para here because cells are -// // parsed before the table is generated, and thus -// // are already parsed as if they are inside a paragraph. -// m_t << "</para>"; -// m_t << "</entry>"; -// } -// -// void writeQuote() { m_t << "\""; } -// void writeCopyright() { m_t << "©"; } -// void writeUmlaut(char c) { m_t << "&" << c << "uml;"; } -// void writeAcute(char c) { m_t << "&" << c << "acute;"; } -// void writeGrave(char c) { m_t << "&" << c << "grave;"; } -// void writeCirc(char c) { m_t << "&" << c << "circ;"; } -// void writeTilde(char c) { m_t << "&" << c << "tilde;"; } -// void writeRing(char c) { m_t << "&" << c << "ring;"; } -// void writeSharpS() { m_t << "ß"; } -// void writeCCedil(char c) { m_t << "&" << c << "cedil;"; } -// -// void startTitle() -// { -// XML_DB(("(startTitle)\n")); -// m_t << "<title>"; -// startNestedPar(); -// m_inParStack.top() = TRUE; -// } -// void endTitle() -// { -// m_inParStack.top() = FALSE; -// endNestedPar(); -// XML_DB(("(endTitle)\n")); -// m_t << "</title>" << endl; -// } -// void writeAnchor(const char *id,const char *name) -// { -// XML_DB(("(writeAnchor)\n")); -// startParMode(); -// m_t << "<anchor id=\"" << id << "_1" << name << "\"/>"; -// } -// void writeSectionRef(const char *,const char *id, -// const char *name,const char *text) -// { -// XML_DB(("(writeSectionRef)\n")); -// startParMode(); -// m_t << "<link linkend=\"" << id << "_1" << name << "\">"; -// docify(text); -// m_t << "</link>"; -// } -// void writeSectionRefItem(const char *,const char *,const char *) -// { -// m_t << "(writeSectionRefItem)"; -// } -// void addIndexItem(const char *primaryie,const char *secondaryie) -// { -// XML_DB(("(addIndexItem)\n")); -// startParMode(); -// m_t << "<indexentry><primaryie>"; -// docify(primaryie); -// m_t << "</primaryie><secondaryie>"; -// docify(secondaryie); -// m_t << "</secondaryie></indexentry>"; -// } -// void writeFormula(const char *id,const char *text) -// { -// XML_DB(("(writeFormula)\n")); -// startParMode(); -// m_t << "<formula id=\"" << id << "\">"; // non Docbook -// docify(text); -// m_t << "</formula>"; -// } -// void startImage(const char *name,const char *size,bool /*caption*/) -// { -// XML_DB(("(startImage)\n")); -// startParMode(); -// m_t << "<image name=\"" << name << "\""; -// if (size) m_t << " size=\"" << size << "\""; -// m_t << ">"; // non docbook -// } -// void endImage(bool) -// { -// XML_DB(("(endImage)\n")); -// m_t << "</image>"; -// } -// void startDotFile(const char *name,bool /*caption*/) -// { -// XML_DB(("(startDotFile)\n")); -// startParMode(); -// m_t << "<dotfile name=\"" << name << "\">"; // non docbook -// } -// void endDotFile(bool) -// { -// XML_DB(("(endDotFile)\n")); -// m_t << "</dotfile>"; -// } -// void startTextLink(const char *name,const char *anchor) -// { -// XML_DB(("(startTextLink)\n")); -// startParMode(); -// m_t << "<ulink url=\"" << name << "#" << anchor << "\">"; -// } -// void endTextLink() -// { -// XML_DB(("(endTextLink)\n")); -// m_t << "</ulink>"; -// } -// void startPageRef() -// { -// XML_DB(("(startPageRef)\n")); -// m_outputEnabled = FALSE; -// } -// void endPageRef(const char *,const char *) -// { -// XML_DB(("(endPageRef)\n")); -// m_outputEnabled = TRUE; -// } -// void writeLineNumber(const char *extRef,const char *compId, -// const char *anchorId,int l) -// { -// XML_DB(("(writeLineNumber)\n")); -// m_t << "<linenumber"; -// m_t << " line=\"" << l << "\""; -// if (compId) -// { -// m_t << " refid=\"" << compId; -// if (anchorId) m_t << "_1" << anchorId; -// m_t << "\" kindref=\""; -// if (anchorId) m_t << "member"; else m_t << "compound"; -// m_t << "\""; -// if (extRef) m_t << " external=\"" << extRef << "\""; -// } -// m_t << "/>"; -// } -// void startCodeLine() -// { -// XML_DB(("(startCodeLine)\n")); -// startParMode(); -// m_t << "<codeline>"; // non DocBook -// } -// void endCodeLine() -// { -// XML_DB(("(endCodeLine)\n")); -// m_t << "</codeline>" << endl; // non DocBook -// } -// void startCodeAnchor(const char *id) -// { -// XML_DB(("(startCodeAnchor)\n")); -// startParMode(); -// m_t << "<anchor id=\"" << id << "\">"; -// } -// void endCodeAnchor() -// { -// XML_DB(("(endCodeAnchor)\n")); -// m_t << "</anchor>"; -// } -// void startFontClass(const char *colorClass) -// { -// XML_DB(("(startFontClass)\n")); -// m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook -// } -// void endFontClass() -// { -// XML_DB(("(endFontClass)\n")); -// m_t << "</highlight>"; // non DocBook -// } -// void codify(const char *text) -// { -// XML_DB(("(codify \"%s\")\n",text)); -// docify(text); -// } -// void startHtmlOnly() -// { -// XML_DB(("(startHtmlOnly)\n")); -// m_t << "<htmlonly>" << endl; -// } -// void endHtmlOnly() -// { -// XML_DB(("(endHtmlOnly)\n")); -// m_t << "</htmlonly>" << endl; -// } -// void startLatexOnly() -// { -// XML_DB(("(startLatexOnly)\n")); -// m_t << "<latexonly>" << endl; -// } -// void endLatexOnly() -// { -// XML_DB(("(endLatexOnly)\n")); -// m_t << "</latexonly>" << endl; -// } -// void startSectionRefList() -// { -// XML_DB(("(startSectionRefList)\n")); -// } -// void endSectionRefList() -// { -// XML_DB(("(endSectionRefList)\n")); -// } -// void writeCodeAnchor(const char *) -// { -// XML_DB(("(writeCodeAnchor)\n")); -// } -// -// // Generator specific functions -// -// /*! Create a clone of this generator. Uses the copy constructor */ -// OutputDocInterface *clone() -// { -// return new XMLGenerator(this); -// } -// /*! Append the output written to generator \a g to this generator */ -// void append(const OutputDocInterface *g) -// { -// const XMLGenerator *xg = (const XMLGenerator *)g; -// -// //printf("Appending \n>>>>\n`%s'\n<<<<\n and \n>>>>\n`%s'\n<<<<\n",getContents().data(),xg->getContents().data()); -// m_t << xg->getContents(); -// m_inParStack = xg->m_inParStack; -// m_inListStack = xg->m_inListStack; -// m_inParamList = xg->m_inParamList; -// } -// /*! constructor. -// */ -// XMLGenerator() -// { -// m_b.setBuffer(m_a); -// m_b.open( IO_WriteOnly ); -// m_t.setDevice(&m_b); -// m_t.setEncoding(QTextStream::Latin1); -// m_inParamList = FALSE; -// m_outputEnabled = TRUE; -// } -// /*! copy constructor */ -// XMLGenerator(const XMLGenerator *xg) -// { -// m_b.setBuffer(m_a); -// m_b.open( IO_WriteOnly ); -// m_t.setDevice(&m_b); -// m_t.setEncoding(QTextStream::Latin1); -// -// //printf("Cloning >>%s<< m_parStack.count()=%d\n", -// // xg->getContents().data(),xg->m_inParStack.count()); -// -// // copy state variables -// m_inParStack = xg->m_inParStack; -// m_inListStack = xg->m_inListStack; -// m_inParamList = xg->m_inParamList; -// m_outputEnabled = xg->m_outputEnabled; -// } -// /*! destructor */ -// virtual ~XMLGenerator() -// { -// } -// /*! Returns the output written to this generator as a string */ -// QCString getContents() const -// { -// QCString s; -// s.resize(m_a.size()+1); -// memcpy(s.data(),m_a.data(),m_a.size()); -// s.at(m_a.size())='\0'; -// return s; -// } -// -// private: -// // only one destination stream, so these do not have to be implemented -// void pushGeneratorState() {} -// void popGeneratorState() {} -// void disableAllBut(OutputGenerator::OutputType) {} -// void enableAll() {} -// void disableAll() {} -// void disable(OutputGenerator::OutputType) {} -// void enable(OutputGenerator::OutputType) {} -// bool isEnabled(OutputGenerator::OutputType) { return TRUE; } -// -// QTextStream m_t; -// QByteArray m_a; -// QBuffer m_b; -// -// ValStack<bool> m_inParStack; -// ValStack<bool> m_inListStack; -// bool m_inParamList; -// bool m_outputEnabled; -// -// friend void writeXMLCodeBlock(QTextStream &t,FileDef *fd); -// }; static void writeTemplateArgumentList(ArgumentList *al,QTextStream &t,const char *name,int indent) { @@ -1212,20 +367,6 @@ static void writeXMLDocBlock(QTextStream &t, delete xmlCodeGen; delete root; -/* - XMLGenerator *xmlGen = new XMLGenerator; - //xmlGen->startParMode(); - parseDoc(*xmlGen, - fileName, // input definition file - lineNr, // input definition line - scope, // scope (which should not be linked to) - md, // member (which should not be linked to) - stext+"\n" // actual text - ); - xmlGen->endParMode(); - t << xmlGen->getContents(); - delete xmlGen; -*/ } void writeXMLCodeBlock(QTextStream &t,FileDef *fd) @@ -1264,30 +405,6 @@ static void writeMemberReference(QTextStream &t,Definition *def,MemberDef *rmd,c } t << ">" << convertToXML(name) << "</" << tagName << ">" << endl; -#if 0 - Definition *d = rmd->getOuterScope(); - if (d==Doxygen::globalScope) d=rmd->getBodyDef(); - if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef()) - // link to definition in code - { - t << " <" << tagName << " id=\""; - t << rmd->getBodyDef()->getOutputFileBase() - << "_1" // encoded `:' character (see util.cpp:convertNameToFile) - << rmd->anchor() - << "\">" << convertToXML(name) << "</" - << tagName << ">" << endl; - } - else if (rmd->isLinkable() && d && d->isLinkable()) - // link to declaration in documentation (in absense of a definition) - { - t << " <" << tagName << " id=\""; - t << d->getOutputFileBase() - << "_1" // encoded `:' character (see util.cpp:convertNameToFile) - << rmd->anchor() - << "\">" << convertToXML(name) - << "</" << tagName << ">" << endl; - } -#endif } static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,Definition *def) @@ -2177,8 +1294,7 @@ static void generateXMLForPage(PageInfo *pi,QTextStream &ti) QTextStream t(&f); writeXMLHeader(t); - t << " <compounddef id=\""; - if (Config_getBool("CASE_SENSE_NAMES")) t << pi->name; else t << pi->name.lower(); + t << " <compounddef id=\"" << pageName; t << "\" kind=\"page\">" << endl; t << " <compoundname>" << convertToXML(pi->name) << "</compoundname>" << endl; SectionInfo *si = Doxygen::sectionDict.find(pi->name); |