Problems with LexicalScope - ending named variable token

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Brian Battersby
Version: 4.0.0258
Avatar
Hello, We have our own language that I am creating dynamically. I have reviewed the various programming examples and XML examples. However I am stuck on an issue. We have many named variables that get supplied dynamically during runtime. I have successfully created the lexical state for recognizing the start of the token. However, the end token for the variable name is not being recognized when it is an alphanumeric character. For example, if we have a variable named var_1, I would like the highlight for the text to change to the default when the user types the number 2 in the following name: var_12. I know that this capability works with your product because I have seen it demonstrated for the C# language. I just need help figuring out how to code this in C#.

Thank you, Brian B.

Comments (1)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Brian,

A piece of advice, start out with a prototype XML definition and work with that to get a sample of your language working. Then translate it to code once you have the concepts nailed down. That will make things easier than completely building it via code first.

But anyhow, I don't know what your pattern is but you could always add a lookahead regex to the pattern group that watches for a number and if so uses the alternate style.

Hope that helps.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.