Event on sepific token

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Werdna
Avatar
Is there a way to have the editor (or preferabley derived class of SyntaxLanguage) receive event when specific TokenID is lexed?

I looked at triggers, but I don't see much documentation on those.
Thanks.

Comments (3)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry there isn't anything built-in that does that right now. Could you provide some more detail on what you would use such a feature for? This will help us determine future designs.

That being said, you still can achieve this sort of thing on your own by using a programmatic lexical parser where you are parsing the tokens. The Simple language sample's lexical parser is an example of a programmatic lexical parser. You can add code to that sort of thing to track token parsings.


Actipro Software Support

Posted 16 years ago by Werdna
Avatar
I would want to use it for inteliprompt.
I know I can use keypress event and go back to previous token from there, it just seems a bit less efficient. If the editor already has the list of tokens, it would be good to regsiter a token to trigger an event.
As an example, I want to bring a list of available types after uses types AS.
What I have to do now, is watch for space key press (following AS), keep reading all previous tokens that are whitespace (there could be more than one space) and see if next non-white space token is AS.
AS is only one of the tokens. I have several others that trigger different lists.
Having to keep going back through token list for each keypress just seems inefficient.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I think I see where you are going with the idea. But even if we were firing this for a token, it would fire for the whitespace and you still would have to scan back to see if an As was there, right? I'm curious how you would envision it working, maybe you can describe it with the series of events and what you would do in pseudocode. Thanks!


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.