Posted 20 years ago by Campion
Avatar
Is there a way to change a token's HighlightingStyle ForeColor during semantic parsing (PostParse method)?

The goal is to distinguish between user-defined functions and system functions by color. The regex I'm using for the token is:
<RegexPatternGroup Token="FunctionToken" Style="FunctionStyle" PatternValue="(_ | {AlphaMacro})({WordMacro})*" LookAhead="{FunctionMacro}"/>
The LookAhead, basically, just matches on "(".

If I can't change the color during semantic parsing another approach I'm considering is loading the system functions (static list of about 200) at run-time. Then I'd have one token and style for user-defined functions (listed first in the language definition file) and a second token (using the same regex) and style for system functions.

Any alternative design others would like to offer if semantic parsing doesn't suffice?

Comments (3)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This is something we've had on our TODO list. We've added Token.CustomHighlightingStyle for the next maintenance release. Just set the HighlightingStyle for your user-defined functions to that property for the Tokens that should be displayed differently and it should work nicely.


Actipro Software Support

Posted 20 years ago by Campion
Avatar
cool...what is the ETA for the next maintenance release?
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It should be fairly soon. The new release will also feature a single-line edit mode which can mimic regular TextBoxes but have all the features of SyntaxEditor.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.