Validating Pattern Groups

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by painetraine
Avatar
I am modifying several PatternGroups at runtime by adding LexicalPatterns to them.

However, because I can sometimes add items which the editor hiccups on when I do a IsUpdating = false, I do IsUpdating true/false before/after each of the 6 groups I update. For large scripts this causes longer waits since I'm guessing it has to reparse doc 6 times with new items as opposed to 1 time if I were to wrap the entire update in a single IsUpdating t/f.

I would like to wrap whole update in one IsUpdating t/f but I need to know which group had bad items so I don't have to rollback all 6 just because 1 might have invalid tokens. is there a way to validate a PatternGroup to make sure it would accept the changes before calling IsUpdate = false so that I could eliminate some redudancy?

Also, in terms of speed, I have been thinking of saving various configurations as separate compiled language files. Would loading different language files be faster than simply updating the patteren groups at runtime or is there no real speed difference?

Also, when are we going to see the lexical parsing speed improvements (ie v3.0 or whatever you plan to call next major release) <IMG SRC="smile.gif" border="0">

Thanks,

Ashton

Comments (3)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
When you set IsUpdating to false, it actually is fairly optimized already. If you didn't modify any patterns, it doesn't rebuild regexes. What it does have to do is run through the entire SyntaxLanguage tree of objects (states, pattern groups, etc.) and ensure that you didn't do something that will cause a run-time exception.

If you modify the language at run-time you are adding more time so yes, loading a separate def and not modifying it after would be fastest. But if it's not a major increase, you might as well keep your single def and modifying it method.

Sorry, work on SyntaxEditor 3.0 has been put on hold for a few days. We're been preparing and are just about ready to switch web hosts and launch a new web site for ActiproSoftware.com. The new web site is completely rewritten and has a fresh new look and improved interface. We're really excited and hope to get it out within the week.


Actipro Software Support

Posted 19 years ago by painetraine
Avatar
Hey, you guys aren't selling web stuff. Back to work on products for me. Chop Chop <IMG SRC="smile.gif" border="0">

Thanks
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hehe... web site is now ready to go... you'll be impressed when you see the new one. Should switch probably over the weekend.


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.