Skip to content

Commit c3f101e

Browse files
committed
doxygen: document on the main page that we have access to syntax tree, symbol database and library.
1 parent e0eb000 commit c3f101e

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

cli/main.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,19 @@
2525
* @section overview_sec Overview
2626
* Cppcheck is a simple tool for static analysis of C/C++ code.
2727
*
28-
* The method used is to first tokenize the source code and then analyse the token list.
29-
* In the token list, the tokens are stored in plain text.
28+
* When you write a checker you have access to:
29+
* - %Token list = the tokenized code
30+
* - Syntax tree = Syntax tree of each expression
31+
* - SymbolDatabase = Information about all types/variables/functions/etc
32+
* in the current translation unit
33+
* - Library = Information about functions
3034
*
31-
* The checks are written in C++. The checks are addons that can be easily added/removed.
35+
* Use --debug on the command line to see debug output for the token list
36+
* and the syntax tree. If both --debug and --verbose is used, the symbol
37+
* database is also written.
38+
*
39+
* The checks are written in C++. The checks are addons that can be
40+
* easily added/removed.
3241
*
3342
* @section writing_checks_sec Writing a check
3443
* Below is a simple example of a check that detect division with zero:
@@ -45,8 +54,9 @@ void CheckOther::checkZeroDivision()
4554
@endcode
4655
*
4756
* The function Token::Match is often used in the checks. Through it
48-
* you can match tokens against patterns.
49-
*
57+
* you can match tokens against patterns. It is currently not possible
58+
* to write match expressions that uses the syntax tree, the symbol database,
59+
* nor the library. Only the token list is used.
5060
*
5161
* @section checkclass_sec Creating a new check class from scratch
5262
* %Check classes inherit from the Check class. The Check class specifies the interface that you must use.

0 commit comments

Comments
 (0)