341 Commits

Author SHA1 Message Date
Daniel Marjamäki
49413b7d4c Tokenizer: Add simplifyAt to handle some nonstandard code with @ 2018-12-04 16:52:41 +01:00
Daniel Marjamäki
e6a5e0f752 Warn when there is a unknown macro 2018-11-13 16:49:15 +01:00
IOBYTE
508e8c234b Fixed #8683 (Using deleted token with multiple template instantiations.) (#1353)
* Fixed #8683 (Using deleted token with multiple template instantiations.)

* Fixed #8321 (heap use after free: templatesimplifier)

* Add a flag to Token indicating that it has a pointer to it.

* Run dmake

* Fix one source of list pointers to deleted tokens.

Refactor TemplateSimplifier class to get access to template lists.
Remove many function parameters now that they are class variables.
Fix one source of list pointers to deleted tokens.
Add tests with no output to catch crashes.

* Run dmake again.

* Make 2 more functions private.

* Make requested changes.

* Missed one change request.

* Use TokenList rather than Tokenizer.

* Move TokenAndName constructor to cpp file so token.h is not needed in header file.
2018-09-01 11:26:10 +02:00
Daniel Marjamäki
13cf93a322 Rename private variable maxtime 2018-06-18 09:49:00 +02:00
Daniel Marjamäki
66785c238a Renamed _timerResults 2018-06-16 22:14:59 +02:00
Daniel Marjamäki
63e6d35cb6 Renamed _unnamedCount to mUnnamedCount 2018-06-16 22:09:18 +02:00
Daniel Marjamäki
ef534c2d0d Renamed _codeWithTemplates 2018-06-16 22:03:04 +02:00
Daniel Marjamäki
5dc29a9a16 Renamed _configuration to mConfiguration 2018-06-16 21:57:48 +02:00
Daniel Marjamäki
598a984071 Renamed _typeSize to mTypeSize 2018-06-16 21:56:05 +02:00
Daniel Marjamäki
5e43366126 Rename members 2018-06-16 21:52:29 +02:00
Daniel Marjamäki
8e2b18a75a Rename _varId to mVarId 2018-06-16 16:38:50 +02:00
Daniel Marjamäki
d81fe83ca6 renamed _symbolDatabase to mSymbolDatabase 2018-06-16 16:25:27 +02:00
Daniel Marjamäki
79ffe1d4fc Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
amai2012
f947b3b025 Fix some doxygen warnings 2018-06-07 08:33:32 +02:00
Daniel Marjamäki
14e60210c9 Optimize Tokenizer::setVarIdPass1 2018-05-29 18:41:05 +02:00
Daniel Marjamäki
c2c43ce8a7 Code cleanup, use '= delete' 2018-05-28 12:44:18 +02:00
IOBYTE
8b0b659965 Add support for namespace aliases and C++17 nested namespaces. (#1210)
* Add support for namespace aliases and C++17 nested namespaces.

These are implemented as tokenizer simplifications so changes are not
needed to the tokenizer and symbol database.

* Fix codacy warning.
2018-05-08 06:35:51 +02:00
Daniel Marjamäki
2c3cd402ba Thread safety: changed local static variable 'count' to member variable 2018-03-14 09:41:27 +01:00
IOBYTE
fcde1d80e9 Fix #8382 (Syntax error when scanning code with template and attribute) (#1089)
* Fix #8382 (Syntax error when scanning code with template and attribute)

This commit only addresses #8382. There are issues concerning which
versions of C++ should be supported and also generic C++ 14 attribute
support which can be revisited later.

* Remove all C++ style attributes.

Remove all C++ style attributes when C++ version is 11 or greater.
Rename simplify function to simplifyCPPAttributes.
Handle more cases of roreturn function attribute.
2018-02-16 22:25:51 +01:00
Alexander Mai
68eb6c4e6f Refactoring: Add Tokenizer::findGarbageCode to time report. The method now calls syntaxError instead of returning an invalid token 2018-02-05 21:47:33 +01:00
Daniel Marjamäki
af26f00e04 gui: update copyright message in about dialog 2018-01-14 15:46:20 +01:00
Daniel Marjamäki
c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Daniel Marjamäki
8c33a95b49 Refactoring: moved method from Tokenizer to TokenList 2018-01-07 14:07:34 +01:00
Daniel Marjamäki
a80760cb6f TemplateSimplifier: Fix in expandTemplate 2017-12-25 08:19:46 +01:00
Alexey Eryomenko
02461753f3 Fix for embedded PL/SQL blocks (Oracle Pro*C) (#985)
* fix for correct parsing of embedded PL/SQL blocks (Oracle Pro*C)

* enforce SQL block end at the end of nearest outer C block, when
appropriate terminator is not found

* added check for ; at the end of END-EXEC and made SQL block detection
more readable
2017-11-03 11:31:33 +01:00
Alexey Eryomenko
22483baf72 missed simplification in parsing of std function declaration resulted in (#967)
wrong type detection
2017-10-03 22:10:13 +02:00
Ayaz Salikhov
28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki
59335f80d2 Try to fix windows build. Reduce header dependencies 2017-05-17 15:38:31 +02:00
Daniel Marjamäki
6230919976 Skip 'Stringification => Tokenize' step 2017-05-17 14:57:54 +02:00
Alexander Mai
c1cdcc158f Run astyle. Fix some Doxygen issues 2017-05-06 11:57:02 +02:00
Daniel Marjamäki
8ffed6862d Tokenizer: Add --check-config warning for macro with semicolon in argument 2017-04-07 19:19:10 +02:00
Daniel Marjamäki
50da7d4919 Tokenizer: Write syntax error if there is C++ code in C file. 2017-04-06 08:50:35 +02:00
IOBYTE
7cae057615 Add missing varid or variable for member variables.
Add an optional extended description…
2017-03-30 10:07:58 +02:00
Matthias Krüger
ce3bc006e7 fix build with -DMAXTIME=123 2017-02-27 14:00:06 +01:00
Matthias Krüger
35e7697474 switch some functions from const to static, as cppcheck suggests. 2017-02-27 13:51:33 +01:00
Stefan Weil
57b57428c2 Fix some typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-11-27 11:40:42 +01:00
orbitcowboy
2f8a24764f tokenize: Improved const correctness. There are no functional changes. 2016-10-31 17:18:27 +01:00
orbitcowboy
b3c60bf6b2 tokenize: Improved const correctness. There are no functional changes. 2016-10-31 16:11:11 +01:00
Daniel Marjamäki
efa3aba32a Remove Tokenizer::simplifyNull() 2016-10-18 21:44:02 +02:00
Harald Scheidl
58eb644003 Improved Check: Warn about number and char literals in boolean expressions (#7750) 2016-10-09 13:21:00 +02:00
Daniel Marjamäki
383b815cca Tokenizer: refactoring garbage code handling 2016-07-26 08:16:10 +02:00
Daniel Marjamäki
7ef02a7469 Cleanup Tokenizer 2016-07-25 12:12:11 +02:00
Daniel Marjamäki
adf16fae8b Remove handling of ##, __FILE__, __LINE__ from tokenizer 2016-07-25 07:58:03 +02:00
Daniel Marjamäki
cd3818088f Remove unused function Tokenizer::tokenizeCondition 2016-07-24 14:37:43 +02:00
Daniel Marjamäki
ed4a47de45 Tokenizer: Improve syntax checking of switch,if,while 2016-07-22 16:54:24 +02:00
Daniel Marjamäki
372763c85e Tokenizer: Refactoring, split up the big Tokenizer::setVarId() function 2016-05-12 18:20:20 +02:00
Daniel Marjamäki
1caa79c45f Tokenizer::simplifyPointerConst: Remove simplification. Its purpose was to avoid crash for garbage code (#6900). This fixes #7485. 2016-05-08 21:32:34 +02:00
amai2012
eba1b0881d Minor refactoring: use nullptr (instead of 0/NULL), change signature of Tokenizer::createTokens 2016-05-07 16:30:54 +02:00
Daniel Marjamäki
dc2a92263a Fixed #7426 (RFC: time to replace simplifyEnum?) 2016-04-22 06:02:54 +02:00
Daniel Marjamäki
cef6b35bb8 Improve MAXTIME handling 2016-02-11 16:10:52 +01:00