Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [TCS] operatorTemplate source list containment
[TCS] operatorTemplate source list containment [message #18314] Tue, 29 July 2008 09:43 Go to next message
T Kruse is currently offline T KruseFriend
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 #18331 is a reply to message #18314] Tue, 29 July 2008 10:00 Go to previous messageGo to next message
T Kruse is currently offline T KruseFriend
Messages: 73
Registered: July 2009
Member
Note I will use other operators than the dot in combination as well, so I
cannot merely list the expressions and let the dot be a separator.
Re: [TCS] operatorTemplate source list containment [message #18347 is a reply to message #18314] Tue, 29 July 2008 14:47 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
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?
>
Previous Topic:[TCS] TCS and UML profiles
Next Topic:[TCS] Install TCS...
Goto Forum:
  


Current Time: Thu Dec 26 17:55:52 GMT 2024

Powered by FUDForum. Page generated in 0.03381 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top