3131 * - %SymbolDatabase - Information about all types/variables/functions/etc
3232 * in the current translation unit
3333 * - Library - Configuration of functions/types
34- * - Value flow analysis - Context sensitive analysis that determine possible values for each token
34+ * - Value flow analysis - Data flow analysis that determine possible values for each token
3535 *
36- * Use --debug on the command line to see debug output for the token list
37- * and the syntax tree. If both --debug and --verbose is used, the symbol
36+ * Use --debug-normal on the command line to see debug output for the token list
37+ * and the syntax tree. If both --debug-normal and --verbose is used, the symbol
3838 * database is also written.
3939 *
40- * The checks are written in C++. The checks are addons that can be
41- * easily added/removed.
42- *
43- * @section writing_checks_sec Writing a check
44- * Below is a simple example of a check that detect division with zero:
45- * @code
46- void CheckOther::checkZeroDivision()
47- {
48- // Iterate through all tokens in the token list
49- for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
50- {
51- // is this a division or modulo?
52- if (Token::Match(tok, "[/%]")) {
53- // try to get value '0' of rhs
54- const ValueFlow::Value *value = tok->astOperand2()->getValue(0);
55-
56- // if 'value' is not NULL, rhs can be zero.
57- if (value)
58- reportError(tok, Severity::error, "zerodiv", "Division by zero");
59- }
60- }
61- }
62- @endcode
63- *
64- * The function Token::Match is often used in the checks. Through it
65- * you can match tokens against patterns. It is currently not possible
66- * to write match expressions that uses the syntax tree, the symbol database,
67- * nor the library. Only the token list is used.
68- *
69- * @section checkclass_sec Creating a new check class from scratch
70- * %Check classes inherit from the Check class. The Check class specifies the interface that you must use.
71- * To integrate a check class into cppcheck all you need to do is:
72- * - Add your source file(s) so they are compiled into the executable.
73- * - Create an instance of the class (the Check::Check() constructor registers the class as an addon that Cppcheck then can use).
74- *
75- *
76- * @section embedding_sec Embedding Cppcheck
77- * Cppcheck is designed to be easily embeddable into other programs.
78- *
79- * The "cli/main.cpp" and "cli/cppcheckexecutor.*" files illustrate how cppcheck
80- * can be embedded into an application.
81- *
40+ * The checks are written in C++.
8241 *
8342 * @section detailed_overview_sec Detailed overview
8443 * This happens when you execute cppcheck from the command line:
8544 * -# CppCheckExecutor::check this function executes the Cppcheck
86- * -# CppCheck ::parseFromArgs parse command line arguments
45+ * -# CmdLineParser ::parseFromArgs parse command line arguments
8746 * - The Settings class is used to maintain settings
8847 * - Use FileLister and command line arguments to get files to check
8948 * -# ThreadExecutor create more instances of CppCheck if needed
@@ -96,7 +55,7 @@ void CheckOther::checkZeroDivision()
9655 * -# Simplify the tokenlist (Tokenizer::simplifyTokenList2)
9756 * -# Run the runSimplifiedChecks of all check classes
9857 *
99- * When errors are found, they are reported back to the CppCheckExecutor through the ErrorLogger interface
58+ * When errors are found, they are reported back to the CppCheckExecutor through the ErrorLogger interface.
10059 */
10160
10261
0 commit comments