[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.tmf] Re: How to return a list of objects?
|
it is currently not possible to return a list of objects from a parser
rule. You'll have to copy the annotation snippet to every location.
I have been thinking of different solutions:
1. have something like macro-rules: they look like rules
but in realty, they are copied into each location
(the solution you suggested but automated)
2. allow to inherit a rule (run it in the context of the
"parent" rule). In that case it would act as
"extension" (not much different form solution 1)
3. rules with no assignment could return a list
that can be assigned to a list variable:
ListRule returns list: list+=Element (',' List+=Element);
4. rules could have attributes
Parent: list=ListRule.list;
ListRule: list+=Element (',' List+=Element);
5. Allow expression to build up the object:
Parent: ListRule as X {list=X.list; foo=X.foo};
ListRule: (foo?='foo')? list+=Element (',' List+=Element);
...
Michael
--
Michael Scharf
Wind River Systems GmbH
http://www.WindRiver.com
http://MichaelScharf.blogspot.com/