|Re: Expression ordering [message #1032133 is a reply to message #1027347]
||Tue, 02 April 2013 15:59
| Sebastian Zarnekow
Registered: July 2009
no, there is no straight forward way to achieve that. You may want to
digg into feature maps or use EObject as the common super-type.
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 26.03.13 23:02, schrieb Robert Heath:
> Thank you in advance for your patience with my string of posts :)
> I have a general question about the ordering of actions in a rule body.
> Say I have 2 lists I'm appending to in a rule:
> list1+=type1 |
> Without create a superclass that represents both types and a single list
> to store them in, is there a way to allow these types of expressions to
> be interleaved in a grammar? Creating a single list isn't very
> practical for use at runtime in some cases, and only allowing instances
> of each time in a contiguous sequence is restrictive on the grammar.
> One approach is to generate a new model based on the model used for
> parsing, but a big bonus for using xtext is the automated serializer.
> 2nd question, I think the best approach is to handle this in a
> validator, BUT I thought I'd ask just for the sake of it. If the
> existence of an element of the grammar depends on the existence of
> something else in the grammar, but they can be in any order, is there a
> way to enforce this syntax in the parser?
Powered by FUDForum
. Page generated in 0.02985 seconds