From f7cb7da5600476fb65b70582a0806a7511b58f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 13 Jul 2009 13:35:33 +0200 Subject: [PATCH] doxygen: updated a few comments --- src/main.cpp | 19 +++++++++++-------- src/token.h | 11 ++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index abd088203..ec9e5c5db 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,14 +17,17 @@ */ -/** @mainpage - * Overview \n - * The source code is first tokenized and then checked. \n - * \n - * Writing checks \n +/** + * + * @mainpage Cppcheck + * + * @section overview_sec Overview + * The source code is first tokenized and then checked. + * + * @section writing_checks_sec Writing checks * The checks are written in C++. Below is a simple example of a check * that detect division with zero: - * \code + * @code void CheckOther::checkZeroDivision() { for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) @@ -33,11 +36,11 @@ void CheckOther::checkZeroDivision() reportError(tok, "error", "zerodiv", "Division by zero"); } } - \endcode + @endcode + * */ - #include "cppcheckexecutor.h" /** diff --git a/src/token.h b/src/token.h index 6171ea800..26bded969 100644 --- a/src/token.h +++ b/src/token.h @@ -21,6 +21,16 @@ #include +/** + * @brief The token list that the Tokenizer generates is a linked-list of this class. + * + * Tokens are stored as strings. The "if", "while", etc are stored in plain text. + * The reason the Token class is needed (instead of using the string class) is that some extra functionality is also needed for tokens: + * - location of the token is stored (linenr, fileIndex) + * - functions for classifying the token (isName, isNumber, isBoolean, isStandardType) + * + * The Token class also has other functions for management of token list, matching tokens, etc. + */ class Token { public: @@ -126,7 +136,6 @@ public: */ static int multiCompare(const char *haystack, const char *needle); - unsigned int linenr() const; void linenr(unsigned int linenr);