File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ Output:
4545 b
4646 ;
4747
48+ The ` cfg.tokenlist ` does not always match the raw input code exactly. For instance:
49+ * The ` cfg.tokenlist ` is preprocessed.
50+ * There is no typedefs in ` cfg.tokenlist ` .
51+ * C++ templates are instantiated when possible in ` cfg.tokenlist ` .
52+ * Variable declarations are sometimes splitted up.
53+ * If you don't write {} around the body for a if/else/while/for etc then those are inserted in the ` cfg.tokenlist ` .
54+ * ...
55+
4856There are various properties in the ` Token ` class and some of those will be discussed below.
4957
5058
@@ -249,8 +257,8 @@ Output:
249257
250258### Special tokenlist tweaks and else if
251259
252- The cfg.tokenlist has some tweaks. In C/C++ code it is optional to use ` { ` and ` } ` around the conditional code ,
253- if the conditional code is only a single statement. However Cppcheck adds "{" and "}" tokens if those are missing.
260+ The ` cfg.tokenlist ` has some tweaks. In C/C++ code it is optional to use ` { ` and ` } ` around the if/else/for/while body ,
261+ if the body is only a single statement. However Cppcheck adds "{" and "}" tokens if those are missing.
254262
255263One more tweak is that in cfg.tokenlist there is no "else if" scope.
256264
@@ -264,7 +272,7 @@ Example C code:
264272 ++x;
265273 }
266274
267- The tokens in the cfg.tokenlist will look like this:
275+ The tokens in the ` cfg.tokenlist ` will look like this:
268276
269277 void foo(int x)
270278 {
You can’t perform that action at this time.
0 commit comments