Posted 19 years ago by Greg Shaffer - Boulder
Avatar
Hi,

I'm running into some performance issues with semantic parsing in the PostParse function.

I think to solve the problem, I need to only parse for ".", "(", and after the control has been idle for a certain amount of time.

Is there a built-in way to get to the control (editor) from the PostParse function on a SemanticParser? It would be nice to know which control I'm editing, which is complicated by the fact that my SemanticParser is static (set in a Static language because I have many editors). If I can get to the control, then I might be able to determine idle state.

Thanks,
Greg

Comments (6)

Posted 19 years ago by Greg Shaffer - Boulder
Avatar
Nevermind.

I discovered System.Windows.Forms.Application.Idle event.

-Greg
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The problem is that since we separated out the document object model and the user interface, the document could be edited in several controls at the same time. So the document never really knows who's editing it. It just raises events and the SyntaxEditor controls that are attached pick up and handle the events.


Actipro Software Support

Posted 19 years ago by Greg Shaffer - Boulder
Avatar
You could have a list of controls in the document.

-Greg
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
True but we're trying to keep documents separated from UI so that they can be used independently like in CodeHighlighter.


Actipro Software Support

Posted 19 years ago by Greg Shaffer - Boulder
Avatar
OK,

That seems like a good idea. The problem I have with the current "PostParse" callback is that it gets called all the time, which means that I have to add some special code to determine if I need to reparse all or a portion on the token stream.

It would be a nice feature to have some sort of a semantic parsing rules mechanism where users could specify when they want to parse, for performance reasons.

For example, I parse on these events:
1) "." has been typed (I parse up to this point)
2) "(" has been typed (I parse up to this point)
3) changes have been made to the document and the last change to the document was at least 1.5 seconds prior (I parse entire document)

Then, the semantic parser would adhere to these rules and only call PostParse when appropriate.

-Greg
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Greg, we're having a roundtable chat about the next major version of SyntaxEditor this coming Wednesday. Why don't you sign up for that (instructions are in another posting in this forum) and we can discuss all your ideas there.


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.