Coloring of text without parsing

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Disha Gosalia
Version: 4.0.0275
Avatar
I am new to SyntaxEditor. I have a parser that I have been using with my language. I am going to invoke this any time an edit is made to the document, and it will return me with color for each (index, length) pair in the document. How do I use this information to syntax color my document in SyntaxEditor

Thanks

Comments (5)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry that isn't possible right now. Our product supports creation of custom programmatic lexical parsers though. Perhaps you could tie into that.

That being said, we are looking at a way to do your request in the future.


Actipro Software Support

Posted 11 years ago by Disha Gosalia
Avatar
The parser is written in antlr. Its being in production for more than 5 years and has gone through multiple development cycles. Is there a way to generate the grammar for the SyntaxEditor from the grammar file used by antlr (.g file)? I can imagine a lot of
grammars are written .g format of antlr. Antlr's being around for a long time and a lot of grammars already exisit

If not, isn't it that under-the-hood somewhere you are using the color scheme specified by your grammar file to color individual tokens. Could this not be exposed out? That way, I can use the information from my parser to colorize individual tokens.

I am going to embed this SyntaxEditor into our application that has a very sophisticated event manager. It can watch for edits and keypresses. So, the only thing I need is a way to colorize individual tokens - in the meantime - until .g grammar can be converted over.
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well like I said, right now there isn't a way short of writing a programmatic lexical parser (or using our dynamic language XML definitions) to syntax highlight text. However in the prototyping we're doing for our WPF version of SyntaxEditor, which will have a lot of enhancements we've been planning for quite a while, I do believe there will be a very low level way for you to indicate highlighted spans. Actually our development code there is using just such a mechanism at the moment since we haven't gotten to the parsing design yet. This is something that was requested before so we're trying to find a way to expose it to developers in a good, clean way.

Once we get past some core editing features for the SyntaxEditor for WPF version, we'll be moving onto the parsing design. Another thing we'll be considering at that point is being able to load Antlr files since that seems to be a common request from our customers.

While we are going to be prototyping these sorts of ideas out with our WPF version, after it is complete we will be going back to update our WinForms version to use the new common document/parsing library that will be shared with the WPF version and will be trying to also have it use some of the neat new UI concepts we've been working on.


Actipro Software Support

Posted 11 years ago by Disha Gosalia
Avatar
Thank you for your response. A few more questions:

1) Are you at a point in your WPF development of the Syntax Editor to give some estimates of when it will be available?

2) Is the WinForms SyntaxEditor 64-bit ready?

Thanks
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
1) Not yet, however we have been and will continue updating our blog as development progresses so keep an eye on that for status information.

2) Yes, it should work fine in 64-bit Windows.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.