Cppcheck
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tokenize.h
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2015 Daniel Marjam√§ki and Cppcheck team.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 //---------------------------------------------------------------------------
20 #ifndef tokenizeH
21 #define tokenizeH
22 //---------------------------------------------------------------------------
23 
24 #include "errorlogger.h"
25 #include "tokenlist.h"
26 #include "config.h"
27 
28 #include <string>
29 #include <map>
30 #include <set>
31 #include <list>
32 #include <ctime>
33 
34 class Settings;
35 class SymbolDatabase;
36 class TimerResults;
37 
38 /// @addtogroup Core
39 /// @{
40 
41 /** @brief The main purpose is to tokenize the source code. It also has functions that simplify the token list */
43 
44  friend class TestSimplifyTokens;
45  friend class TestSimplifyTypedef;
46  friend class TestTokenizer;
47 public:
48  Tokenizer();
49  Tokenizer(const Settings * settings, ErrorLogger *errorLogger);
50  ~Tokenizer();
51 
53  m_timerResults = tr;
54  }
55 
56  /** Is the code C. Used for bailouts */
57  bool isC() const {
58  return list.isC();
59  }
60 
61  /** Is the code CPP. Used for bailouts */
62  bool isCPP() const {
63  return list.isCPP();
64  }
65 
66  /**
67  * Check if inner scope ends with a call to a noreturn function
68  * \param endScopeToken The '}' token
69  * \param unknown set to true if it's unknown if the scope is noreturn
70  * \return true if scope ends with a function call that might be 'noreturn'
71  */
72  bool IsScopeNoReturn(const Token *endScopeToken, bool *unknown = nullptr) const;
73 
74  /**
75  * Tokenize code
76  * @param code input stream for code, e.g.
77  * \code
78  * #file "p.h"
79  * class Foo
80  * {
81  * private:
82  * void Bar();
83  * };
84  *
85  * #endfile
86  * void Foo::Bar()
87  * {
88  * }
89  * \endcode
90  *
91  * @param FileName The filename
92  * @param configuration E.g. "A" for code where "#ifdef A" is true
93  * @param noSymbolDB_AST Disable creation of SymbolDatabase and AST
94  * @return false if source code contains syntax errors
95  */
96  bool tokenize(std::istream &code,
97  const char FileName[],
98  const std::string &configuration = emptyString,
99  bool noSymbolDB_AST = false);
100  /**
101  * tokenize condition and run simple simplifications on it
102  * @param code code
103  * @return true if success.
104  */
105  bool tokenizeCondition(const std::string &code);
106 
107  /** Set variable id */
108  void setVarId();
109 
110  /**
111  * Basic simplification of tokenlist
112  *
113  * @param FileName The filename to run; used to do
114  * markup checks.
115  *
116  * @return false if there is an error that requires aborting
117  * the checking of this file.
118  */
119  bool simplifyTokenList1(const char FileName[]);
120 
121  void SimplifyNamelessRValueReferences();
122 
123  /**
124  * Most aggressive simplification of tokenlist
125  *
126  * @return false if there is an error that requires aborting
127  * the checking of this file.
128  */
129  bool simplifyTokenList2();
130 
131  /**
132  * Deletes dead code between 'begin' and 'end'.
133  * In general not everything can be erased, such as:
134  * - code after labels;
135  * - code outside the scope where the function is called;
136  * - code after a change of scope caused by 'switch(...);'
137  * instructions, like 'case %any%;' or 'default;'
138  * Also, if the dead code contains a 'switch' block
139  * and inside it there's a label, the function removes all
140  * the 'switch(..)' tokens and every occurrence of 'case %any%; | default;'
141  * expression, such as the 'switch' block is reduced to a simple block.
142  *
143  * @param begin Tokens after this have a possibility to be erased.
144  * @param end Tokens before this have a possibility to be erased.
145  */
146  static void eraseDeadCode(Token *begin, const Token *end);
147 
148  /**
149  * Simplify '* & ( %name% ) =' or any combination of '* &' and '()'
150  * parentheses around '%name%' to '%name% ='
151  */
152  void simplifyMulAndParens();
153 
154  /**
155  * Calculates sizeof value for given type.
156  * @param type Token which will contain e.g. "int", "*", or string.
157  * @return sizeof for given type, or 0 if it can't be calculated.
158  */
159  unsigned int sizeOfType(const Token *type) const;
160 
161  /**
162  * Try to determine if function parameter is passed by value by looking
163  * at the function declaration.
164  * @param fpar token for function parameter in the function call
165  * @return true if the parameter is passed by value. if unsure, false is returned
166  */
167  bool isFunctionParameterPassedByValue(const Token *fpar) const;
168 
169  /**
170  * get error messages that the tokenizer generate
171  */
172  static void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings);
173 
174  /** Simplify assignment in function call "f(x=g());" => "x=g();f(x);"
175  */
176  void simplifyAssignmentInFunctionCall();
177 
178  /** Simplify assignment where rhs is a block : "x=({123;});" => "{x=123;}" */
179  void simplifyAssignmentBlock();
180 
181  /**
182  * Simplify constant calculations such as "1+2" => "3"
183  * @return true if modifications to token-list are done.
184  * false if no modifications are done.
185  */
186  bool simplifyCalculations();
187 
188  /**
189  * Simplify dereferencing a pointer offset by a number:
190  * "*(ptr + num)" => "ptr[num]"
191  * "*(ptr - num)" => "ptr[-num]"
192  */
193  void simplifyOffsetPointerDereference();
194 
195  /**
196  * Simplify referencing a pointer offset:
197  * "Replace "&str[num]" => "(str + num)"
198  */
199  void simplifyOffsetPointerReference();
200 
201  /** Insert array size where it isn't given */
202  void arraySize();
203 
204  /** Simplify labels and 'case|default' syntaxes.
205  */
206  void simplifyLabelsCaseDefault();
207 
208  /** Remove macros in global scope */
209  void removeMacrosInGlobalScope();
210 
211  /** Remove undefined macro in class definition:
212  * class DLLEXPORT Fred { };
213  * class Fred FINAL : Base { };
214  */
215  void removeMacroInClassDef();
216 
217  /** Remove unknown macro in variable declarations: PROGMEM char x; */
218  void removeMacroInVarDecl();
219 
220  /** Remove redundant assignment */
221  void removeRedundantAssignment();
222 
223  /** Simplifies some realloc usage like
224  * 'x = realloc (0, n);' => 'x = malloc(n);'
225  * 'x = realloc (y, 0);' => 'x = 0; free(y);'
226  */
227  void simplifyRealloc();
228 
229  /** Add parentheses for sizeof: sizeof x => sizeof(x) */
230  void sizeofAddParentheses();
231 
232  /**
233  * Replace sizeof() to appropriate size.
234  * @return true if modifications to token-list are done.
235  * false if no modifications are done.
236  */
237  bool simplifySizeof();
238 
239  /**
240  * Simplify variable declarations (split up)
241  * \param only_k_r_fpar Only simplify K&R function parameters
242  */
243  void simplifyVarDecl(bool only_k_r_fpar);
244  void simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_fpar);
245 
246  /**
247  * Simplify variable initialization
248  * '; int *p(0);' => '; int *p = 0;'
249  */
250  void simplifyInitVar();
251  Token * initVar(Token * tok);
252 
253  /**
254  * Convert platform dependent types to standard types.
255  * 32 bits: size_t -> unsigned long
256  * 64 bits: size_t -> unsigned long long
257  */
258  void simplifyPlatformTypes();
259 
260  /**
261  * Collapse compound standard types into a single token.
262  * unsigned long long int => long _isUnsigned=true,_isLong=true
263  */
264  void simplifyStdType();
265 
266  /**
267  * Simplify easy constant '?:' operation
268  * Example: 0 ? (2/0) : 0 => 0
269  * @return true if something is modified
270  * false if nothing is done.
271  */
272  bool simplifyConstTernaryOp();
273 
274  /**
275  * Simplify compound assignments
276  * Example: ";a+=b;" => ";a=a+b;"
277  */
278  void simplifyCompoundAssignment();
279 
280 
281  /**
282  * Simplify "* const" to "*"
283  */
284  void simplifyPointerConst();
285 
286  /**
287  * Simplify the location of "static" and "const" qualifiers in
288  * a variable declaration or definition.
289  * Example: "int static const a;" => "static const a;"
290  * Example: "long long const static b;" => "static const long long b;"
291  */
292  void simplifyStaticConst();
293 
294  /**
295  * Simplify assignments in "if" and "while" conditions
296  * Example: "if(a=b);" => "a=b;if(a);"
297  * Example: "while(a=b) { f(a); }" => "a = b; while(a){ f(a); a = b; }"
298  * Example: "do { f(a); } while(a=b);" => "do { f(a); a = b; } while(a);"
299  */
300  void simplifyIfAndWhileAssign();
301 
302  /**
303  * Simplify multiple assignments.
304  * Example: "a = b = c = 0;" => "a = 0; b = 0; c = 0;"
305  */
306  void simplifyVariableMultipleAssign();
307 
308  /**
309  * Simplify the 'C Alternative Tokens'
310  * Examples:
311  * "if(s and t)" => "if(s && t)"
312  * "while((r bitand s) and not t)" => while((r & s) && !t)"
313  * "a and_eq b;" => "a &= b;"
314  */
315  bool simplifyCAlternativeTokens();
316 
317  /**
318  * Simplify comma into a semicolon when possible:
319  * - "delete a, delete b" => "delete a; delete b;"
320  * - "a = 0, b = 0;" => "a = 0; b = 0;"
321  * - "return a(), b;" => "a(); return b;"
322  */
323  void simplifyComma();
324 
325  /** Add braces to an if-block, for-block, etc.
326  * @return true if no syntax errors
327  */
328  bool simplifyAddBraces();
329 
330  /** Add braces to an if-block, for-block, etc.
331  * for command starting at token including else-block
332  * @return last token of command
333  * or input token in case of an error where no braces are added
334  * or NULL when syntaxError is called
335  */
336  Token * simplifyAddBracesToCommand(Token * tok);
337 
338  /** Add pair of braces to an single if-block, else-block, for-block, etc.
339  * for command starting at token
340  * @return last token of command
341  * or input token in case of an error where no braces are added
342  * or NULL when syntaxError is called
343  */
344  Token * simplifyAddBracesPair(Token *tok, bool commandWithCondition);
345 
346  /**
347  * typedef A mytype;
348  * mytype c;
349  *
350  * Becomes:
351  * typedef A mytype;
352  * A c;
353  */
354  void simplifyTypedef();
355 
356  /**
357  * Simplify float casts (float)1 => 1.0
358  */
359  void simplifyFloatCasts();
360 
361  /**
362  * Simplify casts
363  */
364  void simplifyCasts();
365 
366  /**
367  * Change (multiple) arrays to (multiple) pointers.
368  */
369  void simplifyUndefinedSizeArray();
370 
371  /**
372  * A simplify function that replaces a variable with its value in cases
373  * when the value is known. e.g. "x=10; if(x)" => "x=10;if(10)"
374  *
375  * @return true if modifications to token-list are done.
376  * false if no modifications are done.
377  */
378  bool simplifyKnownVariables();
379 
380  /**
381  * Utility function for simplifyKnownVariables. Get data about an
382  * assigned variable.
383  */
384  static bool simplifyKnownVariablesGetData(unsigned int varid, Token **_tok2, Token **_tok3, std::string &value, unsigned int &valueVarId, bool &valueIsPointer, bool floatvar);
385 
386  /**
387  * utility function for simplifyKnownVariables. Perform simplification
388  * of a given variable
389  */
390  bool simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsigned int varid, const std::string &structname, std::string &value, unsigned int valueVarId, bool valueIsPointer, const Token * const valueToken, int indentlevel) const;
391 
392  /** Simplify useless C++ empty namespaces, like: 'namespace %name% { }'*/
393  void simplifyEmptyNamespaces();
394 
395  /** Simplify redundant code placed after control flow statements :
396  * 'return', 'throw', 'goto', 'break' and 'continue'
397  */
398  void simplifyFlowControl();
399 
400  /** Expand nested strcat() calls. */
401  void simplifyNestedStrcat();
402 
403  /** Simplify "if else" */
404  void elseif();
405 
406  /** Simplify conditions
407  * @return true if something is modified
408  * false if nothing is done.
409  */
410  bool simplifyConditions();
411 
412  /** Remove redundant code, e.g. if( false ) { int a; } should be
413  * removed, because it is never executed.
414  * @return true if something is modified
415  * false if nothing is done.
416  */
417  bool removeRedundantConditions();
418 
419  /**
420  * Remove redundant for:
421  * "for (x=0;x<1;x++) { }" => "{ x = 1; }"
422  */
423  void removeRedundantFor();
424 
425 
426  /**
427  * Reduces "; ;" to ";", except in "( ; ; )"
428  */
429  void removeRedundantSemicolons();
430 
431  /** Simplify function calls - constant return value
432  * @return true if something is modified
433  * false if nothing is done.
434  */
435  bool simplifyFunctionReturn();
436 
437  /** Struct simplification
438  * "struct S { } s;" => "struct S { }; S s;"
439  */
440 
441  void simplifyStructDecl();
442 
443  /**
444  * Remove redundant parentheses:
445  * - "((x))" => "(x)"
446  * - "(function())" => "function()"
447  * - "(delete x)" => "delete x"
448  * - "(delete [] x)" => "delete [] x"
449  * @return true if modifications to token-list are done.
450  * false if no modifications are done.
451  */
452  bool simplifyRedundantParentheses();
453 
454  void simplifyCharAt();
455 
456  /** Simplify references */
457  void simplifyReference();
458 
459  /**
460  * Simplify functions like "void f(x) int x; {"
461  * into "void f(int x) {"
462  */
463  void simplifyFunctionParameters();
464 
465  /**
466  * Simplify templates
467  */
468  void simplifyTemplates();
469 
470  void simplifyDoublePlusAndDoubleMinus();
471 
472  void simplifyRedundantConsecutiveBraces();
473 
474  void simplifyArrayAccessSyntax();
475 
476  void simplifyParameterVoid();
477 
478  void fillTypeSizes();
479 
480  void combineOperators();
481 
482  void combineStrings();
483 
484  void concatenateDoubleSharp();
485 
486  void simplifyFileAndLineMacro();
487 
488  void simplifyNull();
489 
490  void concatenateNegativeNumberAndAnyPositive();
491 
492  void simplifyExternC();
493 
494  void simplifyRoundCurlyParentheses();
495 
496  void simplifySQL();
497 
498  void checkForEnumsWithTypedef();
499 
500  void findComplicatedSyntaxErrorsInTemplates();
501 
502  /**
503  * Simplify e.g. 'atol("0")' into '0'
504  */
505  void simplifyMathFunctions();
506 
507  /**
508  * Simplify e.g. 'sin(0)' into '0'
509  */
510  void simplifyMathExpressions();
511 
512  /**
513  * Modify strings in the token list by replacing hex and oct
514  * values. E.g. "\x61" -> "a" and "\000" -> "\0"
515  * @param source The string to be modified, e.g. "\x61"
516  * @return Modified string, e.g. "a"
517  */
518  static std::string simplifyString(const std::string &source);
519 
520 private:
521 
522  /**
523  * is token pointing at function head?
524  * @param tok A '(' or ')' token in a possible function head
525  * @param endsWith string after function head
526  * @return token matching with endsWith if syntax seems to be a function head else nullptr
527  */
528  const Token * isFunctionHead(const Token *tok, const std::string &endsWith) const;
529 
530  /**
531  * simplify "while (0)"
532  */
533  void simplifyWhile0();
534 
535  /**
536  * Simplify while(func() && errno==EINTR)
537  */
538  void simplifyErrNoInWhile();
539 
540  /**
541  * Simplify while(func(f))
542  */
543  void simplifyFuncInWhile();
544 
545  /**
546  * Replace enum with constant value
547  */
548  void simplifyEnum();
549 
550  /**
551  * Remove "std::" before some function names
552  */
553  void simplifyStd();
554 
555  /** Simplify pointer to standard type (C only) */
556  void simplifyPointerToStandardType();
557 
558  /** Simplify function pointers */
559  void simplifyFunctionPointers();
560 
561  /**
562  * Remove exception specifications.
563  */
564  void removeExceptionSpecifications();
565 
566 
567  /**
568  * Send error message to error logger about internal bug.
569  * @param tok the token that this bug concerns.
570  */
571  void cppcheckError(const Token *tok) const;
572 
573  /**
574  * Setup links for tokens so that one can call Token::link().
575  */
576  void createLinks();
577 
578  /**
579  * Setup links between < and >.
580  */
581  void createLinks2();
582 
583 public:
584 
585  /** Syntax error */
586  void syntaxError(const Token *tok) const;
587 
588  /** Syntax error. Example: invalid number of ')' */
589  void syntaxError(const Token *tok, char c) const;
590 
591 private:
592 
593  /** Report that there is an unhandled "class x y {" code */
594  void unhandled_macro_class_x_y(const Token *tok) const;
595 
596  /**
597  * assert that tokens are ok - used during debugging for example
598  * to catch problems in simplifyTokenList1/2.
599  */
600  void validate() const;
601 
602  /**
603  * Remove __declspec()
604  */
605  void simplifyDeclspec();
606 
607  /**
608  * Remove calling convention
609  */
610  void simplifyCallingConvention();
611 
612  /**
613  * Remove __attribute__ ((?))
614  */
615  void simplifyAttribute();
616 
617  /**
618  * Remove keywords "volatile", "inline", "register", and "restrict"
619  */
620  void simplifyKeyword();
621 
622  /**
623  * Remove __asm
624  */
625  void simplifyAsm();
626 
627  /**
628  * asm heuristics, Put ^{} statements in asm()
629  */
630  void simplifyAsm2();
631 
632  /**
633  * Simplify bitfields - the field width is removed as we don't use it.
634  */
635  void simplifyBitfields();
636 
637  /**
638  * Remove unnecessary member qualification
639  */
640  void removeUnnecessaryQualification();
641 
642  /**
643  * unnecessary member qualification error
644  */
645  void unnecessaryQualificationError(const Token *tok, const std::string &qualification) const;
646 
647  /**
648  * Add std:: in front of std classes, when using namespace std; was given
649  */
650  void simplifyNamespaceStd();
651 
652  /**
653  * Convert Microsoft memory functions
654  * CopyMemory(dst, src, len) -> memcpy(dst, src, len)
655  * FillMemory(dst, len, val) -> memset(dst, val, len)
656  * MoveMemory(dst, src, len) -> memmove(dst, src, len)
657  * ZeroMemory(dst, len) -> memset(dst, 0, len)
658  */
659  void simplifyMicrosoftMemoryFunctions();
660 
661  /**
662  * Convert Microsoft string functions
663  * _tcscpy -> strcpy
664  */
665  void simplifyMicrosoftStringFunctions();
666 
667  /**
668  * Remove Borland code
669  */
670  void simplifyBorland();
671 
672  /**
673  * Remove Qt signals and slots
674  */
675  void simplifyQtSignalsSlots();
676 
677  /**
678  * Collapse operator name tokens into single token
679  * operator = => operator=
680  */
681  void simplifyOperatorName();
682 
683  /**
684  * Remove [[deprecated]] (C++14) from TokenList
685  */
686  void simplifyDeprecated();
687 
688  /**
689  * Replace strlen(str)
690  * @return true if any replacement took place, false else
691  * */
692  bool simplifyStrlen();
693 
694  /**
695  * check for duplicate enum definition
696  */
697  bool duplicateDefinition(Token **tokPtr, const Token *name) const;
698 
699  /**
700  * report error message
701  */
702  void reportError(const Token* tok, const Severity::SeverityType severity, const std::string& id, const std::string& msg, bool inconclusive = false) const;
703  void reportError(const std::list<const Token*>& callstack, Severity::SeverityType severity, const std::string& id, const std::string& msg, bool inconclusive = false) const;
704 
705  /**
706  * duplicate enum definition error
707  */
708  void duplicateEnumError(const Token *tok1, const Token *tok2, const std::string & type) const;
709 
710  bool duplicateTypedef(Token **tokPtr, const Token *name, const Token *typeDef, const std::set<std::string>& structs) const;
711  void duplicateTypedefError(const Token *tok1, const Token *tok2, const std::string & type) const;
712 
713  /**
714  * Report error - duplicate declarations
715  */
716  void duplicateDeclarationError(const Token *tok1, const Token *tok2, const std::string &type) const;
717 
718  void unsupportedTypedef(const Token *tok) const;
719 
720 public:
721 
722  /** Was there templates in the code? */
723  bool codeWithTemplates() const {
724  return _codeWithTemplates;
725  }
726 
727 
728  void setSettings(const Settings *settings) {
729  _settings = settings;
730  list.setSettings(settings);
731  }
732 
734  return _symbolDatabase;
735  }
736  void createSymbolDatabase();
737  void deleteSymbolDatabase();
738 
739  /** print --debug output if debug flags match the simplification:
740  * 0=unknown/both simplifications
741  * 1=1st simplifications
742  * 2=2nd simplifications
743  */
744  void printDebugOutput(unsigned int simplification) const;
745 
746  void dump(std::ostream &out) const;
747 
748  Token *deleteInvalidTypedef(Token *typeDef);
749 
750  /**
751  * Get variable count.
752  * @return number of variables
753  */
754  unsigned int varIdCount() const {
755  return _varId;
756  }
757 
758 
759  /**
760  * Simplify e.g. 'return(strncat(temp,"a",1));' into
761  * strncat(temp,"a",1); return temp;
762  */
763  void simplifyReturnStrncat();
764 
765  /**
766  * Output list of unknown types.
767  */
768  void printUnknownTypes() const;
769 
770 
771  /**
772  * Token list: stores all tokens.
773  */
775  // Implement tokens() as a wrapper for convinience when using the TokenList
776  const Token* tokens() const {
777  return list.front();
778  }
779 
780  /**
781  * Copy tokens.
782  * @param dest destination token where copied tokens will be inserted after
783  * @param first first token to copy
784  * @param last last token to copy
785  * @param one_line true=>copy all tokens to the same line as dest. false=>copy all tokens to dest while keeping the 'line breaks'
786  * @return new location of last token copied
787  */
788  static Token *copyTokens(Token *dest, const Token *first, const Token *last, bool one_line = true);
789 
790  /**
791  * Helper function to check whether number is zero (0 or 0.0 or 0E+0) or not?
792  * @param s the string to check
793  * @return true in case is is zero and false otherwise.
794  */
795  static bool isZeroNumber(const std::string &s);
796 
797  /**
798  * Helper function to check whether number is one (1 or 0.1E+1 or 1E+0) or not?
799  * @param s the string to check
800  * @return true in case is is one and false otherwise.
801  */
802  static bool isOneNumber(const std::string &s);
803 
804  /**
805  * Helper function to check whether number is two (2 or 0.2E+1 or 2E+0) or not?
806  * @param s the string to check
807  * @return true in case is is two and false otherwise.
808  */
809  static bool isTwoNumber(const std::string &s);
810 
811  /**
812  * Helper function to check for start of function execution scope.
813  * Do not use this in checks. Use the symbol database.
814  * @param tok --> pointer to end parentheses of parameter list
815  * @return pointer to start brace of function scope or nullptr if not start.
816  */
817  static const Token * startOfExecutableScope(const Token * tok);
818 
819 private:
820  /** Disable copy constructor, no implementation */
821  Tokenizer(const Tokenizer &);
822 
823  /** Disable assignment operator, no implementation */
824  Tokenizer &operator=(const Tokenizer &);
825 
826  Token * startOfFunction(Token * tok) const;
828  return const_cast<Token*>(startOfExecutableScope(const_cast<const Token *>(tok)));
829  }
830 
831  Token *processFunc(Token *tok2, bool inOperator) const;
832 
833  /** Set pod types */
834  void setPodTypes();
835 
836  /** settings */
838 
839  /** errorlogger */
841 
842  /** Symbol database that all checks etc can use */
844 
845  /** E.g. "A" for code where "#ifdef A" is true. This is used to
846  print additional information in error situations. */
847  std::string _configuration;
848 
849  /** sizeof information for known types */
850  std::map<std::string, unsigned int> _typeSize;
851 
852  /** variable count */
853  unsigned int _varId;
854 
855  /**
856  * was there any templates? templates that are "unused" are
857  * removed from the token list
858  */
860 
861  /**
862  * TimerResults
863  */
865 #ifdef MAXTIME
866  /** Tokenizer maxtime */
867  std::time_t maxtime;
868 #endif
869 };
870 
871 /// @}
872 
873 //---------------------------------------------------------------------------
874 #endif // tokenizeH