Case Correction of Lexemes

SyntaxEditor for WPF Forum

Posted 10 years ago by Andrew Hollom - Senior Software Developer, ABB Motion
Version: 13.2.0591
Avatar

I started out using the langauge designer and regular expressions, but decided it would be easier to implement a programmatic lexer, since I have one already coded that's used inside a compiler. I've retargeted it (based on the lexer used in sample 3c) and it seems to work fine, but I can't find any information on how to make automatic case correction work. The language designer used a drop down to allow this, and on examining the code generated, it just sets a member called DefaultCaseSensitivity to CaseSensitivity.AutoCorrect, but this isn't available using a programmatic lexer.

I've had a read of the help file and searched the forum, so any ideas would be gratefully received.

Comments (1)

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

For auto-case correction features, you'd need to make a class that inherits AutoCaseCorrector and then call language.RegisterAutoCorrector(yourCorrector) to register it as a service.  If you look at the "Language Creation Guide / Feature Services / Auto-Corrector" topic in the documentation, it talks about how to do this.  We do it for our VB language in the .NET Languages Add-on, which uses a programmatic lexer.


Actipro Software Support

The latest build of this product (v24.1.1) 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.