[TCS] operatorTemplate source list containment [message #18314] |
Tue, 29 July 2008 09:43 |
T Kruse Messages: 73 Registered: July 2009 |
Member |
|
|
Hi,
I have a problem realizing an idea with TCS.
I want my language to allow some kind of dot notation of expressions, such
as
abc.xyz.aaa.foo.bar
I have a metamodel with modelElements
ExpressionList, AbstractExpression, StringExpression, BinaryDotExpression
(I hope the names explain their meaning)
Since the syntax above is left recursive, I use an operatorTemplate for
BinaryDotExpression and make AbstractExpression operatored.
What I would like to have, is that after parsing of the example above, the
ExpressionList modelElement would directly contain as elements:
(abc, BinaryDotExpression1, BinaryDotExpression2, BinaryDotExpression3,
BinaryDotExpression4).
What I get using TCS however is that ExpressionList only contains
BinaryDotExpression4, which in turn contains BinaryDotExpression3 and
"bar", and so forth as a tree.
Is there any way to achieve this with TCS?
|
|
|
|
Re: [TCS] operatorTemplate source list containment [message #18347 is a reply to message #18314] |
Tue, 29 July 2008 14:47 |
Frédéric Jouault Messages: 572 Registered: July 2009 |
Senior Member |
|
|
Hi Thibault,
Currently, TCS creates a tree from expressions. For instance:
1 + 2 + 3 + 4
may be injected as:
+
1
+
2
+
3
4
There is currently *no* support for injection of such constructs as
list, which would look like:
+
1
2
3
4
This feature may be added at a later time.
I would suggest changing your metamodel or, if you cannot, use two
metamodels with transformations between them as appropriate.
Regards,
Frédéric Jouault
Thibault a écrit :
> Hi,
>
> I have a problem realizing an idea with TCS.
> I want my language to allow some kind of dot notation of expressions,
> such as
>
> abc.xyz.aaa.foo.bar
>
> I have a metamodel with modelElements ExpressionList,
> AbstractExpression, StringExpression, BinaryDotExpression (I hope the
> names explain their meaning)
>
> Since the syntax above is left recursive, I use an operatorTemplate for
> BinaryDotExpression and make AbstractExpression operatored.
>
> What I would like to have, is that after parsing of the example above,
> the ExpressionList modelElement would directly contain as elements:
> (abc, BinaryDotExpression1, BinaryDotExpression2, BinaryDotExpression3,
> BinaryDotExpression4). What I get using TCS however is that
> ExpressionList only contains BinaryDotExpression4, which in turn
> contains BinaryDotExpression3 and "bar", and so forth as a tree.
>
> Is there any way to achieve this with TCS?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03381 seconds