diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-12-22 10:14:03 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-12-22 10:14:03 (GMT) |
commit | 223e7de6478019c8eebcfd87085fe22d3bfeec0e (patch) | |
tree | 2297b1d3beea204dfe48f39e41a95286f5581e8e /src/doctokenizer.l | |
parent | 67e8d626fec0c4365106902dcd16b988b8cceb10 (diff) | |
download | Doxygen-223e7de6478019c8eebcfd87085fe22d3bfeec0e.zip Doxygen-223e7de6478019c8eebcfd87085fe22d3bfeec0e.tar.gz Doxygen-223e7de6478019c8eebcfd87085fe22d3bfeec0e.tar.bz2 |
various fixes and restructuring
Diffstat (limited to 'src/doctokenizer.l')
-rw-r--r-- | src/doctokenizer.l | 90 |
1 files changed, 25 insertions, 65 deletions
diff --git a/src/doctokenizer.l b/src/doctokenizer.l index fcaa516..a6276af 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -404,7 +404,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} %x St_Para %x St_Comment %x St_Title -%x St_Caption %x St_TitleN %x St_TitleQ %x St_TitleA @@ -860,12 +859,22 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} <St_Msc>. { /* msc text */ g_token->verb+=yytext; } -<St_PlantUMLOpt>{BLANK}*"{"[^}]*"}" { // skip curly brackets around the optional image name - g_token->sectionId = yytext; - g_token->sectionId = g_token->sectionId.stripWhiteSpace(); - g_token->sectionId = g_token->sectionId.left(g_token->sectionId.length()-1); - g_token->sectionId = g_token->sectionId.right(g_token->sectionId.length()-1); - g_token->sectionId = g_token->sectionId.stripWhiteSpace(); +<St_PlantUMLOpt>{BLANK}*"{"[^}]*"}" { // case 1: file name is specified as {filename} + g_token->sectionId = QCString(yytext).stripWhiteSpace(); + // skip curly brackets around the optional image name + g_token->sectionId = g_token->sectionId.mid(1,g_token->sectionId.length()-2).stripWhiteSpace(); + return RetVal_OK; + } +<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/{ID}"=" { // case 2: plain file name specified followed by an attribute + g_token->sectionId = QCString(yytext).stripWhiteSpace(); + return RetVal_OK; + } +<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}+/"\"" { // case 3: plain file name specified followed by a quoted title + g_token->sectionId = QCString(yytext).stripWhiteSpace(); + return RetVal_OK; + } +<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/\n { // case 4: plain file name specified without title or attributes + g_token->sectionId = QCString(yytext).stripWhiteSpace(); return RetVal_OK; } <St_PlantUMLOpt>. { @@ -881,22 +890,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} <St_PlantUML>. { /* plantuml text */ g_token->verb+=yytext; } -<St_Caption>"\"" { // quoted title - BEGIN(St_TitleQ); - return TK_WORD; - } -<St_Caption>[ \t]+ { - g_token->name=""; - g_token->chars=yytext; - return TK_WHITESPACE; - } -<St_Caption>\n { - unput(*yytext); - return 0; - } <St_Title>"\"" { // quoted title BEGIN(St_TitleQ); - } + } <St_Title>[ \t]+ { g_token->chars=yytext; return TK_WHITESPACE; @@ -921,6 +917,13 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} g_token->paramDir=TokenInfo::Unspecified; return TK_COMMAND; } +<St_TitleN>{ID}"=" { /* attribute */ + if (yytext[0]=='%') // strip % if present + g_token->name = &yytext[1]; + else + g_token->name = yytext; + return TK_WORD; + } <St_TitleN>{WORD1} | <St_TitleN>{WORD2} { /* word */ if (yytext[0]=='%') // strip % if present @@ -964,38 +967,9 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} unput(*yytext); return 0; } -<St_Caption>{BLANK}*"min"{BLANK}* { // title special case min / max - g_token->name = "min"; - BEGIN(St_TitleA); - return TK_WORD; - } -<St_Caption>{BLANK}*"max"{BLANK}* { // title special case min / max - g_token->name = "max"; - BEGIN(St_TitleA); - return TK_WORD; - } -<St_Caption>{BLANK}*"width="{BLANK}* { // title attribute - g_token->name = yytext; - g_token->name = g_token->name.stripWhiteSpace(); - BEGIN(St_TitleV); - } -<St_Caption>{BLANK}*"height="{BLANK}* { // title attribute - g_token->name = yytext; - g_token->name = g_token->name.stripWhiteSpace(); - BEGIN(St_TitleV); - } -<St_TitleA>{BLANK}*"min"{BLANK}* { // title special case min / max - g_token->name = "min"; - return TK_WORD; - } -<St_TitleA>{BLANK}*"max"{BLANK}* { // title special case min / max - g_token->name = "max"; - return TK_WORD; - } <St_TitleA>{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute g_token->name = yytext; - g_token->name = g_token->name.left( - g_token->name.find('=')).stripWhiteSpace(); + g_token->name = g_token->name.left(g_token->name.find('=')).stripWhiteSpace(); BEGIN(St_TitleV); } <St_TitleV>[^ \t\r\n]+ { // attribute value @@ -1003,10 +977,6 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4} BEGIN(St_TitleN); return TK_WORD; } -<St_TitleV,St_TitleA>[ \t] { - g_token->chars=yytext; - return TK_WHITESPACE; - } <St_TitleV,St_TitleA>. { unput(*yytext); return 0; @@ -1351,16 +1321,6 @@ void doctokenizerYYsetStateTitle() BEGIN(St_Title); } -void doctokenizerYYsetStateCaption() -{ - BEGIN(St_Caption); -} - -void doctokenizerYYsetStateTitleAttr() -{ - BEGIN(St_TitleA); -} - void doctokenizerYYsetStateTitleAttrValue() { BEGIN(St_TitleV); |