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. Image for the cookie policy date
close icon

Lexems working across an entire line

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 [] 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

1 Reply

CR Chandran R Syncfusion Team June 4, 2013 04:44 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon