PerformLexicalParse - SE 4.0

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Russell Mason
Avatar
Hi

In the documentation there is an example of an implementation for PerformLexicalParse.

This has a comment to 'back up certain number of tokens ...'. In the Simple language I can't see anything that does this and the parsing method (GetNextTokenLexicalParseData) seems to come from the MergableLanguage (through IMergableLanguageParser). I am trying to derive from SyntaxLanguage where I think I have to do more of this myself than the MergableLanguage.

Is there some kind of default implementation of this 'backing up' in MergableLanguage, if so is there a helper or code you provide to show a basic implementation? By default is this likely to just back track to the last whitespace character?

Thanks
Russell Mason

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
MergableSyntaxLanguage handles the backing up for you and will go back the number of lines indicated in its LexicalParserLineLookBehind property. Yes, the mergable language coordinates one or more IMergableLanguageParser instances for various languages to allow language merging and transitioning.

Our code typically takes the parse start offset, determines its document line, backs up a line, ensures we're at the start of the token we're now on, and then parses from there. Hope that helps!


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.