|Re: Xtext Grammar - Exclusion of a specific Rule [message #1064796 is a reply to message #1064689]
||Fri, 21 June 2013 07:30
| Jan Koehnlein
Registered: July 2009
You could write a separate rule for elements that can appear inside a |
'Bold'. I would not recommend this, as the user would get an error from
the parser (unexpected token) instead of a helpful message (e.g. 'bold
not allowed within bold'). So rather be generous in the grammar and
cover these constraints with validation rules.
Am 20.06.13 16:47, schrieb Edwin Tuzar:
> So I have the following rules:
> BinaryElements | Image | Link | Text
> Bold | Italic | Underline | Paragraph
> now I want for Bold to do the following:
> 'b' (htmlaccelement+=HtmlAcceptedElement)+ '/b'
> but I want to don't allow Bold rule to be inside this:
> (htmlaccelement+=HtmlAcceptedElement)+ is this possible? to say somehow
> HtmlAcceptedElement except Bold ?
> Thanks in advance!
> Best regards,
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Get professional support from the Xtext committers at www.typefox.io
Powered by FUDForum
. Page generated in 0.02801 seconds