Commit Graph

1104 Commits

Author SHA1 Message Date
Daniel Marjamäki 99a29eafc9 Fixed #3691 (Tokenizer::simplifyKnownVariables: continue in switch) 2012-05-07 12:11:23 -07:00
PKEuS 28f6e2f4a9 Resolved cyclic dependency between Tokenizer and TemplateSimplifier 2012-05-06 01:38:55 -07:00
PKEuS f105bf75a6 Refactorizations in ErrorLogger:
- Implemented constructor for ErrorLogger::ErrorMessage that takes a callstack of tokens -> replaced duplicate code in Check and Tokenizer
- Implemented strigify() for ErrorLogger::ErrorMessage::FileLocation to replace two identical implementations of it.
2012-05-06 01:17:15 -07:00
PKEuS 1a5fbd61d2 Splitted class TokenList from Tokenizer 2012-05-05 09:33:26 -07:00
Daniel Marjamäki 11614021e8 Fixed #3768 (Tokenizer::setVarId: no varid for 'std::string' parameter after a 'std::string' parameter called 'string') 2012-05-05 09:59:43 +02:00
Daniel Marjamäki 119b24e363 Fixed #3756 (False positive: uninitvar in malloc) 2012-05-03 19:10:51 +02:00
Edoardo Prezioso 5d6a257c86 Fixed #3770 (Segmentation fault in K&R function parameters simplification) 2012-04-29 12:58:52 +02:00
Daniel Marjamäki df6f88b4fe Fixed #3755 (Tokenizer::setVarId: improve varid inside class for struct/class variables) 2012-04-26 18:38:47 +02:00
PKEuS 1e708e10d0 Fixed #2875 2012-04-26 10:35:40 +02:00
Daniel Marjamäki f84a4344ae Fixed #3754 (Tokenizer::simplifyKnownVariables: wrong for loop simplification) 2012-04-25 19:23:17 +02:00
Edoardo Prezioso 08ae15e42d Fixed the grammar in some reportError messages in the Tokenizer class, thanks to kimmov's suggestion. 2012-04-25 15:09:46 +02:00
PKEuS dd5e9aa454 Make use of recently implemented Token::type() functionality 2012-04-25 09:56:07 +02:00
PKEuS e0a3ca0845 Refactorizations in class Token: changed handling of different types of tokens.
- Replace _isNumber, _isName, _isBoolean attributes by a single _type attribute (enum Token::Type), because not two of the old booleans could be true at the same time.
-> Add support for lots of different other kinds of tokens. (More precise checking of token type possible)
-> Replaced instant checking of type for Operators, etc. by a value calculated at creation time. (Faster checking)
2012-04-23 21:05:26 +02:00
PKEuS 8cbed66089 Changed relationship between templatesimplifier and tokenizer:
- Pass a tokenizer to templatesimplifier to reduce code duplication (Make use of Tokenizer::reportError; remove redundant TemplateSimplifier::addtoken2) and amount of arguments passed to functions

Removed ctor and dtor implementation from TemplateSimplifier: This class shouldn't be instanciated.
2012-04-23 20:45:36 +02:00
Daniel Marjamäki 6ae135124e Tokenizer::setVarId: better handling of initializer lists 2012-04-23 18:26:27 +02:00
Daniel Marjamäki 706631f527 Fixed #3748 (False positive out of bounds with postincrement) 2012-04-22 12:22:49 +02:00
Daniel Marjamäki d5f6cfcfa8 Tokenizer: Use new setVarId function. Removed the old one. 2012-04-22 11:36:31 +02:00
PKEuS 3d2b5a30fe Implemented generic reportError functions in tokenizer (similar to Check::reportError) to reduce code duplication 2012-04-22 11:28:46 +02:00
Daniel Marjamäki 8c8c9d5e5b Tokenizer::setVarIdNew: don't treat '(sizeof *p)' as a variable declaration 2012-04-22 11:06:56 +02:00
Daniel Marjamäki d63093d9bb Tokenizer::setVarIdNew: Fixed issue found through TestUnusedVar tests 2012-04-22 10:59:58 +02:00
Daniel Marjamäki 871823e9c6 Tokenizer::setVarId: fixed problem for classes with inheritance 2012-04-22 10:38:06 +02:00
Daniel Marjamäki e39b7f1bfd Tokenizer::setVarIdNew: Fixed TestTokenizer::varid38 2012-04-22 10:24:19 +02:00
Daniel Marjamäki e745d971c8 Tokenizer::setVarIdNew: Fixed test case TestTokenizer::varid27 2012-04-22 10:19:29 +02:00
Daniel Marjamäki b4ffb5e0cf Tokenizer::setVarIdNew: Fixed TestTokenizer::varid39 test case 2012-04-22 09:51:00 +02:00
Daniel Marjamäki ed6673a9aa Tokenizer::setVarIdNew: Fixed TestTokenizer::varid44 2012-04-22 09:18:27 +02:00
Daniel Marjamäki 71050bc586 Tokenizer::setVarIdNew: fixed TestTokenizer::varid_in_class2 test case 2012-04-22 08:51:19 +02:00
Edoardo Prezioso be5a61b794 Fixed ticket #3721 (false positive: syntax error on valid C code ( K&R function style )). 2012-04-22 01:56:40 +02:00
Daniel Marjamäki 6d9b4a8032 Tokenizer::setVarIdNew: Fixed TestTokenizer::varid_operator test case 2012-04-21 19:29:24 +02:00
Daniel Marjamäki 1cc256339c Tokenizer::setVarIdNew: Fixed TestTokenizer::varid19 test case 2012-04-21 18:22:18 +02:00
Daniel Marjamäki 42a95c9202 Tokenizer::setVarIdNew: Fixed segfault when using new setVarId on invalid code 2012-04-21 18:02:26 +02:00
Daniel Marjamäki bd60dd46d0 Tokenizer::setVarIdNew: handle special case when there is an unknown macro. Ticket #2638 2012-04-21 17:57:20 +02:00
Daniel Marjamäki b86295fbcd Tokenizer::setVarIdNew: Improved C++ handling. All the TestTokenizer::varidclass?? tests pass now. 2012-04-21 17:25:44 +02:00
Daniel Marjamäki 6071a5afc3 Tokenizer::setVarIdNew: Fixed varidclass9 2012-04-21 13:39:43 +02:00
Daniel Marjamäki 85b470c41b Tokenizer::setVarIdNew: Better C++ handling (varidclass5 and varidclass13) 2012-04-21 13:11:30 +02:00
Daniel Marjamäki 1492d8990f Tokenizer::setVarId: better C++ handling 2012-04-19 20:58:52 +02:00
PKEuS 6a37c36ee8 Fixed #3741
Removed redundant nullpointer check (cppcheck catch)
2012-04-18 16:35:04 +02:00
PKEuS cb064dc20e Implemented generic mechanism for '<'-'>' "linkage" before link() works (Taken from Scope::findClosingBracket, but C++11 right angle bracket support added): Token::findClosingBracket
-> Replaced several indendation-counting mechanisms in tokenize.cpp

Fixed build failure in checkclass.cpp
2012-04-18 16:02:03 +02:00
Daniel Marjamäki bb4184ca03 Tokenizer::setVarIdNew: better handling of class variables 2012-04-17 19:06:00 +02:00
Ettl Martin 09d41b2f84 ticket 2669: added todo testcase 2012-04-17 00:31:32 +02:00
PKEuS bac8ed7127 Refactorized stringification of tokens:
- Function that stringifies one token: Token::stringify()
- Functions that stringify a list of tokens: Token::stringifyList()
-- Single and powerful "base" function, used by several "light" functions
Refactorized
- testtokenize.cpp and testsimplifytokens.cpp: Use improved stringification functions instead of several local implementations
- Avoided redundand creation of std::string when using TestTokenizer::tokenizeAndStringify and in cmdlineparser.cpp
2012-04-16 19:51:07 +02:00
Daniel Marjamäki 5ad1840120 Tokenizer::setVarIdNew: Copied code from Tokenizer::setVarIdOld that sets varid in member functions 2012-04-16 19:48:58 +02:00
PKEuS 1c3c94dc67 New simplification: Remove 'extern "C"' from C++ code.
Refactorization in cppcheck.cpp: Catch exception as const reference instead of non-const reference.
2012-04-16 16:25:04 +02:00
PKEuS 66d947675f Refactorizations in tokenize.cpp:
- Removed a few indendation counters
- Removed unnecessary pattern "- >" because this code is simplified to "." before.
- Generalized pattern of simplifyFunctionReturn()
- Simplified removeExeptionSpecification, no longer recursive (-> #3385)
2012-04-16 10:49:09 +02:00
Daniel Marjamäki 8f866c6e4c Tokenizer::setVarIdNew: handle c++ keyword 'using' 2012-04-15 18:29:35 +02:00
Daniel Marjamäki c58d02f146 Tokenizer::setVarIdNew: in C code, allow that variable declaration starts with delete and throw 2012-04-15 18:23:12 +02:00
Daniel Marjamäki b0dc708b4d Tokenizer::setVarIdNew: variable declarations dont start with NOT/goto/return/delete/etc 2012-04-15 18:02:49 +02:00
Daniel Marjamäki 46bfe27831 Tokenizer::setVarIdNew: Better handling of function calls 2012-04-15 17:44:51 +02:00
Daniel Marjamäki 31f8a71f84 Tokenizer::setVarIdNew: Better handling for catch-exception-by-reference 2012-04-15 17:39:22 +02:00
Daniel Marjamäki 3c1dfc658c Tokenizer::setVarIdNew: use the new setVarId with a few more test cases. Improved setVarId: references in executable scopes must be initialized. 2012-04-15 14:32:47 +02:00
Daniel Marjamäki 27c37896a0 Tokenizer::setVarIdNew : use new setVarId function in TestTokenizer::varidReturn2. 2012-04-15 14:19:17 +02:00