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

Denis Shienkov denis.shienkov at gmail.com
Tue Apr 23 13:34:25 CEST 2019


Ping.

пт, 19 апр. 2019 г. в 13:34, Denis Shienkov <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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20190423/ebae296b/attachment.html>


More information about the Qt-creator mailing list