[Qt-creator] [baremetal] Add additional compiler keywords to CPP editor

Andre Hartmann andre.hartmann at iseg-hv.de
Wed Apr 24 08:00:44 CEST 2019


Hi Denis,

you might be interested in QTCREATORBUG-21407 where I state exactly the 
same problem. Marco commented, it might be possible to hide these 
extensions from the code model by replacing them with spaces.

I have, however, a suggestion for you. I've started with replacing our 
compiler specific extensions (like @far and @eeprom etc.) with macros.

The scheme is like this:

#ifdef TESTS
#define _far
#else
#define _far @far
#endif

In the generic project I define the symbol TESTS and from now on Creator 
can deal with the sources perfectly.

The big advantage is, that the same source code now can be used with 
"standard" compilers, e.g. for unit tests or to allow easier porting.

That is, however, a long term porting effort and nothing that helps 
immediate.

Regards,
André

https://bugreports.qt.io/browse/QTCREATORBUG-21407

Am 23.04.19 um 13:34 schrieb Denis Shienkov:
> Ping.
> 
> пт, 19 апр. 2019 г. в 13:34, Denis Shienkov <denis.shienkov at gmail.com 
> <mailto:denis.shienkov at gmail.com>>:
> 
>     Hi guys.
> 
>     How I can add an additional compiler keywords (e.g. present in KEIL
>     C51 compiler, like: idata, xdata, pdata and others) to the QtC
>     editor. Because otherwise, the QtC highlids this keywords as an
>     errors, f.e:
> 
>     int main(void)
>     {
>          unsigned char xdata variable; /// <<< HERE an 'xdata' is a C51
>     compiler's keyword.
>     }
> 
>     I would to add this keywords only to 'baremetal' plugin... Also, a
>     set of this keywords is different for each bare-metal toolchain
>     (e.g. on KEIL, on IAR it is different).
> 
>     I looked the QtC sources and I see the 3rd Token class, but that
>     class is a common for all compilers. Besides, the default
>     CppHighlighter class is rigidly tied to the Token, and no any chance
>     to flexible set any new keyword there.
> 
>     For me, it would be good to be possible to automatically set the
>     keywords, depends on current CPP toolchain. E.g. if I will use the
>     IAR toolchain, then CppEditor will know the IAR keywords... If I
>     want to switch to the KEIL toolchain, then the CppEditor also will
>     switch the syntax highliding to the KEIL keywords.
> 
>     Is it possible to implement this behavior at all?
> 
>     BR,
>     Denis
> 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator
> 


-- 
Dipl.-Ing. (FH) André Hartmann
Softwareentwicklung / Software Development

E-Mail: andre.hartmann at iseg-hv.de | Tel: +49 351 26996-43 | Fax: +49 351 
26996-21

iseg Spezialelektronik GmbH - HIGH VOLTAGE. EXACTLY.
iseg-hv.de | iseg-hv.com | download.iseg-hv.com

Bautzner Landstr. 23, 01454 Radeberg / Rossendorf, Germany
Geschäftsführer / Managing directors: Dr. Frank Gleisberg, Dr. Joachim 
Pöthig
Amtsgericht / Lower district court: Dresden HRB 16250
Umsatzsteuer-Id: / VAT-ID: DE812508942

News / Information
https://iseg-hv.com/en/products/control#isegControl2 isegControl2 - 
Unified Control Software
https://iseg-hv.com/en/products/detail/EHS EHS FLEX - Customize and keep 
the price
https://iseg-hv.com/en/products/detail/EHS EHS STACK - Perfect for GEM 
Detectors
https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf NEW! 
Product catalog 2017 / 2018 released
https://iseg-hv.com/en/products/detail/NHR NHR - NIM HV-Supply with 
reversible polarity

Links
https://www.linkedin.com/company/12726924 iseg on LINKEDIN | Let's stay 
connected!
https://www.youtube.com/channel/UC5AL-ZgOqSim_1gYNnndyzQ iseg on YOUTUBE 
| Tutorials and more ...
https://www.twitter.com/iseg_hv iseg on TWITTER | please follow!
https://iseg-hv.com/files/iseg-high-voltage-power-supplies.pdf iseg 
CATALOG | download product catalog as PDF
http://download.iseg-hv.com/ iseg DOWNLOADS | manuals, software, 
firmware and more...

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
Informationen. Wenn Sie nicht der richtige
Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren 
Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte 
Weitergabe dieser Mail ist nicht
gestattet.

This e-mail may contain confidential and/or privileged information. If 
you are not the intended recipient
(or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in 
this e-mail is strictly forbidden.


More information about the Qt-creator mailing list