summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/PPToken.h
Commit message (Collapse)AuthorAgeFilesLines
* C++: Use more direct approach to recognize special Qt tokenshjk2013-04-191-6/+1
| | | | | Change-Id: I45399a196500cbc6aecedfaa94a50890914906f1 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-2/+2
| | | | | | | | | | | ... and adjust INCLUDEPATH accordingly. while i'm at messing with include statements, also re-order the include blocks according to policy and sort them within bigger blocks. Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | C++: fix PPToken equals operator for c-strings.Erik Verbruggen2013-01-111-1/+1
|/ | | | | Change-Id: I37411faa1724fb69467036279b2821e33cad26b5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Adjust license headershjk2012-10-051-0/+29
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: Core changes in preprocessingLeandro Melo2012-06-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of most relevant items: - Preprocessor output format change. No more gen true/false. Instead a more intuitive and natural expansion (like from a real compiler) is performed directly corresponding to the macro invocation. Notice that information about the generated tokens is not lost, because it's now embedded in the expansion section header (in terms of lines and columns as explained in the code). In addition the location on where the macro expansion happens is also documented for future use. - Fix line control directives and associated token line numbers. This was not detected in tests cases because some of them were actually wrong: Within expansions the line information was being considered as originally computed in the macro definition, while the desired and expected for Creator's reporting mechanism (just like regular compilers) is the line from the expanded version of the tokens. - Do not allow for eager expansion. This was previously being done inside define directives. However, it's not allowed and might lead to incorrect results, since the argument substitution should only happen upon the macro invocation (and following nested ones). At least GCC and clang are consistent with that. See test case tst_Preprocessor:dont_eagerly_expand for a detailed explanation. - Revive the 'expanded' token flag. This is used to mark every token that originates from a macro expansion. Notice, however, that expanded tokens are not necessarily generated tokens (although every generated token is a expanded token). Expanded tokens that are not generated are those which are still considered by our code model features, since they are visible on the editor. The translation unit is smart enough to calculate line/column position for such tokens based on the information from the expansion section header. - How expansions are tracked has also changed. Now, we simply add two surrounding marker tokens to each "top-level" expansion sequence. There is an enumeration that control expansion states. Also, no "previous" token is kept around. - Preprocessor client methods suffered a change in signature so they now receive the line number of the action in question as a paramater. Previously such line could be retrieved by the client implementation by accessing the environment line. However, this is not reliable because we try to avoid synchronization of the output/environment lines in order to avoid unnecessary output, while expanding macros or handling preprocessor directives. - Although macros are not expanded during define directives (as mentioned above) the preprocessor client is now "notified" when it sees a macro. This is to allow usage tracking. - Other small stuff. This is all in one patch because the fixes are a consequence of the change in preprocessing control. Change-Id: I8f4c6e6366f37756ec65d0a93b79f72a3ac4ed50 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix warning about truncation from size_t to quint.Friedemann Kleint2012-05-071-1/+1
| | | | | | | qstrncmp() takes a quint. Change-Id: I6e11155a793e3a4d9d29861ebb7c7a9c5c2f31c8 Reviewed-by: hjk <qthjk@ovi.com>
* Fix out-of-memory crash when indenting generated tokens.Erik Verbruggen2012-04-231-2/+5
| | | | | | | | | | | | Generated tokens do not have a position in any source file, so not try to indent them. Previously, the 'source' used was the scratch buffer, which would not contain newlines, so the indent depth would be the length of the scratch buffer at that point. Task-number: QTCREATORBUG-7262 Change-Id: If94213d6dffd13dd2b47c7038ec2398ad925d904 Reviewed-by: Yuchen Deng <loaden@gmail.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* preprocessor: make CPlusPlus::Internal::ByteArrayRef publichjk2012-04-191-1/+2
| | | | | Change-Id: Ief6ea71f750b6ba19b650050bae376f4ad82d9d2 Reviewed-by: hjk <qthjk@ovi.com>
* preprocessor: save cycles by using ByteArrayRefhjk2012-04-191-0/+5
| | | | | Change-Id: I339696763b045ef1bda17dd55746738ef4ddbb67 Reviewed-by: hjk <qthjk@ovi.com>
* preprocessor: streamline ByteArrayRefhjk2012-04-191-14/+9
| | | | | Change-Id: Iec09651a6aa2fe3b8a50e631fd2fdc57830892a5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* preprocessor: provide direct char* overloads for ByteArrayRef::operator==hjk2012-04-181-0/+5
| | | | | Change-Id: I58de7e704bdbd3861a4a534d8080cc2a8399b7eb Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* preprocessor: avoid branches in tight codehjk2012-04-171-8/+13
| | | | | Change-Id: I8dc0910f1cf11e506eb415a6f313b47ad2d41eae Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
* preprocessor: make PPToken inlineable.hjk2012-04-171-1/+1
| | | | | Change-Id: Ie86b4ff4a6f1987a15fcc46e8de9db487af1729a Reviewed-by: hjk <qthjk@ovi.com>
* [C++] Rewrite of the preprocessor.Erik Verbruggen2012-03-291-0/+106
This rewrite fixes a couple of issues with the pre-processor. It now supports: - macros in macro bodies - stringification of parameters [cpp.stringize] - the concatenation operator [cpp.concat] - #include MACRO_HERE - defined() inside macro bodies used in pp-conditions. Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>