I'm having trouble with this. I'm using C# so I attempted to translate it as follows
syntaxEditor.Document.Language = language;
language.IsUpdating = true;
DynamicLexicalState lexicalStates = (DynamicLexicalState)language.LexicalStates["DefaultState"];
LexicalPatternGroup keywordPatternGroup = lexicalStates.LexicalPatternGroups["ReservedWordToken"];
language.IsUpdating = false;
1. new LexicalPatternGroup("test") doesn't compile as there's no overload for it.
2. When I execute the code (without the above) keywordPatternGroup is null
My xml language file is is much reduced version of the C#.net example.
What I really wanted to do was, I think, slightly different but I couldn't get past this point. I need to color user defined tokens, and added another ExplicitPatternGroup with an empty ExplicitPatterns to which I intended to add the new tokens (and later delete then add new ones). The code sample appears not to use ExplicitPatterns which I would have thought preferable.
I'd really appreciate some pointers.
[Modified at 09/11/2007 10:21 AM]