Get rid of meaningless return type of DoxygenParser methods
The return value of methods handling various Doxygen commands was never actually used, so just get rid of it and don't return anything, this makes the code slightly simpler without any change of functionality. It also makes the question about why all these functions return "int" (which should have been "bool" from the beginning) obsolete.
This commit is contained in:
parent
71c4e55fd9
commit
4e7dad2b76
2 changed files with 122 additions and 115 deletions
|
|
@ -393,19 +393,20 @@ void DoxygenParser::skipEndOfLine()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addSimpleCommand(const std::string &theCommand,
|
void
|
||||||
DoxygenEntityList &doxyList)
|
DoxygenParser::addSimpleCommand(const std::string &theCommand,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
||||||
doxyList.push_back(DoxygenEntity(theCommand));
|
doxyList.push_back(DoxygenEntity(theCommand));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandWord(const std::string &theCommand,
|
void
|
||||||
const TokenList &,
|
DoxygenParser::addCommandWord(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -420,17 +421,16 @@ int DoxygenParser::addCommandWord(const std::string &theCommand,
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
} else {
|
} else {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandLine(const std::string &theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommandLine(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -438,12 +438,12 @@ int DoxygenParser::addCommandLine(const std::string &theCommand,
|
||||||
DoxygenEntityList aNewList = parse(endOfLine, tokList);
|
DoxygenEntityList aNewList = parse(endOfLine, tokList);
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
skipEndOfLine();
|
skipEndOfLine();
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandParagraph(const std::string &theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommandParagraph(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -452,30 +452,30 @@ int DoxygenParser::addCommandParagraph(const std::string &theCommand,
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList = parse(endOfParagraph, tokList);
|
aNewList = parse(endOfParagraph, tokList);
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandEndCommand(const std::string &theCommand,
|
void
|
||||||
const TokenList & tokList,
|
DoxygenParser::addCommandEndCommand(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList & tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
TokenListCIt endCommand = getEndCommand("end" + theCommand, tokList);
|
TokenListCIt endCommand = getEndCommand("end" + theCommand, tokList);
|
||||||
if (endCommand == tokList.end()) {
|
if (endCommand == tokList.end()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_EXPECTED, "Expected end" + theCommand);
|
printListError(WARN_DOXYGEN_COMMAND_EXPECTED, "Expected end" + theCommand);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList = parse(endCommand, tokList);
|
aNewList = parse(endCommand, tokList);
|
||||||
m_tokenListIt++;
|
m_tokenListIt++;
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandWordParagraph(const std::string &theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommandWordParagraph(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -485,19 +485,19 @@ int DoxygenParser::addCommandWordParagraph(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
TokenListCIt endOfParagraph = getEndOfParagraph(tokList);
|
TokenListCIt endOfParagraph = getEndOfParagraph(tokList);
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList = parse(endOfParagraph, tokList);
|
aNewList = parse(endOfParagraph, tokList);
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandWordLine(const std::string &theCommand,
|
void
|
||||||
const TokenList & tokList,
|
DoxygenParser::addCommandWordLine(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList & tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -505,7 +505,7 @@ int DoxygenParser::addCommandWordLine(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenListCIt endOfLine = getOneLine(tokList);
|
TokenListCIt endOfLine = getOneLine(tokList);
|
||||||
|
|
@ -513,13 +513,13 @@ int DoxygenParser::addCommandWordLine(const std::string &theCommand,
|
||||||
aNewList = parse(endOfLine, tokList);
|
aNewList = parse(endOfLine, tokList);
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
//else cout << "No line followed " << theCommand << " command. Not added" << endl;
|
//else cout << "No line followed " << theCommand << " command. Not added" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandWordOWordOWord(const std::string &theCommand,
|
void
|
||||||
const TokenList &,
|
DoxygenParser::addCommandWordOWordOWord(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -528,7 +528,7 @@ int DoxygenParser::addCommandWordOWordOWord(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string headerfile = getNextWord();
|
std::string headerfile = getNextWord();
|
||||||
std::string headername = getNextWord();
|
std::string headername = getNextWord();
|
||||||
|
|
@ -539,12 +539,12 @@ int DoxygenParser::addCommandWordOWordOWord(const std::string &theCommand,
|
||||||
if (!headername.empty())
|
if (!headername.empty())
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", headername));
|
aNewList.push_back(DoxygenEntity("plainstd::string", headername));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandOWord(const std::string &theCommand,
|
void
|
||||||
const TokenList &,
|
DoxygenParser::addCommandOWord(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -553,48 +553,48 @@ int DoxygenParser::addCommandOWord(const std::string &theCommand,
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandErrorThrow(const std::string &theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommandErrorThrow(const std::string &theCommand,
|
||||||
DoxygenEntityList &)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &)
|
||||||
{
|
{
|
||||||
|
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"Encountered: " + theCommand
|
"Encountered: " + theCommand
|
||||||
+ "\nThis command should not have been encountered. Behaviour past this may be unpredictable");
|
+ "\nThis command should not have been encountered. Behaviour past this may be unpredictable");
|
||||||
m_tokenListIt = getOneLine(tokList);
|
m_tokenListIt = getOneLine(tokList);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandHtml(const std::string &theCommand,
|
void
|
||||||
const TokenList &,
|
DoxygenParser::addCommandHtml(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
||||||
std::string htmlTagArgs = getNextToken();
|
std::string htmlTagArgs = getNextToken();
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, htmlTagArgs));
|
doxyList.push_back(DoxygenEntity(theCommand, htmlTagArgs));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandHtmlEntity(const std::string &theCommand,
|
void
|
||||||
const TokenList &,
|
DoxygenParser::addCommandHtmlEntity(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
|
|
||||||
static std::map<std::string, std::string> endCommands;
|
static std::map<std::string, std::string> endCommands;
|
||||||
|
|
@ -613,19 +613,19 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (key.empty()) {
|
if (key.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No key followed " + theCommand + " command. Not added");
|
"No key followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string heading = getNextWord();
|
std::string heading = getNextWord();
|
||||||
if (key.empty()) {
|
if (key.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No heading followed " + theCommand + " command. Not added");
|
"No heading followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string title = getNextWord();
|
std::string title = getNextWord();
|
||||||
if (title.empty()) {
|
if (title.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No title followed " + theCommand + " command. Not added");
|
"No title followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
TokenListCIt endOfParagraph = getEndOfParagraph(tokList);
|
TokenListCIt endOfParagraph = getEndOfParagraph(tokList);
|
||||||
aNewList = parse(endOfParagraph, tokList);
|
aNewList = parse(endOfParagraph, tokList);
|
||||||
|
|
@ -633,7 +633,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", heading));
|
aNewList.push_front(DoxygenEntity("plainstd::string", heading));
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", key));
|
aNewList.push_front(DoxygenEntity("plainstd::string", key));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// \ingroup (<groupname> [<groupname> <groupname>])
|
// \ingroup (<groupname> [<groupname> <groupname>])
|
||||||
else if (theCommand == "ingroup") {
|
else if (theCommand == "ingroup") {
|
||||||
|
|
@ -646,7 +645,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// \par [(paragraph title)] { paragraph }
|
// \par [(paragraph title)] { paragraph }
|
||||||
else if (theCommand == "par") {
|
else if (theCommand == "par") {
|
||||||
|
|
@ -657,7 +655,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
aNewList2 = parse(endOfParagraph, tokList);
|
aNewList2 = parse(endOfParagraph, tokList);
|
||||||
aNewList.splice(aNewList.end(), aNewList2);
|
aNewList.splice(aNewList.end(), aNewList2);
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// \headerfile <header-file> [<header-name>]
|
// \headerfile <header-file> [<header-name>]
|
||||||
else if (theCommand == "headerfile") {
|
else if (theCommand == "headerfile") {
|
||||||
|
|
@ -668,7 +665,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// \overload [(function declaration)]
|
// \overload [(function declaration)]
|
||||||
else if (theCommand == "overload") {
|
else if (theCommand == "overload") {
|
||||||
|
|
@ -679,7 +675,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
} else
|
} else
|
||||||
doxyList.push_back(DoxygenEntity(theCommand));
|
doxyList.push_back(DoxygenEntity(theCommand));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// \weakgroup <name> [(title)]
|
// \weakgroup <name> [(title)]
|
||||||
else if (theCommand == "weakgroup") {
|
else if (theCommand == "weakgroup") {
|
||||||
|
|
@ -689,7 +684,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
TokenListCIt endOfLine = getOneLine(tokList);
|
TokenListCIt endOfLine = getOneLine(tokList);
|
||||||
|
|
@ -707,7 +702,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No key followed " + theCommand + " command. Not added");
|
"No key followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
aNewList.push_front(DoxygenEntity("plainstd::string", name));
|
||||||
|
|
@ -737,7 +732,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No name followed " + theCommand + " command. Not added");
|
"No name followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string text = getNextWord();
|
std::string text = getNextWord();
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
aNewList.push_back(DoxygenEntity("plainstd::string", name));
|
||||||
|
|
@ -786,7 +781,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (file.empty()) {
|
if (file.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No file followed " + theCommand + " command. Not added");
|
"No file followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string caption = getNextWord();
|
std::string caption = getNextWord();
|
||||||
aNewList.push_back(DoxygenEntity("plainstd::string", file));
|
aNewList.push_back(DoxygenEntity("plainstd::string", file));
|
||||||
|
|
@ -802,13 +797,13 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (format.empty()) {
|
if (format.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No format followed " + theCommand + " command. Not added");
|
"No format followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string file = getNextWord();
|
std::string file = getNextWord();
|
||||||
if (file.empty()) {
|
if (file.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No name followed " + theCommand + " command. Not added");
|
"No name followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
std::string caption = getNextWord();
|
std::string caption = getNextWord();
|
||||||
std::string size = getNextWord();
|
std::string size = getNextWord();
|
||||||
|
|
@ -831,7 +826,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"There should be at least one word following the '" + theCommand
|
"There should be at least one word following the '" + theCommand
|
||||||
+ "' command. Command ignored.");
|
+ "' command. Command ignored.");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
TokenListCIt endOfLine = getOneLine(tokList);
|
TokenListCIt endOfLine = getOneLine(tokList);
|
||||||
|
|
@ -857,7 +852,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (cond.empty()) {
|
if (cond.empty()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
printListError(WARN_DOXYGEN_COMMAND_ERROR,
|
||||||
"No word followed " + theCommand + " command. Not added");
|
"No word followed " + theCommand + " command. Not added");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -887,7 +882,7 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
if (endCommand == tokList.end()) {
|
if (endCommand == tokList.end()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_EXPECTED,
|
printListError(WARN_DOXYGEN_COMMAND_EXPECTED,
|
||||||
"No corresponding endif found");
|
"No corresponding endif found");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DoxygenEntityList aNewList;
|
DoxygenEntityList aNewList;
|
||||||
|
|
@ -898,7 +893,6 @@ int DoxygenParser::addCommandUnique(const std::string &theCommand,
|
||||||
aNewList.push_front(DoxygenEntity("plainstd::string", cond));
|
aNewList.push_front(DoxygenEntity("plainstd::string", cond));
|
||||||
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
doxyList.push_back(DoxygenEntity(theCommand, aNewList));
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String* DoxygenParser::getIgnoreFeature(const std::string& theCommand,
|
String* DoxygenParser::getIgnoreFeature(const std::string& theCommand,
|
||||||
|
|
@ -935,16 +929,17 @@ string DoxygenParser::getIgnoreFeatureEndCommand(const std::string& theCommand)
|
||||||
return endCommand;
|
return endCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::ignoreCommand(const std::string& theCommand,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::ignoreCommand(const std::string& theCommand,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
const string endCommand = getIgnoreFeatureEndCommand(theCommand);
|
const string endCommand = getIgnoreFeatureEndCommand(theCommand);
|
||||||
if (!endCommand.empty()) {
|
if (!endCommand.empty()) {
|
||||||
TokenListCIt itEnd = getEndCommand(endCommand, tokList);
|
TokenListCIt itEnd = getEndCommand(endCommand, tokList);
|
||||||
if (itEnd == tokList.end()) {
|
if (itEnd == tokList.end()) {
|
||||||
printListError(WARN_DOXYGEN_COMMAND_EXPECTED, "Expected " + endCommand);
|
printListError(WARN_DOXYGEN_COMMAND_EXPECTED, "Expected " + endCommand);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we ignore the command, also ignore any whitespace preceding it as we
|
// If we ignore the command, also ignore any whitespace preceding it as we
|
||||||
|
|
@ -975,7 +970,7 @@ int DoxygenParser::ignoreCommand(const std::string& theCommand,
|
||||||
"Invalid \"doxygen:ignore\" feature \"contents\" attribute \"%s\".\n",
|
"Invalid \"doxygen:ignore\" feature \"contents\" attribute \"%s\".\n",
|
||||||
Char(contents)
|
Char(contents)
|
||||||
);
|
);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -996,16 +991,15 @@ int DoxygenParser::ignoreCommand(const std::string& theCommand,
|
||||||
"Invalid \"doxygen:ignore\" feature \"range\" attribute \"%s\".\n",
|
"Invalid \"doxygen:ignore\" feature \"range\" attribute \"%s\".\n",
|
||||||
Char(range)
|
Char(range)
|
||||||
);
|
);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommand(const std::string &commandString,
|
void
|
||||||
const TokenList &tokList,
|
DoxygenParser::addCommand(const std::string &commandString,
|
||||||
DoxygenEntityList &doxyList)
|
const TokenList &tokList,
|
||||||
|
DoxygenEntityList &doxyList)
|
||||||
{
|
{
|
||||||
|
|
||||||
string theCommand = stringToLower(commandString);
|
string theCommand = stringToLower(commandString);
|
||||||
|
|
@ -1015,38 +1009,52 @@ int DoxygenParser::addCommand(const std::string &commandString,
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing plain std::string :" << nextPhrase << endl;
|
cout << "Parsing plain std::string :" << nextPhrase << endl;
|
||||||
doxyList.push_back(DoxygenEntity("plainstd::string", nextPhrase));
|
doxyList.push_back(DoxygenEntity("plainstd::string", nextPhrase));
|
||||||
return 1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (commandBelongs(commandString)) {
|
switch (commandBelongs(commandString)) {
|
||||||
case SIMPLECOMMAND:
|
case SIMPLECOMMAND:
|
||||||
return addSimpleCommand(theCommand, doxyList);
|
addSimpleCommand(theCommand, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDWORD:
|
case COMMANDWORD:
|
||||||
return addCommandWord(theCommand, tokList, doxyList);
|
addCommandWord(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDLINE:
|
case COMMANDLINE:
|
||||||
return addCommandLine(theCommand, tokList, doxyList);
|
addCommandLine(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDPARAGRAPH:
|
case COMMANDPARAGRAPH:
|
||||||
return addCommandParagraph(theCommand, tokList, doxyList);
|
addCommandParagraph(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDENDCOMMAND:
|
case COMMANDENDCOMMAND:
|
||||||
return addCommandEndCommand(theCommand, tokList, doxyList);
|
addCommandEndCommand(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDWORDPARAGRAPH:
|
case COMMANDWORDPARAGRAPH:
|
||||||
return addCommandWordParagraph(theCommand, tokList, doxyList);
|
addCommandWordParagraph(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDWORDLINE:
|
case COMMANDWORDLINE:
|
||||||
return addCommandWordLine(theCommand, tokList, doxyList);
|
addCommandWordLine(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDWORDOWORDWORD:
|
case COMMANDWORDOWORDWORD:
|
||||||
return addCommandWordOWordOWord(theCommand, tokList, doxyList);
|
addCommandWordOWordOWord(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDOWORD:
|
case COMMANDOWORD:
|
||||||
return addCommandOWord(theCommand, tokList, doxyList);
|
addCommandOWord(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDERRORTHROW:
|
case COMMANDERRORTHROW:
|
||||||
return addCommandErrorThrow(theCommand, tokList, doxyList);
|
addCommandErrorThrow(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMANDUNIQUE:
|
case COMMANDUNIQUE:
|
||||||
return addCommandUnique(theCommand, tokList, doxyList);
|
addCommandUnique(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMAND_HTML:
|
case COMMAND_HTML:
|
||||||
return addCommandHtml(theCommand, tokList, doxyList);
|
addCommandHtml(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMAND_HTML_ENTITY:
|
case COMMAND_HTML_ENTITY:
|
||||||
return addCommandHtmlEntity(theCommand, tokList, doxyList);
|
addCommandHtmlEntity(theCommand, tokList, doxyList);
|
||||||
|
break;
|
||||||
case COMMAND_IGNORE:
|
case COMMAND_IGNORE:
|
||||||
return ignoreCommand(commandString, tokList, doxyList);
|
ignoreCommand(commandString, tokList, doxyList);
|
||||||
|
break;
|
||||||
case NONE:
|
case NONE:
|
||||||
case END_LINE:
|
case END_LINE:
|
||||||
case PARAGRAPH_END:
|
case PARAGRAPH_END:
|
||||||
|
|
@ -1055,7 +1063,6 @@ int DoxygenParser::addCommand(const std::string &commandString,
|
||||||
// TODO: Ensure that these values either are correctly ignored here or can't happen.
|
// TODO: Ensure that these values either are correctly ignored here or can't happen.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ private:
|
||||||
* Plain commands, such as newline etc, they contain no other data
|
* Plain commands, such as newline etc, they contain no other data
|
||||||
* \n \\ \@ \& \$ \# \< \> \%
|
* \n \\ \@ \& \$ \# \< \> \%
|
||||||
*/
|
*/
|
||||||
int addSimpleCommand(const std::string &theCommand,
|
void addSimpleCommand(const std::string &theCommand,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
* CommandWord
|
* CommandWord
|
||||||
|
|
@ -250,7 +250,7 @@ private:
|
||||||
* "relates", "namespace", "relatesalso","anchor", "dontinclude", "include",
|
* "relates", "namespace", "relatesalso","anchor", "dontinclude", "include",
|
||||||
* "includelineno"
|
* "includelineno"
|
||||||
*/
|
*/
|
||||||
int addCommandWord(const std::string &theCommand,
|
void addCommandWord(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -260,7 +260,7 @@ private:
|
||||||
* "addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip",
|
* "addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip",
|
||||||
* "until", "property"
|
* "until", "property"
|
||||||
*/
|
*/
|
||||||
int addCommandLine(const std::string &theCommand,
|
void addCommandLine(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -271,7 +271,7 @@ private:
|
||||||
* "details", "invariant", "deprecated", "date", "note", "warning",
|
* "details", "invariant", "deprecated", "date", "note", "warning",
|
||||||
* "version", "todo", "bug", "attention", "brief", "arg", "author"
|
* "version", "todo", "bug", "attention", "brief", "arg", "author"
|
||||||
*/
|
*/
|
||||||
int addCommandParagraph(const std::string &theCommand,
|
void addCommandParagraph(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -283,7 +283,7 @@ private:
|
||||||
* "link"
|
* "link"
|
||||||
* Returns 1 if success, 0 if the endcommand is never encountered.
|
* Returns 1 if success, 0 if the endcommand is never encountered.
|
||||||
*/
|
*/
|
||||||
int addCommandEndCommand(const std::string &theCommand,
|
void addCommandEndCommand(const std::string &theCommand,
|
||||||
const TokenList & tokList,
|
const TokenList & tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -292,7 +292,7 @@ private:
|
||||||
* Commands such as param
|
* Commands such as param
|
||||||
* "param", "tparam", "throw", "throws", "retval", "exception"
|
* "param", "tparam", "throw", "throws", "retval", "exception"
|
||||||
*/
|
*/
|
||||||
int addCommandWordParagraph(const std::string &theCommand,
|
void addCommandWordParagraph(const std::string &theCommand,
|
||||||
const TokenList & tokList,
|
const TokenList & tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -301,7 +301,7 @@ private:
|
||||||
* Commands such as param
|
* Commands such as param
|
||||||
* "page", "subsection", "subsubsection", "section", "paragraph", "defgroup"
|
* "page", "subsection", "subsubsection", "section", "paragraph", "defgroup"
|
||||||
*/
|
*/
|
||||||
int addCommandWordLine(const std::string &theCommand,
|
void addCommandWordLine(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -310,7 +310,7 @@ private:
|
||||||
* Commands such as class
|
* Commands such as class
|
||||||
* "category", "class", "protocol", "interface", "struct", "union"
|
* "category", "class", "protocol", "interface", "struct", "union"
|
||||||
*/
|
*/
|
||||||
int addCommandWordOWordOWord(const std::string &theCommand,
|
void addCommandWordOWordOWord(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
/*
|
/*
|
||||||
|
|
@ -319,7 +319,7 @@ private:
|
||||||
* Commands such as dir
|
* Commands such as dir
|
||||||
* "dir", "file", "cond"
|
* "dir", "file", "cond"
|
||||||
*/
|
*/
|
||||||
int addCommandOWord(const std::string &theCommand,
|
void addCommandOWord(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
|
|
@ -327,22 +327,22 @@ private:
|
||||||
* Commands that should not be encountered (such as PHP only)
|
* Commands that should not be encountered (such as PHP only)
|
||||||
* goes til the end of line then returns
|
* goes til the end of line then returns
|
||||||
*/
|
*/
|
||||||
int addCommandErrorThrow(const std::string &theCommand,
|
void addCommandErrorThrow(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
int addCommandHtml(const std::string &theCommand,
|
void addCommandHtml(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
int addCommandHtmlEntity(const std::string &theCommand,
|
void addCommandHtmlEntity(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*Adds the unique commands- different process for each unique command
|
*Adds the unique commands- different process for each unique command
|
||||||
*/
|
*/
|
||||||
int addCommandUnique(const std::string &theCommand,
|
void addCommandUnique(const std::string &theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
|
|
@ -350,7 +350,7 @@ private:
|
||||||
* Simply ignore the given command, possibly with the word following it or
|
* Simply ignore the given command, possibly with the word following it or
|
||||||
* until the matching end command.
|
* until the matching end command.
|
||||||
*/
|
*/
|
||||||
int ignoreCommand(const std::string& theCommand,
|
void ignoreCommand(const std::string& theCommand,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
|
|
@ -358,7 +358,7 @@ private:
|
||||||
* The actual "meat" of the doxygen parser. Calls the correct addCommand...()
|
* The actual "meat" of the doxygen parser. Calls the correct addCommand...()
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
int addCommand(const std::string &commandString,
|
void addCommand(const std::string &commandString,
|
||||||
const TokenList &tokList,
|
const TokenList &tokList,
|
||||||
DoxygenEntityList &doxyList);
|
DoxygenEntityList &doxyList);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue