Hi David!
If you've already followed the instructions in the link you posted, you have your own customization layer separated out from the 4coder default custom layer code. In order to use your new keywords you're going to need to implement your own version of the file_settings hook found in 4coder_default_hooks.cpp. Obviously your life would be easier if I supported an API like:
| Keyword_Table table = join_keyword_tables(cpp_keyword_table, my_keyword_table);
Parse_Context ctx = register_keyword_table(table);
set_extension_ctx("cpp", ctx);
set_extension_ctx("h", ctx);
|
However I just don't have anything close to that convenient setup, so you're going to have to manually put all those pieces together.
1. When you generate your list of keywords from the parse, you'll need to manually copy the keywords from the default C++ (or whatever language) table and join them together into a single language file in your project.
2. You will need to implement a copy of the file settings hook that goes to your own language data when it detects the extensions you care about.
3. You will need to change 4coder to using your file start hook instead of the default file settings hook.
BUT! There's some good news. If you're only trying to make this work with C++ there's a little hack setup to avoid all that nonsense. Instead what you can do is inject your special keywords with just a single define.
In the table of C++ keywords I have the following bit of code:
| #if defined(EXTRA_KEYWORDS)
#include EXTRA_KEYWORDS
#undef EXTRA_KEYWORDS
#endif
|
So if you generate a list that matches this format (and has nothing before or after it in the file):
| PSAT("u8", CPP_TOKEN_KEY_TYPE),
PSAT("u16", CPP_TOKEN_KEY_TYPE),
PSAT("u32", CPP_TOKEN_KEY_TYPE),
|
Then you can define
EXTRA_KEYWORDS to the name of that file before you include the default include and it will inject the contents of that file right into the C++ table. Then you don't have to do any joining work and the default hook will pick up your modifications automatically without you changing the hook.
Hope that is enough to get you there!