C++: Fix cplusplus-keywordgen to generate Keywords.cpp

Fix kewordgen to generate current Keywords.cpp with minimal diff,
but also to be compatible with old usage and kwgen files.

Add new parameters:
%no-namespace-for-tokens - not use namespace for tokens
%pre-check-argument - set type and name of additional variable to use
%function-name - name of a function ("classify" by default)
%pre-check - name of a variable to check for a keyword (i.e. cxxEnabled)
Now "%%" is also used to end and restart keywords parsing to be able to
generate additional keywords for classifyOperator()

Automatically add checks for LanguageFeatures to generated code
Pass input and output files with command line arguments, print usage

Update Keywords.kwgen to include all keywords currently used

Add missing aliases to Token.h

Change-Id: I6cc84e150e0d797277204032fc05ce9cfbd01f58
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Volodymyr Zibarov
2020-05-26 22:05:11 +03:00
parent 3563c457a5
commit df6d95c3e1
4 changed files with 660 additions and 341 deletions

View File

@@ -293,6 +293,11 @@ enum Kind {
T___ATTRIBUTE = T___ATTRIBUTE__,
T___ALIGNOF__ = T_ALIGNOF,
T_SLOTS = T_Q_SLOTS,
T_FOREACH = T_Q_FOREACH,
T_SIGNALS = T_Q_SIGNALS,
T_Q_OVERRIDE = T_Q_PROPERTY,
};
class CPLUSPLUS_EXPORT Token