We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Lexems with same BeginBlock and different EndBlock

Thread ID:

Created:

Updated:

Platform:

Replies:

70031 Nov 23,2007 04:46 AM Dec 27,2007 04:40 AM Windows Forms 5
loading
Tags: EditControl
Steffen Schurg, SD-ES
Asked On November 23, 2007 04:46 AM


Hello,

I've got difficulties to get complex lexems highlighted correctly, when different lexems have the same BeginBlock:

------------------------
lexem BeginBlock="IF" EndBlock="GOTO" Type="KeyWord" IsComplex="true" IsCollapsable="false"
SubLexems/
References/
/lexem

lexem BeginBlock="IF" EndBlock="END_IF" Type="KeyWord" IsComplex="true" IsCollapsable="true" CollapseName="IF STATEMENT" Indent="true" IndentationGuideline="true"
SubLexems
lexem BeginBlock="THEN" Type="KeyWord"
lexem BeginBlock="ELSE" Type="KeyWord"
lexem BeginBlock="ELSIF" Type="KeyWord"
lexem BeginBlock="\n" IsBeginRegex="true"
/SubLexems
References/
/lexem

lexem BeginBlock="GOTO" Type="KeyWord">
SubLexems/
References/
/lexem
------------------------

Is there a possibility to get the following highlighted correctly?

------------------------
IF a < b THEN
GOTO label1
ELSIF a > b THEN
GOTO label2
END_IF

IF a < b GOTO label3

IF a < b THEN
a := 4
ELSE
b := 5
END_IF
------------------------

Thanks in advance!
Steffen

(used Version 5.2.0.25/.NET1.1)



Bhuvaneswari P [Syncfusion]
Replied On November 26, 2007 06:20 AM

Hi Steffen,

Thank you for your interest in Syncfusion products.

We have created sample as you expected. Please download the sample from the below link:
http://websamples.syncfusion.com/samples/Edit/F70031/main.htm

You can get more regarding this from the Browser sample from the below link:
\\Syncfusion\EssentialStudio\5.2.0.25\Windows\Edit.Windows\Samples\2.0\Syntax Highlighting\SyntaxColoringDemo

Please let me know if you have any other queries.

Best Regards,
Bhuvana




Steffen Schurg, SD-ES
Replied On November 26, 2007 10:56 AM


Hello Bhuvana,

thank you for your quick reply!

Unfortunately your example doesn't fully solve my issue as you presumend the GOTO statement is only a separate lexem. But there is a IF ... GOTO statement in that language as well.

To be clear three different statements exist:

- IF THEN [ELSIF THEN ] [ELSE ] END_IF
- IF GOTO

Bhuvaneswari P [Syncfusion]
Replied On November 27, 2007 01:32 AM

Hi Steffen,

Thanks for the update.

Here is the code snippet for the below conditions
1. IF THEN [ELSIF THEN ] [ELSE ] END_IF

CollapseName="IF..END_IF" >








2. GOTO

Steffen Schurg, SD-ES
Replied On November 27, 2007 09:24 AM

Hi Bhuvana,

sorry, that didn't solve it either.

The lexems 1 and 2 (in that order) on their own work quite well - as long as there is no IF..GOTO statement.

Adding lexem 3 to config.xml doesn't make any difference to highlighting, but you can see at the collapse lines, that with added lexem 3 the IF..GOTO statement is wrongly ended with END_IF and in the other case (lexem 3 left away) the collapse line doesn't end at all.

Please add CollapseName attributes to the lexem tags and try to collapse the different blocks so you can see where the different lexems terminate. In addition please remove the stand-alone THEN lexem as THEN should be only highlighted within IF context.

I'm still quite at a loss.

Best Regards,
Steffen



Bhuvaneswari P [Syncfusion]
Replied On December 27, 2007 04:40 AM

Hi Steffen,

Thanks for the update.

Already we have forward this to our development team. We will let you know once we get back from them.

Please let me know if you have any other questions.

Best Regards,
Bhuvana



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;