📄 doc.l
字号:
}<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); }<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\*\&]+")" { if (!insideHtmlLink) { generateRef(*outDoc,className,yytext,inSeeBlock); } else { outDoc->docify(yytext); } BEGIN(DocScan); }<DocScan,DocRefName>{SCOPEMASK}("()")? { 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>[^ \t\r\n]+ { if (includeFileLength>0) skipUntil(yytext); BEGIN( DocScan ); }<DocLineKey>[^ \t\r\n]+ { if (includeFileLength>0) { if (firstLine) outDoc->startCodeFragment(); firstLine=FALSE; showLine(*outDoc,yytext); BEGIN( DocKeyEnd ); } else { BEGIN( DocScan ); } }<DocSkiplineKey>[^ \t\r\n]+ { if (includeFileLength>0) { if (firstLine) outDoc->startCodeFragment(); firstLine=FALSE; skipLine(*outDoc,yytext); BEGIN( DocKeyEnd ); } else { BEGIN( DocScan ); } }<DocUntilKey>[^ \t\r\n]+ { if (includeFileLength>0) { if (firstLine) outDoc->startCodeFragment(); firstLine=FALSE; showUntil(*outDoc,yytext); 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>"<"{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(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -