I am implementing a non-dynamic language based on the CSharpSyntaxLanguage example.
The lexical parser and semantic parser are both working pretty well. I'm developing the AST etc now.
One limitation that I have found is that the semantic parsing phase can't assign a custom HighlightingStyle to a token. The lexer may have determined that there is an identifier token and can even say that it is a keyword. It does not know the context however. It might be a valid keyword but in the wrong place. I'd like to flag this with a custom style but only the semantic parser will be able to determine the full context.
The documentation under "Assigning a Custom HighlightingStyle to a Specific Token" informs me that "This feature is for dynamic languages only".
Also I note that using the parsing service does not allow access to the tokens since it runs in a separate thread. I'm running in the main UI thread now but want to move it to the service later on.
I see that Adam Dickinson in his post "Advanced Syntax Highlighting Problem" seems to have had a similar problem and has a found a workaround with Solution #1 and your toggle ReadOnly trick.
Is there a better way to approach this now? If not would you please consider this as something to be enhanced. Pretty much any advanced language would want to possibly rework the tokens in the semantic phase.
Other than that I'm really enjoying the new V4 product ! So much more powerful to write and faster to execute than the dynamic approach. More of a learning curve but well worth it.
The lexical parser and semantic parser are both working pretty well. I'm developing the AST etc now.
One limitation that I have found is that the semantic parsing phase can't assign a custom HighlightingStyle to a token. The lexer may have determined that there is an identifier token and can even say that it is a keyword. It does not know the context however. It might be a valid keyword but in the wrong place. I'd like to flag this with a custom style but only the semantic parser will be able to determine the full context.
The documentation under "Assigning a Custom HighlightingStyle to a Specific Token" informs me that "This feature is for dynamic languages only".
Also I note that using the parsing service does not allow access to the tokens since it runs in a separate thread. I'm running in the main UI thread now but want to move it to the service later on.
I see that Adam Dickinson in his post "Advanced Syntax Highlighting Problem" seems to have had a similar problem and has a found a workaround with Solution #1 and your toggle ReadOnly trick.
Is there a better way to approach this now? If not would you please consider this as something to be enhanced. Pretty much any advanced language would want to possibly rework the tokens in the semantic phase.
Other than that I'm really enjoying the new V4 product ! So much more powerful to write and faster to execute than the dynamic approach. More of a learning curve but well worth it.