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 working across an entire line

Thread ID:

Created:

Updated:

Platform:

Replies:

109096 May 29,2013 01:50 AM Jun 4,2013 12:44 PM Windows Forms 1
loading
Tags: EditControl
Jason Sobell
Asked On May 29, 2013 01:50 AM

I'm trying to recognise the following structures:

(1)
IF VARIABLE(THINGY) != "Q" THEN
  Blah
ENDIF

(2)
IF VARIABLE(WHATEVER) != "X" THEN DoSomething

I can detect(1) with
<lexem Priority="5" BeginBlock="If" EndBlock="endif" Type="ConditionBlock" Format="ConditionBlock" IsComplex="true" IsCollapsable="true" CollapseName="If...Endif"
/>

However, I can't see a way of detecting (2) without (1) being picked up instead (and any EndIf in the document being used as an endblock). I would like to have (2) chosen when it detects printable text after the THEN statement.

I also can't see any way to ensure the IF statement is the first statement on the line, as using '^' to indicate the start of the line is always matched as true, and prefixing the rule with [\n] or [\r] fails to match.

Some more doco or examples on the lexems would be nice, as it's pretty tricky if you're developing syntaxes for your own language...

Cheers,
 Jason

Chandran R [Syncfusion]
Replied On June 4, 2013 12:44 PM

Hi Jason,

 

Thanks for using syncfusion product.

 

I have attached the sample as per your requirements . Please find the sample from attachments and let us know if it helps you and you could customize the xml [Intellisense] as per your requirements.

 

Please let us know if you need any other details.

 

Regards,

 

Chandran R



EditControl1_5e0f4a39.zip

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.

;