PerformLexicalParse - SE 4.0

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Russell Mason

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?

Russell Mason

Comments (1)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
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 (v24.1.0) was released 5 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.