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